Skip to content

Commit 14d877c

Browse files
committed
Run PDEWelcomeTests headless
1 parent 3e81723 commit 14d877c

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ dependencies {
140140
}
141141

142142
tasks.test {
143+
systemProperty("java.awt.headless", "true")
143144
useJUnitPlatform()
144145
workingDir = file("build/test")
145146
workingDir.mkdirs()

app/src/processing/app/ui/PDEWelcome.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import processing.app.*
3939
import processing.app.api.Contributions.ExamplesList.Companion.listAllExamples
4040
import processing.app.api.Sketch.Companion.Sketch
4141
import processing.app.ui.theme.*
42+
import java.awt.GraphicsEnvironment
4243
import java.io.File
4344
import kotlin.io.path.Path
4445
import kotlin.io.path.exists
@@ -554,10 +555,14 @@ fun Sketch.card(onOpen: () -> Unit = {}) {
554555
}
555556

556557
fun noBaseWarning() {
557-
Messages.showWarning(
558-
"No Base",
559-
"No Base instance provided, this ui is likely being previewed."
560-
)
558+
if (Base.isCommandLine() || GraphicsEnvironment.isHeadless()) {
559+
System.err.println("No Base instance provided, this ui is likely being previewed");
560+
} else {
561+
Messages.showWarning(
562+
"No Base",
563+
"No Base instance provided, this ui is likely being previewed."
564+
)
565+
}
561566
}
562567

563568
val size = DpSize(970.dp, 600.dp)

0 commit comments

Comments
 (0)