[Gradle] Cover KT-50598 by tests
This commit is contained in:
committed by
Space
parent
a20fbf867f
commit
3d45bcf08d
+19
-7
@@ -38,24 +38,36 @@ class DifferentClassloadersIT : KGPBaseTest() {
|
|||||||
buildAndFail("publish", "-PmppProjectDependency=true") {
|
buildAndFail("publish", "-PmppProjectDependency=true") {
|
||||||
assertOutputContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
assertOutputContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check that the message is also printed on subsequent builds
|
||||||
|
buildAndFail("publish", "-PmppProjectDependency=true") {
|
||||||
|
assertOutputContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisplayName("KT-50598: Different classloaders message is only displayed on the first build")
|
@DisplayName("KT-50598: Different classloaders message can be disabled")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun differentClassloadersOnlyFirstBuild(gradleVersion: GradleVersion) {
|
fun differentClassloadersWarningCanBeDisabled(gradleVersion: GradleVersion) {
|
||||||
project("differentClassloaders", gradleVersion) {
|
project("differentClassloaders", gradleVersion) {
|
||||||
setupDifferentClassloadersProject()
|
setupDifferentClassloadersProject()
|
||||||
|
|
||||||
build("-PmppProjectDependency=true") {
|
fun checkThatWarningIsShown() {
|
||||||
assertOutputContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
build("-PmppProjectDependency=true") {
|
||||||
|
assertOutputContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||||
|
|
||||||
val specificProjectsReported = Regex("$MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING((?:'.*'(?:, )?)+)")
|
val specificProjectsReported = Regex("$MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING((?:'.*'(?:, )?)+)")
|
||||||
.find(output)!!.groupValues[1].split(", ").map { it.removeSurrounding("'") }.toSet()
|
.find(output)!!.groupValues[1].split(", ").map { it.removeSurrounding("'") }.toSet()
|
||||||
|
|
||||||
assertEquals(setOf(":mpp-lib", ":jvm-app", ":js-app"), specificProjectsReported)
|
assertEquals(setOf(":mpp-lib", ":jvm-app", ":js-app"), specificProjectsReported)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkThatWarningIsShown()
|
||||||
|
|
||||||
|
// check that the message is also printed on subsequent builds
|
||||||
|
checkThatWarningIsShown()
|
||||||
|
|
||||||
// Test the flag that turns off the warnings
|
// Test the flag that turns off the warnings
|
||||||
build("-PmppProjectDependency=true", "-Pkotlin.pluginLoadedInMultipleProjects.ignore=true") {
|
build("-PmppProjectDependency=true", "-Pkotlin.pluginLoadedInMultipleProjects.ignore=true") {
|
||||||
assertOutputDoesNotContain(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
assertOutputDoesNotContain(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||||
|
|||||||
Reference in New Issue
Block a user