diff --git a/build.gradle.kts b/build.gradle.kts index e8a659162e6..fc7686e8230 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -814,6 +814,7 @@ tasks { dependsOn(":kotlin-atomicfu-compiler-plugin:nativeTest") dependsOn(":native:analysis-api-klib-reader:check") dependsOn(":native:native.tests:test") + dependsOn(":native:native.tests:driver:check") dependsOn(":native:native.tests:stress:check") dependsOn(":native:objcexport-header-generator:check") dependsOn(":native:swift:swift-export-standalone:test") diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index 613bc284a32..d523fbd4163 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -56,7 +56,6 @@ val debuggerTest = nativeTest("debuggerTest", "debugger") val cachesTest = nativeTest("cachesTest", "caches") val klibTest = nativeTest("klibTest", "klib") val standaloneTest = nativeTest("standaloneTest", "standalone") -val driverTest = nativeTest("driverTest", "driver") val testTags = findProperty("kotlin.native.tests.tags")?.toString() // Note: arbitrary JUnit tag expressions can be used in this property. diff --git a/native/native.tests/driver/build.gradle.kts b/native/native.tests/driver/build.gradle.kts new file mode 100644 index 00000000000..592cbea2c01 --- /dev/null +++ b/native/native.tests/driver/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { + kotlin("jvm") +} + +dependencies { + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter.api) + testRuntimeOnly(libs.junit.jupiter.engine) + + testImplementation(projectTests(":native:native.tests")) +} + +sourceSets { + "main" { none() } + "test" { + projectDefault() + generatedTestDir() + } +} + +testsJar {} + +nativeTest( + "test", + null, + allowParallelExecution = false, // Driver tests run Native compiler from CLI. This is resource-intensive and should be done isolated. +) \ No newline at end of file diff --git a/native/native.tests/testData/driver/driver0.kt b/native/native.tests/driver/testData/driver0.kt similarity index 100% rename from native/native.tests/testData/driver/driver0.kt rename to native/native.tests/driver/testData/driver0.kt diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt b/native/native.tests/driver/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt similarity index 99% rename from native/native.tests/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt rename to native/native.tests/driver/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt index 2840f95a653..2446f77487c 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt +++ b/native/native.tests/driver/tests/org/jetbrains/kotlin/konan/test/KonanDriverTest.kt @@ -41,7 +41,7 @@ class KonanDriverTest : AbstractNativeSimpleTest() { private val buildDir get() = testRunSettings.get().testBinariesDir private val konanc get() = konanHome.resolve("bin").resolve(if (HostManager.hostIsMingw) "konanc.bat" else "konanc") - private val testSuiteDir = File("native/native.tests/testData/driver") + private val testSuiteDir = File("native/native.tests/driver/testData") private val source = testSuiteDir.resolve("driver0.kt") @Test diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeSimpleTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeSimpleTest.kt index a7fa14d2148..9bcc1510b8f 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeSimpleTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeSimpleTest.kt @@ -16,7 +16,7 @@ import kotlin.test.fail @ExtendWith(NativeSimpleTestSupport::class) abstract class AbstractNativeSimpleTest { - internal lateinit var testRunSettings: SimpleTestRunSettings + lateinit var testRunSettings: SimpleTestRunSettings internal lateinit var testRunProvider: SimpleTestRunProvider fun muteForK2(isK2: Boolean, test: () -> Unit) { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/NativeSimpleTestUtils.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/NativeSimpleTestUtils.kt index d2f5135af94..eb186fb223b 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/NativeSimpleTestUtils.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/NativeSimpleTestUtils.kt @@ -103,7 +103,7 @@ internal class ExecutableBuilder( } internal val AbstractNativeSimpleTest.buildDir: File get() = testRunSettings.get().testBinariesDir -internal val AbstractNativeSimpleTest.targets: KotlinNativeTargets get() = testRunSettings.get() +val AbstractNativeSimpleTest.targets: KotlinNativeTargets get() = testRunSettings.get() internal fun TestCompilationArtifact.KLIB.asLibraryDependency() = ExistingDependency(this, TestCompilationDependencyType.Library) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/LoggedData.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/LoggedData.kt index 5b753b581c0..8cc8bb16055 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/LoggedData.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/LoggedData.kt @@ -22,7 +22,7 @@ import kotlin.time.DurationUnit * * Handles all the necessary formatting right inside of [computeText]. Caches the resulting text to avoid re-computation. */ -internal abstract class LoggedData { +abstract class LoggedData { private val text: String by lazy { computeText() } protected abstract fun computeText(): String final override fun toString() = text diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/NamedEntities.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/NamedEntities.kt index 75e905984d9..17a47d1bdd4 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/NamedEntities.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/NamedEntities.kt @@ -8,7 +8,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support /** * Represents a package name. */ -internal class PackageName private constructor(private val fqn: String, val segments: List): Comparable { +class PackageName private constructor(private val fqn: String, val segments: List): Comparable { constructor(segments: List) : this(segments.joinToString("."), segments) constructor(fqn: String) : this(fqn, if (fqn.isNotEmpty()) fqn.split('.') else emptyList()) @@ -33,7 +33,7 @@ internal class PackageName private constructor(private val fqn: String, val segm * [packagePartClassName] - package-part class name (if there is any) * [functionName] - name of test function */ -internal class TestName: Comparable { +class TestName: Comparable { private val fqn: String val packageName: PackageName diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestCase.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestCase.kt index d05b9690514..dc2b13400e4 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestCase.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestCase.kt @@ -20,7 +20,7 @@ import java.io.File /** * Represents a single file that will be supplied to the compiler. */ -internal class TestFile private constructor( +class TestFile private constructor( val location: File, val module: M, private var state: State @@ -79,7 +79,7 @@ internal class TestFile private constructor( * [TestModule.Shared] represents a "shared" module, i.e. the auxiliary module that can be used in multiple [TestCase]s. * Such module is compiled to KLIB */ -internal sealed class TestModule { +sealed class TestModule { abstract val name: String abstract val files: Set> @@ -157,7 +157,7 @@ internal sealed class TestModule { * * [testCaseGroupId] - a unique ID of [TestCaseGroup] this [TestCase] belongs to. */ -internal interface TestCaseId { +interface TestCaseId { val testCaseGroupId: TestCaseGroupId data class TestDataFile(val file: File) : TestCaseId { @@ -181,7 +181,7 @@ internal interface TestCaseId { * [nominalPackageName] - the unique package name that was computed for this [TestCase] based on [id]. * Note: It depends on the concrete [TestKind] whether the package name will be enforced for the [TestFile]s or not. */ -internal class TestCase( +class TestCase( val id: TestCaseId, val kind: TestKind, val modules: Set, @@ -281,7 +281,7 @@ internal class TestCase( /** * A unique identified of [TestCaseGroup]. */ -internal interface TestCaseGroupId { +interface TestCaseGroupId { data class TestDataDir(val dir: File) : TestCaseGroupId data class Named(val uniqueName: String) : TestCaseGroupId } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestDirectives.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestDirectives.kt index 21d276bed16..662e1cc8f2b 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestDirectives.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/TestDirectives.kt @@ -201,7 +201,7 @@ internal object TestDirectives : SimpleDirectivesContainer() { } // mimics class `JVMAssertionsMode` -internal enum class AssertionsMode(val description: String) { +enum class AssertionsMode(val description: String) { ALWAYS_ENABLE("always-enable"), ALWAYS_DISABLE("always-disable"), JVM("jvm"), @@ -214,20 +214,20 @@ internal enum class AssertionsMode(val description: String) { } } -internal enum class TestKind { +enum class TestKind { REGULAR, STANDALONE, STANDALONE_NO_TR, STANDALONE_LLDB; } -internal enum class TestRunnerType { +enum class TestRunnerType { DEFAULT, WORKER, NO_EXIT } -internal enum class MutedOption { +enum class MutedOption { DEFAULT, K1, K2 @@ -241,7 +241,7 @@ internal class TestCInteropArgs(cinteropArgs: List) : TestCompilerArgs(e constructor(vararg cinteropArgs: String) : this(cinteropArgs.asList()) } -internal open class TestCompilerArgs( +open class TestCompilerArgs( val compilerArgs: List, val cinteropArgs: List = emptyList(), val assertionsMode: AssertionsMode = AssertionsMode.DEFAULT, diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilation.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilation.kt index f6e67a558cd..baac2acf1b0 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilation.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilation.kt @@ -33,11 +33,11 @@ private fun AssertionsMode.assertionsEnabledWith(optimizationMode: OptimizationM else -> optimizationMode != OptimizationMode.OPT } -internal abstract class TestCompilation { +abstract class TestCompilation { abstract val result: TestCompilationResult } -internal abstract class BasicCompilation( +abstract class BasicCompilation( protected val targets: KotlinNativeTargets, protected val home: KotlinNativeHome, private val classLoader: KotlinNativeClassLoader, @@ -184,7 +184,7 @@ internal abstract class BasicCompilation( } } -internal abstract class SourceBasedCompilation( +abstract class SourceBasedCompilation( targets: KotlinNativeTargets, home: KotlinNativeHome, classLoader: KotlinNativeClassLoader, @@ -491,7 +491,7 @@ internal class SwiftCompilation( } } -internal class ExecutableCompilation( +class ExecutableCompilation( settings: Settings, freeCompilerArgs: TestCompilerArgs, sourceModules: Collection, @@ -664,7 +664,7 @@ internal class StaticCacheCompilation( } } -internal class CategorizedDependencies(uncategorizedDependencies: Iterable>) { +class CategorizedDependencies(uncategorizedDependencies: Iterable>) { val failures: Set by lazy { uncategorizedDependencies.flatMapToSet { dependency -> when (val result = (dependency as? TestCompilation<*>)?.result) { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationArtifact.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationArtifact.kt index 0ef3b95f070..d62da7468b3 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationArtifact.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationArtifact.kt @@ -7,7 +7,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.compilation import java.io.File -internal sealed interface TestCompilationArtifact { +sealed interface TestCompilationArtifact { val logFile: File data class KLIB(val klibFile: File) : TestCompilationArtifact { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationDependency.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationDependency.kt index 51f7960bcfa..0f2f4cedf25 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationDependency.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationDependency.kt @@ -18,7 +18,7 @@ import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilat * [IncludedLibrary] - similarly but included modules (-Xinclude). * Note: there cannot be DependsOnLibrary type, since `dependsOn` dependency works only within a KLIB, not between KLIBs. */ -internal sealed class TestCompilationDependencyType(private val artifactClass: Class) { +sealed class TestCompilationDependencyType(private val artifactClass: Class) { object Library : TestCompilationDependencyType(KLIB::class.java) object FriendLibrary : TestCompilationDependencyType(KLIB::class.java) object IncludedLibrary : TestCompilationDependencyType(KLIB::class.java) @@ -26,7 +26,7 @@ internal sealed class TestCompilationDependencyType object LibraryStaticCache : TestCompilationDependencyType(KLIBStaticCache::class.java) } -internal sealed interface TestCompilationDependency { +sealed interface TestCompilationDependency { val artifact: A val type: TestCompilationDependencyType } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationResult.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationResult.kt index 73a29dee9ba..30348aad50c 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationResult.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/TestCompilationResult.kt @@ -12,7 +12,7 @@ class CompilationToolException(val reason: String) : Exception() { override fun toString() = "CompilationToolException: $reason" } -internal sealed interface TestCompilationResult { +sealed interface TestCompilationResult { sealed interface ImmediateResult : TestCompilationResult { val loggedData: LoggedData } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/RunResult.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/RunResult.kt index 85c5ee9d27a..d6a6f668a75 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/RunResult.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/RunResult.kt @@ -8,7 +8,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.runner import org.jetbrains.kotlin.konan.test.blackbox.support.util.TestOutputFilter import kotlin.time.Duration -internal data class RunResult( +data class RunResult( val testExecutable: TestExecutable, // KT-62157: TODO extract out of RunResult and pass Pair(TestExecutable, RunResult) val exitCode: Int?, val timeout: Duration, @@ -22,4 +22,4 @@ internal data class RunResult( } } -internal class ProcessOutput(val stdOut: TestOutputFilter.FilteredOutput, val stdErr: String) +class ProcessOutput(val stdOut: TestOutputFilter.FilteredOutput, val stdErr: String) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRun.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRun.kt index 9d0e526d3d0..98bebb72068 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRun.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRun.kt @@ -16,7 +16,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import java.io.File import java.io.IOException -internal class TestExecutable( +class TestExecutable( val executable: Executable, val loggedCompilationToolCall: LoggedData.CompilerCall, val testNames: Collection @@ -50,7 +50,7 @@ internal class TestExecutable( } } -internal data class TestRun( +data class TestRun( val displayName: String, val executable: TestExecutable, val runParameters: List, @@ -59,7 +59,7 @@ internal data class TestRun( val expectedFailure: Boolean, ) -internal sealed interface TestRunParameter { +sealed interface TestRunParameter { fun applyTo(programArgs: MutableList) sealed class WithFilter : TestRunParameter { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRunChecks.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRunChecks.kt index 70c867abff4..a2acd844aad 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRunChecks.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/runner/TestRunChecks.kt @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Assumptions import java.io.File import kotlin.time.Duration -internal sealed interface TestRunCheck { +sealed interface TestRunCheck { fun apply(testRun: TestRun, runResult: RunResult): Result @@ -280,7 +280,7 @@ internal sealed interface TestRunCheck { } } -internal data class TestRunChecks( +data class TestRunChecks( val executionTimeoutCheck: ExecutionTimeout, val testFiltering: TestFiltering, private val exitCodeCheck: ExitCode?, diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsContainers.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsContainers.kt index 1b3c0cd7ad3..5bafed9b3d4 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsContainers.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsContainers.kt @@ -13,7 +13,7 @@ import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail import kotlin.reflect.KClass -internal abstract class Settings(private val parent: Settings?, settings: Iterable) { +abstract class Settings(private val parent: Settings?, settings: Iterable) { private val map: Map, Any> = buildMap { settings.forEach { val settingClass: KClass<*> @@ -48,7 +48,7 @@ internal abstract class Settings(private val parent: Settings?, settings: Iterab * | [TestClassSettings] | [TestProcessSettings] | The single top-level (enclosing) test class | * | [TestRunSettings] | [TestClassSettings] | The single test run of a test function | */ -internal class TestProcessSettings(vararg settings: Any) : Settings(parent = null, settings.asIterable()) +class TestProcessSettings(vararg settings: Any) : Settings(parent = null, settings.asIterable()) internal class TestClassSettings(parent: TestProcessSettings, settings: Iterable) : Settings(parent, settings) internal class TestRunSettings(parent: TestClassSettings, settings: Iterable) : Settings(parent, settings) @@ -61,8 +61,8 @@ internal class TestRunSettings(parent: TestClassSettings, settings: Iterable) : Settings(parent, settings) -internal class SimpleTestRunSettings(parent: SimpleTestClassSettings, settings: Iterable) : Settings(parent, settings) +class SimpleTestClassSettings(parent: TestProcessSettings, settings: Iterable) : Settings(parent, settings) +class SimpleTestRunSettings(parent: SimpleTestClassSettings, settings: Iterable) : Settings(parent, settings) internal val Settings.configurables: Configurables get() { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsExecutor.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsExecutor.kt index a17b1b2fbc6..e9a2cded13f 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsExecutor.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/SettingsExecutor.kt @@ -15,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap private val executorCache: ConcurrentHashMap = ConcurrentHashMap() -internal val Settings.executor: Executor +val Settings.executor: Executor get() = with(get()) { executorCache.computeIfAbsent(testTarget) { val configurables = configurables diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestClassSettings.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestClassSettings.kt index a4fa86d54ec..85a540cbb20 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestClassSettings.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestClassSettings.kt @@ -26,7 +26,7 @@ internal class GeneratedSources(val testSourcesDir: File, val sharedSourcesDir: * [sharedBinariesDir] - The directory with compiled shared modules (klibs). * [givenBinariesDir] - The directory with the given (external) modules (klibs). */ -internal class Binaries(val testBinariesDir: File, lazySharedBinariesDir: () -> File, lazyGivenBinariesDir: () -> File) { +class Binaries(val testBinariesDir: File, lazySharedBinariesDir: () -> File, lazyGivenBinariesDir: () -> File) { val sharedBinariesDir: File by lazy { lazySharedBinariesDir() } val givenBinariesDir: File by lazy { lazyGivenBinariesDir() } } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestProcessSettings.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestProcessSettings.kt index e902577a7fb..08f9d7de054 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestProcessSettings.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/settings/TestProcessSettings.kt @@ -25,14 +25,14 @@ import kotlin.time.Duration.Companion.seconds /** * The tested and the host Kotlin/Native targets. */ -internal class KotlinNativeTargets(val testTarget: KonanTarget, val hostTarget: KonanTarget) { +class KotlinNativeTargets(val testTarget: KonanTarget, val hostTarget: KonanTarget) { fun areDifferentTargets() = testTarget != hostTarget } /** * The Kotlin/Native home. */ -internal class KotlinNativeHome(val dir: File) { +class KotlinNativeHome(val dir: File) { val librariesDir: File = dir.resolve("klib") val stdlibFile: File = librariesDir.resolve("common/stdlib") val properties: Properties by lazy { @@ -56,7 +56,7 @@ internal class LLDB(nativeHome: KotlinNativeHome) { /** * Lazy-initialized class loader with the Kotlin/Native embedded compiler. */ -internal class KotlinNativeClassLoader(private val lazyClassLoader: Lazy) { +class KotlinNativeClassLoader(private val lazyClassLoader: Lazy) { val classLoader: ClassLoader get() = lazyClassLoader.value } @@ -82,7 +82,7 @@ internal enum class TestMode(private val description: String) { * Kotlin compiler plugins to be used together with the the Kotlin/Native compiler. */ @JvmInline -internal value class CompilerPlugins(val compilerPluginJars: Set) { +value class CompilerPlugins(val compilerPluginJars: Set) { init { val invalidJars = compilerPluginJars.filterNot { it.isDirectory || (it.isFile && it.extension == "jar") } assertTrue(invalidJars.isEmpty()) { @@ -122,7 +122,7 @@ internal value class SharedExecutionTestRunner(val value: Boolean) /** * Optimization mode to be applied. */ -internal enum class OptimizationMode(private val description: String, val compilerFlag: String?) { +enum class OptimizationMode(private val description: String, val compilerFlag: String?) { DEBUG("Build with debug information", "-g"), OPT("Build with optimizations applied", "-opt"), NO("Don't use any specific optimizations", null); @@ -133,7 +133,7 @@ internal enum class OptimizationMode(private val description: String, val compil /** * Thread state checked. Can be applied only with [OptimizationMode.DEBUG], [CacheMode.WithoutCache]. */ -internal enum class ThreadStateChecker(val compilerFlag: String?) { +enum class ThreadStateChecker(val compilerFlag: String?) { DISABLED(null), ENABLED("-Xbinary=checkStateAtExternalCalls=true"); @@ -143,7 +143,7 @@ internal enum class ThreadStateChecker(val compilerFlag: String?) { /** * Type of sanitizer. Can be applied only with [CacheMode.WithoutCache] */ -internal enum class Sanitizer(val compilerFlag: String?) { +enum class Sanitizer(val compilerFlag: String?) { NONE(null), THREAD("-Xbinary=sanitizer=thread"); @@ -153,7 +153,7 @@ internal enum class Sanitizer(val compilerFlag: String?) { /** * Garbage collector type. */ -internal enum class GCType(val compilerFlag: String?) { +enum class GCType(val compilerFlag: String?) { UNSPECIFIED(null), NOOP("-Xbinary=gc=noop"), STWMS("-Xbinary=gc=stwms"), @@ -166,7 +166,7 @@ internal enum class GCType(val compilerFlag: String?) { override fun toString() = compilerFlag?.let { "($it)" }.orEmpty() } -internal enum class GCScheduler(val compilerFlag: String?) { +enum class GCScheduler(val compilerFlag: String?) { UNSPECIFIED(null), MANUAL("-Xbinary=gcSchedulerType=manual"), ADAPTIVE("-Xbinary=gcSchedulerType=adaptive"), @@ -180,7 +180,7 @@ internal enum class GCScheduler(val compilerFlag: String?) { override fun toString() = compilerFlag?.let { "($it)" }.orEmpty() } -internal enum class Allocator(val compilerFlag: String?) { +enum class Allocator(val compilerFlag: String?) { UNSPECIFIED(null), STD("-Xallocator=std"), MIMALLOC("-Xallocator=mimalloc"), @@ -206,7 +206,7 @@ internal class Timeouts(val executionTimeout: Duration) { /** * Used cache mode. */ -internal sealed class CacheMode { +sealed class CacheMode { abstract val staticCacheForDistributionLibrariesRootDir: File? abstract val useStaticCacheForUserLibraries: Boolean abstract val makePerFileCaches: Boolean @@ -283,7 +283,7 @@ internal sealed class CacheMode { } } -internal enum class PipelineType(val mutedOption: MutedOption, val compilerFlags: List) { +enum class PipelineType(val mutedOption: MutedOption, val compilerFlags: List) { DEFAULT( MutedOption.DEFAULT, emptyList() @@ -300,7 +300,7 @@ internal enum class PipelineType(val mutedOption: MutedOption, val compilerFlags override fun toString() = if (compilerFlags.isEmpty()) "" else compilerFlags.joinToString(prefix = "(", postfix = ")", separator = " ") } -internal enum class CompilerOutputInterceptor { +enum class CompilerOutputInterceptor { DEFAULT, NONE } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ArgsBuilder.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ArgsBuilder.kt index d456d4f521a..4cd0afd8d2f 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ArgsBuilder.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ArgsBuilder.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.util -internal class ArgsBuilder { +class ArgsBuilder { private val args = mutableListOf() fun add(vararg args: String) { @@ -16,15 +16,15 @@ internal class ArgsBuilder { this.args += args } - inline fun add(rawArgs: Iterable, transform: (T) -> String) { + fun add(rawArgs: Iterable, transform: (T) -> String) { rawArgs.mapTo(args) { transform(it) } } - inline fun addFlattened(rawArgs: Iterable, transform: (T) -> Iterable) { + fun addFlattened(rawArgs: Iterable, transform: (T) -> Iterable) { rawArgs.flatMapTo(args) { transform(it) } } - inline fun addFlattenedTwice(rawArgs: Iterable, transform1: (T) -> Iterable, transform2: (R) -> String) { + fun addFlattenedTwice(rawArgs: Iterable, transform1: (T) -> Iterable, transform2: (R) -> String) { rawArgs.forEach { add(transform1(it), transform2) } } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/Collections.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/Collections.kt index 877551ff765..72026f7f1ff 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/Collections.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/Collections.kt @@ -11,7 +11,7 @@ import java.util.* internal fun Collection.toIdentitySet(): Set = Collections.newSetFromMap(IdentityHashMap()).apply { addAll(this@toIdentitySet) } -internal class FailOnDuplicatesSet : Set { +class FailOnDuplicatesSet : Set { private val uniqueElements: MutableSet = hashSetOf() operator fun plusAssign(element: E) { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/TestOutput.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/TestOutput.kt index 21426130a50..0e3f1b196a6 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/TestOutput.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/TestOutput.kt @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue import java.text.ParseException import org.jetbrains.kotlin.konan.test.blackbox.support.util.TCTestReportParseState as State -internal class TestReport( +class TestReport( val passedTests: Collection, val failedTests: Collection, val ignoredTests: Collection @@ -26,7 +26,7 @@ internal class TestReport( """.trimIndent() } -internal interface TestOutputFilter { +interface TestOutputFilter { fun filter(testOutput: String): FilteredOutput data class FilteredOutput(val filteredOutput: String, val testReport: TestReport?) diff --git a/settings.gradle b/settings.gradle index 3bcccf7ebee..5e839f0129a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -652,6 +652,7 @@ if (buildProperties.inJpsBuildIdeaSync) { ":kotlin-test", ":kotlin-test:kotlin-test-js-it", ":native:native.tests", + ":native:native.tests:driver", ":native:native.tests:stress" project(':kotlin-stdlib-common').projectDir = "$rootDir/libraries/stdlib/common" as File