[Test] Migrate all jvm tests runners for boxInline tests

This commit is contained in:
Dmitriy Novozhilov
2021-01-27 12:07:06 +03:00
parent 8973e3f362
commit 3a0eee64b8
25 changed files with 7119 additions and 3499 deletions
@@ -1,46 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.test.InTextDirectivesUtils
import java.io.File
abstract class AbstractCompileKotlinAgainstInlineKotlinTest : AbstractCompileKotlinAgainstKotlinTest() {
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
val isIgnored = InTextDirectivesUtils.isIgnoredTarget(backend, wholeFile, ignoreBackendDirectivePrefix)
val (factory1, factory2) = doTwoFileTest(
files.filter { it.name.endsWith(".kt") },
!isIgnored
)
try {
val allGeneratedFiles = factory1.asList() + factory2.asList()
InlineTestUtil.checkNoCallsToInline(
allGeneratedFiles.filterClassFiles(),
skipParameterCheckingInDirectives = files.any { "NO_CHECK_LAMBDA_INLINING" in it.directives },
skippedMethods = files.flatMapTo(mutableSetOf()) { it.directives.listValues("SKIP_INLINE_CHECK_IN") ?: emptyList() }
)
SMAPTestUtil.checkSMAP(files, allGeneratedFiles.filterClassFiles(), true)
} catch (e: Throwable) {
if (!isIgnored) {
println("FIRST:\n\n${factory1.createText()}\n\nSECOND:\n\n${factory2.createText()}")
}
throw e
}
}
override fun getIgnoreBackendDirectivePrefix(): String = "// IGNORE_BACKEND_MULTI_MODULE: "
}
@@ -1,27 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.codegen.ir
import org.jetbrains.kotlin.codegen.AbstractCompileKotlinAgainstInlineKotlinTest
import org.jetbrains.kotlin.test.TargetBackend
abstract class AbstractIrCompileKotlinAgainstInlineKotlinTest : AbstractCompileKotlinAgainstInlineKotlinTest() {
override val backend: TargetBackend get() = TargetBackend.JVM_IR
}
abstract class AbstractJvmIrAgainstOldBoxInlineTest : AbstractIrCompileKotlinAgainstInlineKotlinTest() {
override val backend: TargetBackend get() = TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD
override fun getBackendA(): TargetBackend = TargetBackend.JVM
override fun getBackendB(): TargetBackend = TargetBackend.JVM_IR
}
abstract class AbstractJvmOldAgainstIrBoxInlineTest : AbstractIrCompileKotlinAgainstInlineKotlinTest() {
override val backend: TargetBackend get() = TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR
override fun getBackendA(): TargetBackend = TargetBackend.JVM_IR
override fun getBackendB(): TargetBackend = TargetBackend.JVM
}