1
0
Fork 0
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:
Cedric Beust 2015-12-26 00:15:57 +04:00
parent 9ec8be4adc
commit c428febd41

View file

@ -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}")
}
}
}
}