Test: override build.log in gradle IC tests

This commit is contained in:
Alexey Tsvetkov
2016-03-15 00:12:35 +03:00
parent c1a61b17c7
commit 61814eb23f
3 changed files with 40 additions and 2 deletions
@@ -20,9 +20,11 @@ import java.io.File
class BuildLogFinder(
private val isExperimentalEnabled: Boolean = false,
private val isDataContainerBuildLogEnabled: Boolean = false
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false
) {
companion object {
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
private const val EXPERIMENTAL_LOG = "experimental-ic-build.log"
private const val SIMPLE_LOG = "build.log"
@@ -32,6 +34,7 @@ class BuildLogFinder(
val names = dir.list() ?: arrayOf()
val files = names.filter { File(dir, it).isFile }.toSet()
val matchedName = when {
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG
isExperimentalEnabled && EXPERIMENTAL_LOG in files -> EXPERIMENTAL_LOG
SIMPLE_LOG in files -> SIMPLE_LOG
@@ -0,0 +1,35 @@
================ Step #1 =================
Cleaning output files:
out/production/module/Enum.class
End of files
Exit code: NOTHING_DONE
------------------------------------------
Compiling files:
src/Enum.java
End of files
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/UseKt.class
End of files
Compiling files:
src/use.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
When expression must be exhaustive, add necessary 'C' branch or 'else' branch instead
================ Step #2 =================
Cleaning output files:
out/production/module/Enum.class
End of files
Compiling files:
src/use.kt
End of files
Exit code: OK
------------------------------------------
Compiling files:
src/Enum.java
End of files
@@ -34,7 +34,7 @@ class KotlinGradlePluginJpsParametrizedCLIOnly : BaseIncrementalGradleIT() {
File(jpsResourcesPath, "changeIncrementalOption"),
File(jpsResourcesPath, "custom"),
File(jpsResourcesPath, "lookupTracker"))
private val buildLogFinder = BuildLogFinder(isExperimentalEnabled = true)
private val buildLogFinder = BuildLogFinder(isExperimentalEnabled = true, isGradleEnabled = true)
@Suppress("unused")
@Parameterized.Parameters(name = "{index}: {0}")