Fix tests broken in c6fa3634
This commit is contained in:
committed by
TeamCityServer
parent
a1c1a32515
commit
9cb740bfdb
@@ -1,3 +1,6 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
compiler/testData/cli/jvm/conflictingProjection.kt:10:15: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
|
compiler/testData/cli/jvm/conflictingProjection.kt:10:15: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
|
||||||
fun a8(value: Out<in Int>) {}
|
fun a8(value: Out<in Int>) {}
|
||||||
^
|
^
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
compiler/testData/cli/jvm/extendedCheckers.kt:2:12: warning: redundant explicit type
|
compiler/testData/cli/jvm/extendedCheckers.kt:2:12: warning: redundant explicit type
|
||||||
val i: Int = 1
|
val i: Int = 1
|
||||||
^
|
^
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
OK
|
OK
|
||||||
|
|||||||
+3
@@ -1,3 +1,6 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
compiler/testData/cli/jvm/firError.kt:5:13: error: x must be initialized before access
|
compiler/testData/cli/jvm/firError.kt:5:13: error: x must be initialized before access
|
||||||
println(x)
|
println(x)
|
||||||
^
|
^
|
||||||
|
|||||||
+3
@@ -1 +1,4 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
OK
|
OK
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:6:1: error: 'lateinit' modifier is not allowed on delegated properties
|
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:6:1: error: 'lateinit' modifier is not allowed on delegated properties
|
||||||
lateinit var kest by Delegate
|
lateinit var kest by Delegate
|
||||||
^
|
^
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:26: error: unresolved reference: getSomeInt
|
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:26: error: unresolved reference: getSomeInt
|
||||||
constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {}
|
constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {}
|
||||||
^
|
^
|
||||||
|
|||||||
+29
-21
@@ -51,15 +51,15 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
|
|||||||
* @return [destination]
|
* @return [destination]
|
||||||
*/
|
*/
|
||||||
protected fun compileLibrary(
|
protected fun compileLibrary(
|
||||||
libraryName: String,
|
libraryName: String,
|
||||||
destination: File = File(tmpdir, "$libraryName.jar"),
|
destination: File = File(tmpdir, "$libraryName.jar"),
|
||||||
additionalOptions: List<String> = emptyList(),
|
additionalOptions: List<String> = emptyList(),
|
||||||
compileJava: (sourceDir: File, javaFiles: List<File>, outputDir: File) -> Boolean = { _, javaFiles, outputDir ->
|
compileJava: (sourceDir: File, javaFiles: List<File>, outputDir: File) -> Boolean = { _, javaFiles, outputDir ->
|
||||||
KotlinTestUtils.compileJavaFiles(javaFiles, listOf("-d", outputDir.path))
|
KotlinTestUtils.compileJavaFiles(javaFiles, listOf("-d", outputDir.path))
|
||||||
},
|
},
|
||||||
checkKotlinOutput: (String) -> Unit = { actual -> assertEquals(normalizeOutput("" to ExitCode.OK), actual) },
|
checkKotlinOutput: (String) -> Unit = { actual -> assertEquals(normalizeOutput("" to ExitCode.OK), actual) },
|
||||||
manifest: Manifest? = null,
|
manifest: Manifest? = null,
|
||||||
extraClassPath: List<File> = emptyList()
|
extraClassPath: List<File> = emptyList()
|
||||||
): File {
|
): File {
|
||||||
val sourceDir = File(testDataDirectory, libraryName)
|
val sourceDir = File(testDataDirectory, libraryName)
|
||||||
val javaFiles = FileUtil.findFilesByMask(JAVA_FILES, sourceDir)
|
val javaFiles = FileUtil.findFilesByMask(JAVA_FILES, sourceDir)
|
||||||
@@ -84,13 +84,12 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
|
|||||||
if (isJar) {
|
if (isJar) {
|
||||||
destination.delete()
|
destination.delete()
|
||||||
val stream =
|
val stream =
|
||||||
if (manifest != null) JarOutputStream(destination.outputStream(), manifest)
|
if (manifest != null) JarOutputStream(destination.outputStream(), manifest)
|
||||||
else JarOutputStream(destination.outputStream())
|
else JarOutputStream(destination.outputStream())
|
||||||
stream.use { jar ->
|
stream.use { jar ->
|
||||||
ZipUtil.addDirToZipRecursively(jar, destination, outputDir, "", null, null)
|
ZipUtil.addDirToZipRecursively(jar, destination, outputDir, "", null, null)
|
||||||
}
|
}
|
||||||
}
|
} else assertNull("Manifest is ignored if destination is not a .jar file", manifest)
|
||||||
else assertNull("Manifest is ignored if destination is not a .jar file", manifest)
|
|
||||||
|
|
||||||
return destination
|
return destination
|
||||||
}
|
}
|
||||||
@@ -132,17 +131,26 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun normalizeOutput(output: Pair<String, ExitCode>): String {
|
protected fun normalizeOutput(output: Pair<String, ExitCode>): String {
|
||||||
return AbstractCliTest.getNormalizedCompilerOutput(output.first, output.second, testDataDirectory.path)
|
return AbstractCliTest.getNormalizedCompilerOutput(output.first, output.second, testDataDirectory.path).removeFirWarning()
|
||||||
.replace(FileUtil.toSystemIndependentName(tmpdir.absolutePath), "\$TMP_DIR\$")
|
.replace(FileUtil.toSystemIndependentName(tmpdir.absolutePath), "\$TMP_DIR\$")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun String.removeFirWarning(): String {
|
||||||
|
return this.replace(
|
||||||
|
"""warning: ATTENTION!
|
||||||
|
This build uses in-dev FIR:
|
||||||
|
-Xuse-fir
|
||||||
|
""", ""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun compileKotlin(
|
protected fun compileKotlin(
|
||||||
fileName: String,
|
fileName: String,
|
||||||
output: File,
|
output: File,
|
||||||
classpath: List<File> = emptyList(),
|
classpath: List<File> = emptyList(),
|
||||||
compiler: CLICompiler<*> = K2JVMCompiler(),
|
compiler: CLICompiler<*> = K2JVMCompiler(),
|
||||||
additionalOptions: List<String> = emptyList(),
|
additionalOptions: List<String> = emptyList(),
|
||||||
expectedFileName: String? = "output.txt"
|
expectedFileName: String? = "output.txt"
|
||||||
): Pair<String, ExitCode> {
|
): Pair<String, ExitCode> {
|
||||||
val args = mutableListOf<String>()
|
val args = mutableListOf<String>()
|
||||||
val sourceFile = File(testDataDirectory, fileName)
|
val sourceFile = File(testDataDirectory, fileName)
|
||||||
|
|||||||
+3
-2
@@ -514,8 +514,9 @@ abstract class BaseGradleIT {
|
|||||||
assertNull(regex.find(output), "Output should not contain '$regex'")
|
assertNull(regex.find(output), "Output should not contain '$regex'")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun CompiledProject.assertNoWarnings() {
|
fun CompiledProject.assertNoWarnings(sanitize: (String) -> String = { it }) {
|
||||||
val warnings = "w: .*".toRegex().findAll(output).map { it.groupValues[0] }
|
val clearedOutput = sanitize(output)
|
||||||
|
val warnings = "w: .*".toRegex().findAll(clearedOutput).map { it.groupValues[0] }
|
||||||
|
|
||||||
if (warnings.any()) {
|
if (warnings.any()) {
|
||||||
val message = (listOf("Output should not contain any warnings:") + warnings).joinToString(SYSTEM_LINE_SEPARATOR)
|
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) {
|
project.build("build", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertNoWarnings()
|
assertNoWarnings { removeFirWarning(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
val greeterKt = project.projectDir.getFileByName("Greeter.kt")
|
val greeterKt = project.projectDir.getFileByName("Greeter.kt")
|
||||||
@@ -192,7 +192,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
|||||||
|
|
||||||
project.build("build", options = options) {
|
project.build("build", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertNoWarnings()
|
assertNoWarnings { removeFirWarning(it) }
|
||||||
val affectedSources = project.projectDir.getFilesByNames(
|
val affectedSources = project.projectDir.getFilesByNames(
|
||||||
"Greeter.kt", "KotlinGreetingJoiner.kt",
|
"Greeter.kt", "KotlinGreetingJoiner.kt",
|
||||||
"TestGreeter.kt", "TestKotlinGreetingJoiner.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
|
@Test
|
||||||
fun testManyClassesIC() {
|
fun testManyClassesIC() {
|
||||||
val project = Project("manyClasses")
|
val project = Project("manyClasses")
|
||||||
|
|||||||
Reference in New Issue
Block a user