Simplify Gradle test task configuration
As an added bonus, AbstractViewTests is now executed in the build.
This commit is contained in:
parent
280a1b8880
commit
670cbb9aed
|
@ -317,16 +317,11 @@ configure([rootProject] + javaProjects) { project ->
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
include(["**/*Tests.class", "**/*Test.class"])
|
||||||
systemProperty("java.awt.headless", "true")
|
systemProperty("java.awt.headless", "true")
|
||||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||||
systemProperty("io.netty.leakDetection.level", "paranoid")
|
systemProperty("io.netty.leakDetection.level", "paranoid")
|
||||||
useJUnitPlatform()
|
|
||||||
scanForTestClasses = false
|
|
||||||
include(["**/*Tests.class", "**/*Test.class"])
|
|
||||||
// Since we set scanForTestClasses to false, we need to filter out inner
|
|
||||||
// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
|
|
||||||
// run MyTests by itself will fail if MyTests contains any inner classes.
|
|
||||||
exclude(["**/Abstract*.class", '**/*$*'])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkstyle {
|
checkstyle {
|
||||||
|
|
|
@ -74,22 +74,21 @@ dependencies {
|
||||||
|
|
||||||
task junit(type: Test) {
|
task junit(type: Test) {
|
||||||
description = "Runs JUnit 4 and JUnit Jupiter tests."
|
description = "Runs JUnit 4 and JUnit Jupiter tests."
|
||||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
|
||||||
useJUnitPlatform {
|
useJUnitPlatform {
|
||||||
excludeTags "failing-test-case"
|
excludeTags "failing-test-case"
|
||||||
}
|
}
|
||||||
include(["**/*Tests.class", "**/*Test.class"])
|
include(["**/*Tests.class", "**/*Test.class"])
|
||||||
exclude(["**/testng/**/*.*"])
|
exclude(["**/testng/**/*.*"])
|
||||||
|
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||||
// Java Util Logging for the JUnit Platform.
|
// Java Util Logging for the JUnit Platform.
|
||||||
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
|
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
|
||||||
}
|
}
|
||||||
|
|
||||||
task testNG(type: Test) {
|
task testNG(type: Test) {
|
||||||
description = "Runs TestNG tests."
|
description = "Runs TestNG tests."
|
||||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
|
||||||
useTestNG()
|
useTestNG()
|
||||||
scanForTestClasses = false
|
|
||||||
include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
|
include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
|
||||||
|
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||||
// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
|
// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
|
||||||
// testLogging.showStandardStreams = true
|
// testLogging.showStandardStreams = true
|
||||||
// forkEvery 1
|
// forkEvery 1
|
||||||
|
|
Loading…
Reference in New Issue