mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Don't run the tests if no test classes were found.
This commit is contained in:
parent
9ec8be4adc
commit
c428febd41
1 changed files with 8 additions and 2 deletions
|
@ -3,6 +3,7 @@ package com.beust.kobalt.internal
|
||||||
import com.beust.kobalt.api.IClasspathDependency
|
import com.beust.kobalt.api.IClasspathDependency
|
||||||
import com.beust.kobalt.api.Project
|
import com.beust.kobalt.api.Project
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
|
import com.beust.kobalt.misc.warn
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
public class TestNgRunner() : GenericTestRunner() {
|
public class TestNgRunner() : GenericTestRunner() {
|
||||||
|
@ -19,8 +20,13 @@ public class TestNgRunner() : GenericTestRunner() {
|
||||||
if (testngXml.exists()) {
|
if (testngXml.exists()) {
|
||||||
add(testngXml.absolutePath)
|
add(testngXml.absolutePath)
|
||||||
} else {
|
} else {
|
||||||
add("-testclass")
|
val testClasses = findTestClasses(project, classpath)
|
||||||
add(findTestClasses(project, classpath).joinToString(","))
|
if (testClasses.size > 0) {
|
||||||
|
add("-testclass")
|
||||||
|
add(testClasses.joinToString(","))
|
||||||
|
} else {
|
||||||
|
warn("Couldn't find any test classes for ${project.name}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue