Fix tests broken in c6fa3634
This commit is contained in:
committed by
TeamCityServer
parent
a1c1a32515
commit
9cb740bfdb
+3
-2
@@ -514,8 +514,9 @@ abstract class BaseGradleIT {
|
||||
assertNull(regex.find(output), "Output should not contain '$regex'")
|
||||
}
|
||||
|
||||
fun CompiledProject.assertNoWarnings() {
|
||||
val warnings = "w: .*".toRegex().findAll(output).map { it.groupValues[0] }
|
||||
fun CompiledProject.assertNoWarnings(sanitize: (String) -> String = { it }) {
|
||||
val clearedOutput = sanitize(output)
|
||||
val warnings = "w: .*".toRegex().findAll(clearedOutput).map { it.groupValues[0] }
|
||||
|
||||
if (warnings.any()) {
|
||||
val message = (listOf("Output should not contain any warnings:") + warnings).joinToString(SYSTEM_LINE_SEPARATOR)
|
||||
|
||||
+10
-2
@@ -182,7 +182,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertNoWarnings()
|
||||
assertNoWarnings { removeFirWarning(it) }
|
||||
}
|
||||
|
||||
val greeterKt = project.projectDir.getFileByName("Greeter.kt")
|
||||
@@ -192,7 +192,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertNoWarnings()
|
||||
assertNoWarnings { removeFirWarning(it) }
|
||||
val affectedSources = project.projectDir.getFilesByNames(
|
||||
"Greeter.kt", "KotlinGreetingJoiner.kt",
|
||||
"TestGreeter.kt", "TestKotlinGreetingJoiner.kt"
|
||||
@@ -201,6 +201,14 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeFirWarning(output: String): String {
|
||||
return output.replace(
|
||||
"""w: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir""", ""
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testManyClassesIC() {
|
||||
val project = Project("manyClasses")
|
||||
|
||||
Reference in New Issue
Block a user