mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Fix test-output.
This commit is contained in:
parent
12c4a84160
commit
ebe475c997
1 changed files with 6 additions and 13 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue