mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Better test failure message.
This commit is contained in:
parent
b2390f34f8
commit
3d689b3367
1 changed files with 10 additions and 1 deletions
|
@ -34,8 +34,15 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
|
|||
}
|
||||
"""
|
||||
|
||||
args.noIncremental = true
|
||||
val projectResults = compileBuildFile(buildFileText, args)
|
||||
return projectResults.projects.first { it.name == projectName }
|
||||
val result = projectResults.projects.firstOrNull { it.name == projectName }
|
||||
if (result == null) {
|
||||
throw IllegalArgumentException("Couldn't find project named $projectName in "
|
||||
+ projectResults.projects.map { it.name }.joinToString(", ", "[", "]"))
|
||||
} else {
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,6 +59,8 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
|
|||
val thisBuildFile = BuildFile(Paths.get(tmpBuildFile.absolutePath), "Build.kt")
|
||||
args.apply {
|
||||
buildFile = tmpBuildFile.absolutePath
|
||||
noIncremental = true
|
||||
noIncrementalKotlin = true
|
||||
}
|
||||
val jvmCompilerPlugin = Kobalt.findPlugin("JvmCompiler") as JvmCompilerPlugin
|
||||
val pluginInfo = PluginInfo(KobaltPluginXml(), null, null).apply {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue