[Test] Migrate AbstractBytecodeTextTest to new test infrastructure

This commit is contained in:
Dmitriy Novozhilov
2021-01-25 14:40:14 +03:00
parent e928448e00
commit f61a318c9d
26 changed files with 3556 additions and 1737 deletions
@@ -16,13 +16,18 @@
package org.jetbrains.kotlin.android.synthetic.test
import org.jetbrains.kotlin.ObsoleteTestInfrastructure
import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest
import org.jetbrains.kotlin.codegen.checkGeneratedTextAgainstExpectedOccurrences
import org.jetbrains.kotlin.codegen.readExpectedOccurrences
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.test.ConfigurationKind
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.TestJdkKind
import org.jetbrains.kotlin.test.util.JUnit4Assertions
@OptIn(ObsoleteTestInfrastructure::class)
abstract class AbstractAndroidBytecodeShapeTest : AbstractBytecodeTextTest() {
private fun createAndroidAPIEnvironment(path: String) {
return createEnvironmentForConfiguration(KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.ANDROID_API), path)
@@ -40,6 +45,6 @@ abstract class AbstractAndroidBytecodeShapeTest : AbstractBytecodeTextTest() {
loadFileByFullPath(fileName)
val expected = readExpectedOccurrences(fileName)
val actual = generateToText()
checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true)
checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true, JUnit4Assertions)
}
}