[PL][tests] Mark K/N tests that should be executed without PL or with always some predefined mode
#KT-57378
This commit is contained in:
+2
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.*
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
||||||
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.util.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.util.*
|
||||||
@@ -20,6 +21,7 @@ import org.junit.jupiter.api.Tag
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@Tag("klib-contents")
|
@Tag("klib-contents")
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
abstract class AbstractNativeKlibContentsTest : AbstractNativeSimpleTest() {
|
abstract class AbstractNativeKlibContentsTest : AbstractNativeSimpleTest() {
|
||||||
|
|
||||||
protected fun runTest(@TestDataFile testPath: String) {
|
protected fun runTest(@TestDataFile testPath: String) {
|
||||||
|
|||||||
+5
-5
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.*
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.KLIB
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.KLIB
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.KLIBStaticCache
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.KLIBStaticCache
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
||||||
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestExecutable
|
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestExecutable
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunChecks
|
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunChecks
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.CacheMode
|
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.CacheMode
|
||||||
@@ -31,6 +32,7 @@ import org.jetbrains.kotlin.compatibility.binary.TestFile as TFile
|
|||||||
import org.jetbrains.kotlin.compatibility.binary.TestModule as TModule
|
import org.jetbrains.kotlin.compatibility.binary.TestModule as TModule
|
||||||
|
|
||||||
@Tag("klib-evolution")
|
@Tag("klib-evolution")
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
abstract class AbstractNativeKlibEvolutionTest : AbstractNativeSimpleTest() {
|
abstract class AbstractNativeKlibEvolutionTest : AbstractNativeSimpleTest() {
|
||||||
// Const evaluation tests muted for FIR because FIR does const propagation.
|
// Const evaluation tests muted for FIR because FIR does const propagation.
|
||||||
private fun isIgnoredTest(filePath: String): Boolean {
|
private fun isIgnoredTest(filePath: String): Boolean {
|
||||||
@@ -98,7 +100,7 @@ abstract class AbstractNativeKlibEvolutionTest : AbstractNativeSimpleTest() {
|
|||||||
)
|
)
|
||||||
val executableArtifact = TestCompilationArtifact.Executable(executableFile)
|
val executableArtifact = TestCompilationArtifact.Executable(executableFile)
|
||||||
|
|
||||||
val cachedDependencies: List<ExistingDependency<KLIBStaticCache>> = if (staticCacheRequiredForEveryLibrary) {
|
val cachedDependencies: List<ExistingDependency<KLIBStaticCache>> = if (useStaticCacheForUserLibraries) {
|
||||||
latestDependencies.map { (module, deps) ->
|
latestDependencies.map { (module, deps) ->
|
||||||
val testModule = module.module
|
val testModule = module.module
|
||||||
|
|
||||||
@@ -282,10 +284,8 @@ abstract class AbstractNativeKlibEvolutionTest : AbstractNativeSimpleTest() {
|
|||||||
initialize(null, null)
|
initialize(null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val buildDir: File
|
private val buildDir: File get() = testRunSettings.get<SimpleTestDirectories>().testBuildDir
|
||||||
get() = testRunSettings.get<SimpleTestDirectories>().testBuildDir
|
private val useStaticCacheForUserLibraries: Boolean get() = testRunSettings.get<CacheMode>().useStaticCacheForUserLibraries
|
||||||
private val staticCacheRequiredForEveryLibrary: Boolean
|
|
||||||
get() = testRunSettings.get<CacheMode>().staticCacheRequiredForEveryLibrary
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val COMPILER_ARGS_FOR_KLIB = TestCompilerArgs.EMPTY
|
private val COMPILER_ARGS_FOR_KLIB = TestCompilerArgs.EMPTY
|
||||||
|
|||||||
+10
-12
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.*
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationDependencyType.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationDependencyType.*
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess
|
||||||
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestExecutable
|
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestExecutable
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunChecks
|
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunChecks
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.*
|
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.*
|
||||||
@@ -25,6 +26,7 @@ import org.opentest4j.TestAbortedException
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@Tag("partial-linkage")
|
@Tag("partial-linkage")
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.ENABLED_WITH_WARNING)
|
||||||
abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
||||||
private inner class NativeTestConfiguration(testPath: String) : PartialLinkageTestUtils.TestConfiguration {
|
private inner class NativeTestConfiguration(testPath: String) : PartialLinkageTestUtils.TestConfiguration {
|
||||||
override val testDir = getAbsoluteFile(testPath)
|
override val testDir = getAbsoluteFile(testPath)
|
||||||
@@ -33,8 +35,8 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
|
|
||||||
override val testModeName = with(testRunSettings.get<CacheMode>()) {
|
override val testModeName = with(testRunSettings.get<CacheMode>()) {
|
||||||
val cacheModeAlias = when {
|
val cacheModeAlias = when {
|
||||||
staticCacheRootDir == null -> CacheMode.Alias.NO
|
!useStaticCacheForDistributionLibraries -> CacheMode.Alias.NO
|
||||||
!staticCacheRequiredForEveryLibrary -> CacheMode.Alias.STATIC_ONLY_DIST
|
!useStaticCacheForUserLibraries -> CacheMode.Alias.STATIC_ONLY_DIST
|
||||||
else -> CacheMode.Alias.STATIC_EVERYWHERE
|
else -> CacheMode.Alias.STATIC_EVERYWHERE
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +88,7 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
private fun buildKlib(moduleName: String, moduleSourceDir: File, dependencies: Dependencies, klibFile: File) {
|
private fun buildKlib(moduleName: String, moduleSourceDir: File, dependencies: Dependencies, klibFile: File) {
|
||||||
val klibArtifact = KLIB(klibFile)
|
val klibArtifact = KLIB(klibFile)
|
||||||
|
|
||||||
val testCase = createTestCase(moduleName, moduleSourceDir, COMPILER_ARGS_FOR_KLIB)
|
val testCase = createTestCase(moduleName, moduleSourceDir, COMPILER_ARGS)
|
||||||
|
|
||||||
val compilation = LibraryCompilation(
|
val compilation = LibraryCompilation(
|
||||||
settings = testRunSettings,
|
settings = testRunSettings,
|
||||||
@@ -102,7 +104,7 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildBinaryAndRun(allDependencies: Dependencies) {
|
private fun buildBinaryAndRun(allDependencies: Dependencies) {
|
||||||
val cacheDependencies = if (staticCacheRequiredForEveryLibrary) {
|
val cacheDependencies = if (useStaticCacheForUserLibraries) {
|
||||||
producedKlibs.map { producedKlib ->
|
producedKlibs.map { producedKlib ->
|
||||||
buildCacheForKlib(producedKlib)
|
buildCacheForKlib(producedKlib)
|
||||||
producedKlib.klibArtifact.toStaticCacheArtifact().toDependency()
|
producedKlib.klibArtifact.toStaticCacheArtifact().toDependency()
|
||||||
@@ -113,7 +115,7 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
val testCase = createTestCase(
|
val testCase = createTestCase(
|
||||||
moduleName = LAUNCHER_MODULE_NAME,
|
moduleName = LAUNCHER_MODULE_NAME,
|
||||||
moduleSourceDir = null, // No sources.
|
moduleSourceDir = null, // No sources.
|
||||||
compilerArgs = COMPILER_ARGS_FOR_STATIC_CACHE_AND_EXECUTABLE
|
compilerArgs = COMPILER_ARGS
|
||||||
)
|
)
|
||||||
|
|
||||||
val compilation = ExecutableCompilation(
|
val compilation = ExecutableCompilation(
|
||||||
@@ -134,7 +136,7 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
private fun buildCacheForKlib(producedKlib: ProducedKlib) {
|
private fun buildCacheForKlib(producedKlib: ProducedKlib) {
|
||||||
val compilation = StaticCacheCompilation(
|
val compilation = StaticCacheCompilation(
|
||||||
settings = testRunSettings,
|
settings = testRunSettings,
|
||||||
freeCompilerArgs = COMPILER_ARGS_FOR_STATIC_CACHE_AND_EXECUTABLE,
|
freeCompilerArgs = COMPILER_ARGS,
|
||||||
options = if (producedKlib.moduleName == MAIN_MODULE_NAME)
|
options = if (producedKlib.moduleName == MAIN_MODULE_NAME)
|
||||||
StaticCacheCompilation.Options.ForIncludedLibraryWithTests(executableArtifact, DEFAULT_EXTRAS)
|
StaticCacheCompilation.Options.ForIncludedLibraryWithTests(executableArtifact, DEFAULT_EXTRAS)
|
||||||
else
|
else
|
||||||
@@ -203,17 +205,13 @@ abstract class AbstractNativePartialLinkageTest : AbstractNativeSimpleTest() {
|
|||||||
|
|
||||||
private val buildDir: File get() = testRunSettings.get<SimpleTestDirectories>().testBuildDir
|
private val buildDir: File get() = testRunSettings.get<SimpleTestDirectories>().testBuildDir
|
||||||
private val stdlibFile: File get() = testRunSettings.get<KotlinNativeHome>().stdlibFile
|
private val stdlibFile: File get() = testRunSettings.get<KotlinNativeHome>().stdlibFile
|
||||||
private val staticCacheRequiredForEveryLibrary: Boolean get() = testRunSettings.get<CacheMode>().staticCacheRequiredForEveryLibrary
|
private val useStaticCacheForUserLibraries: Boolean get() = testRunSettings.get<CacheMode>().useStaticCacheForUserLibraries
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val COMPILER_ARGS_FOR_KLIB = TestCompilerArgs(
|
private val COMPILER_ARGS = TestCompilerArgs(
|
||||||
listOf("-nostdlib") // stdlib is passed explicitly.
|
listOf("-nostdlib") // stdlib is passed explicitly.
|
||||||
)
|
)
|
||||||
|
|
||||||
private val COMPILER_ARGS_FOR_STATIC_CACHE_AND_EXECUTABLE = TestCompilerArgs(
|
|
||||||
COMPILER_ARGS_FOR_KLIB.compilerArgs + "-Xpartial-linkage=enable"
|
|
||||||
)
|
|
||||||
|
|
||||||
private val DEFAULT_EXTRAS = WithTestRunnerExtras(TestRunnerType.DEFAULT)
|
private val DEFAULT_EXTRAS = WithTestRunnerExtras(TestRunnerType.DEFAULT)
|
||||||
|
|
||||||
private const val BACKED_UP_DIRECTORY_PREFIX = "__backup-"
|
private const val BACKED_UP_DIRECTORY_PREFIX = "__backup-"
|
||||||
|
|||||||
+3
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.TestCaseId
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.TestRunnerType
|
import org.jetbrains.kotlin.konan.blackboxtest.support.TestRunnerType
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
|
||||||
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
import org.junit.jupiter.api.TestFactory
|
import org.junit.jupiter.api.TestFactory
|
||||||
@@ -29,6 +30,7 @@ import org.junit.jupiter.api.TestFactory
|
|||||||
sourceLocations = ["libraries/kotlin.test/common/src/test/kotlin/**.kt"]
|
sourceLocations = ["libraries/kotlin.test/common/src/test/kotlin/**.kt"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
|
class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
|
||||||
@TestFactory
|
@TestFactory
|
||||||
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
||||||
@@ -54,6 +56,7 @@ class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
@FirPipeline
|
@FirPipeline
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
class FirKotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
|
class FirKotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
|
||||||
@TestFactory
|
@TestFactory
|
||||||
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedPaths.KOTLIN_NATIVE_DISTRIBUTION
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedPaths.KOTLIN_NATIVE_DISTRIBUTION
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
|
||||||
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
import org.junit.jupiter.api.TestFactory
|
import org.junit.jupiter.api.TestFactory
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ import org.junit.jupiter.api.TestFactory
|
|||||||
ignoredTests = [DISABLED_STDLIB_TEST]
|
ignoredTests = [DISABLED_STDLIB_TEST]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
class StdlibTest : AbstractNativeBlackBoxTest() {
|
class StdlibTest : AbstractNativeBlackBoxTest() {
|
||||||
@TestFactory
|
@TestFactory
|
||||||
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
||||||
@@ -100,6 +102,7 @@ class StdlibTest : AbstractNativeBlackBoxTest() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
@FirPipeline
|
@FirPipeline
|
||||||
|
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
|
||||||
class FirStdlibTest : AbstractNativeBlackBoxTest() {
|
class FirStdlibTest : AbstractNativeBlackBoxTest() {
|
||||||
@TestFactory
|
@TestFactory
|
||||||
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
fun default() = dynamicTestCase(TestCaseId.Named("default"))
|
||||||
|
|||||||
Reference in New Issue
Block a user