mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Add "jvmArgs" to test{}.
This commit is contained in:
parent
1ee183d5c1
commit
63a9c1f159
3 changed files with 8 additions and 2 deletions
|
@ -7,6 +7,10 @@ class TestConfig(val project: Project) {
|
|||
fun args(vararg arg: String) {
|
||||
project.testArgs.addAll(arg)
|
||||
}
|
||||
|
||||
fun jvmArgs(vararg arg: String) {
|
||||
project.testJvmArgs.addAll(arg)
|
||||
}
|
||||
}
|
||||
|
||||
@Directive
|
||||
|
|
|
@ -26,7 +26,8 @@ open public class Project(
|
|||
|
||||
override var buildConfig: BuildConfig? = null
|
||||
|
||||
var testArgs: ArrayList<String> = arrayListOf()
|
||||
val testArgs = arrayListOf<String>()
|
||||
val testJvmArgs = arrayListOf<String>()
|
||||
|
||||
val projectProperties = ProjectProperties()
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ abstract class GenericTestRunner(open val project: Project, open val classpath:
|
|||
abstract val args: List<String>
|
||||
|
||||
protected fun findTestClasses(): List<String> {
|
||||
val path = KFiles.joinDir(project.directory, project.buildDirectory!!, KFiles.TEST_CLASSES_DIR)
|
||||
val path = KFiles.joinDir(project.directory, project.buildDirectory, KFiles.TEST_CLASSES_DIR)
|
||||
val result = KFiles.findRecursively(File(path), arrayListOf(File(".")), {
|
||||
file -> file.endsWith(".class")
|
||||
}).map {
|
||||
|
@ -45,6 +45,7 @@ abstract class GenericTestRunner(open val project: Project, open val classpath:
|
|||
if (args.size > 0) {
|
||||
val allArgs = arrayListOf<String>().apply {
|
||||
add(java!!.absolutePath)
|
||||
addAll(project.testJvmArgs)
|
||||
add("-classpath")
|
||||
add(classpath.map { it.jarFile.get().absolutePath }.joinToString(File.pathSeparator))
|
||||
add(mainClass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue