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.Project
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.warn
|
||||
import java.io.File
|
||||
|
||||
public class TestNgRunner() : GenericTestRunner() {
|
||||
|
@ -19,8 +20,13 @@ public class TestNgRunner() : GenericTestRunner() {
|
|||
if (testngXml.exists()) {
|
||||
add(testngXml.absolutePath)
|
||||
} else {
|
||||
val testClasses = findTestClasses(project, classpath)
|
||||
if (testClasses.size > 0) {
|
||||
add("-testclass")
|
||||
add(findTestClasses(project, classpath).joinToString(","))
|
||||
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