mirror of
https://github.com/processing/processing4.git
synced 2026-01-26 01:41:06 +01:00
Plugin tests bugfixes
This commit is contained in:
@@ -51,8 +51,8 @@ abstract class PDETask : SourceTask() {
|
||||
.files
|
||||
.groupBy { it.name }
|
||||
.map { entry ->
|
||||
// TODO: Select by which one is in the unsaved folder
|
||||
entry.value.maxByOrNull { it.lastModified() }!!
|
||||
entry.value.firstOrNull { it.parentFile?.name == "unsaved" }
|
||||
?: entry.value.first()
|
||||
}
|
||||
.joinToString("\n"){
|
||||
it.readText()
|
||||
|
||||
@@ -75,7 +75,7 @@ class ProcessingPluginTest{
|
||||
@Test
|
||||
fun testMultiplePDE(){
|
||||
val (buildResult, sketchFolder, classLoader) = createTemporaryProcessingSketch("build"){ sketchFolder ->
|
||||
sketchFolder.resolve("sketch.pde").writeText(""")
|
||||
sketchFolder.resolve("sketch.pde").writeText("""
|
||||
void setup(){
|
||||
size(100, 100);
|
||||
}
|
||||
@@ -175,24 +175,29 @@ class ProcessingPluginTest{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Test
|
||||
fun testImportingLibrary(){
|
||||
|
||||
|
||||
fun isDebuggerAttached(): Boolean {
|
||||
val runtimeMxBean = ManagementFactory.getRuntimeMXBean()
|
||||
val inputArguments = runtimeMxBean.inputArguments
|
||||
return inputArguments.any {
|
||||
it.contains("-agentlib:jdwp")
|
||||
}
|
||||
}
|
||||
fun openFolderInFinder(folder: File) {
|
||||
if (!folder.exists() || !folder.isDirectory) {
|
||||
println("Invalid directory: ${folder.absolutePath}")
|
||||
return
|
||||
}
|
||||
|
||||
val process = ProcessBuilder("open", folder.absolutePath)
|
||||
.inheritIO()
|
||||
.start()
|
||||
process.waitFor()
|
||||
}
|
||||
fun isDebuggerAttached(): Boolean {
|
||||
val runtimeMxBean = ManagementFactory.getRuntimeMXBean()
|
||||
val inputArguments = runtimeMxBean.inputArguments
|
||||
return inputArguments.any {
|
||||
it.contains("-agentlib:jdwp")
|
||||
}
|
||||
}
|
||||
fun openFolderInFinder(folder: File) {
|
||||
if (!folder.exists() || !folder.isDirectory) {
|
||||
println("Invalid directory: ${folder.absolutePath}")
|
||||
return
|
||||
}
|
||||
|
||||
val process = ProcessBuilder("open", folder.absolutePath)
|
||||
.inheritIO()
|
||||
.start()
|
||||
process.waitFor()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user