1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Fix test-output.

This commit is contained in:
Cedric Beust 2017-03-17 13:27:01 -07:00
parent 12c4a84160
commit ebe475c997

View file

@ -16,13 +16,14 @@ class TestNgRunner : GenericTestRunner() {
override val annotationPackage = "org.testng" override val annotationPackage = "org.testng"
fun defaultOutput(project: Project) = KFiles.joinDir(project.buildDirectory, "test-output") fun defaultOutput(project: Project) = KFiles.joinDir(KFiles.KOBALT_BUILD_DIR, project.buildDirectory, "test-output")
override fun args(project: Project, context: KobaltContext, classpath: List<IClasspathDependency>, override fun args(project: Project, context: KobaltContext, classpath: List<IClasspathDependency>,
testConfig: TestConfig) = arrayListOf<String>().apply { testConfig: TestConfig) = arrayListOf<String>().apply {
var addOutput = true
testConfig.testArgs.forEach { arg -> if (testConfig.testArgs.none { it == "-d" }) {
if (arg == "-d") addOutput = false add("-d")
add(defaultOutput(project))
} }
if (testConfig.testArgs.size == 0) { if (testConfig.testArgs.size == 0) {
@ -32,11 +33,7 @@ class TestNgRunner : GenericTestRunner() {
add(testngXml.absolutePath) add(testngXml.absolutePath)
} else { } else {
val testClasses = findTestClasses(project, context, testConfig) val testClasses = findTestClasses(project, context, testConfig)
if (testClasses.size > 0) { if (testClasses.isNotEmpty()) {
if (addOutput) {
add("-d")
add(defaultOutput(project))
}
addAll(testConfig.testArgs) addAll(testConfig.testArgs)
add("-testclass") add("-testclass")
@ -48,10 +45,6 @@ class TestNgRunner : GenericTestRunner() {
} }
} }
} else { } else {
if (addOutput) {
add("-d")
add(defaultOutput(project))
}
addAll(testConfig.testArgs) addAll(testConfig.testArgs)
} }
} }