[Gradle, JS] Make the KT-51801 test to cover KT-52925
This commit is contained in:
committed by
Space
parent
9f84e7651b
commit
10146a7028
+24
-24
@@ -257,30 +257,6 @@ class Kotlin2JsIrGradlePluginIT : AbstractKotlin2JsGradlePluginIT(true) {
|
||||
|
||||
@JsGradlePluginTests
|
||||
class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
||||
@DisplayName("incremental compilation with multiple js modules after compilation error works")
|
||||
@GradleTest
|
||||
fun testIncrementalCompilationWithMultipleModulesAfterCompilationError(gradleVersion: GradleVersion) {
|
||||
project("kotlin-js-ir-ic-multiple-artifacts", gradleVersion) {
|
||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
build("compileKotlinJs")
|
||||
|
||||
val libKt = subProject("lib").kotlinSourcesDir().resolve("Lib.kt") ?: error("No Lib.kt file in test project")
|
||||
val appKt = subProject("app").kotlinSourcesDir().resolve("App.kt") ?: error("No App.kt file in test project")
|
||||
|
||||
libKt.modify { it.replace("fun answer", "func answe") } // introduce compilation error
|
||||
buildAndFail("compileKotlinJs")
|
||||
libKt.modify { it.replace("func answe", "fun answer") } // revert compilation error
|
||||
appKt.modify { it.replace("Sheldon:", "Sheldon :") } // some change for incremental compilation
|
||||
build("compileKotlinJs", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {
|
||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
assertTasksUpToDate(":lib:compileKotlinJs")
|
||||
assertTasksExecuted(":app:compileKotlinJs")
|
||||
assertCompiledKotlinSources(listOf(appKt).relativizeTo(projectPath), output)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("builtins are loaded")
|
||||
@GradleTest
|
||||
fun testKotlinJsBuiltins(gradleVersion: GradleVersion) {
|
||||
@@ -1226,6 +1202,30 @@ abstract class AbstractKotlin2JsGradlePluginIT(protected val irBackend: Boolean)
|
||||
.let {
|
||||
Gson().fromJson(it.readText(), PackageJson::class.java)
|
||||
}
|
||||
|
||||
@DisplayName("incremental compilation with multiple js modules after compilation error works")
|
||||
@GradleTest
|
||||
fun testIncrementalCompilationWithMultipleModulesAfterCompilationError(gradleVersion: GradleVersion) {
|
||||
project("kotlin-js-ir-ic-multiple-artifacts", gradleVersion) {
|
||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
build("compileKotlinJs")
|
||||
|
||||
val libKt = subProject("lib").kotlinSourcesDir().resolve("Lib.kt") ?: error("No Lib.kt file in test project")
|
||||
val appKt = subProject("app").kotlinSourcesDir().resolve("App.kt") ?: error("No App.kt file in test project")
|
||||
|
||||
libKt.modify { it.replace("fun answer", "func answe") } // introduce compilation error
|
||||
buildAndFail("compileKotlinJs")
|
||||
libKt.modify { it.replace("func answe", "fun answer") } // revert compilation error
|
||||
appKt.modify { it.replace("Sheldon:", "Sheldon :") } // some change for incremental compilation
|
||||
build("compileKotlinJs", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {
|
||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
assertTasksUpToDate(":lib:compileKotlinJs")
|
||||
assertTasksExecuted(":app:compileKotlinJs")
|
||||
assertCompiledKotlinSources(listOf(appKt).relativizeTo(projectPath), output)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsGradlePluginTests
|
||||
|
||||
Reference in New Issue
Block a user