[Native][tests] Keep KLIB dirs in KotlinNativeHome settings
^KT-50775
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@ abstract class AbstractNativeKlibABITest : AbstractNativeSimpleTest() {
|
||||
dependencies.map { ExistingLibraryDependency(TestCompilationArtifact.KLIB(it), Library) }
|
||||
|
||||
private val buildDir: File get() = testRunSettings.get<SimpleTestDirectories>().testBuildDir
|
||||
private val stdlibFile: File get() = testRunSettings.get<KotlinNativeHome>().dir.resolve("klib/common/stdlib")
|
||||
private val stdlibFile: File get() = testRunSettings.get<KotlinNativeHome>().stdlibFile
|
||||
|
||||
companion object {
|
||||
private val COMPILER_ARGS_FOR_KLIB = TestCompilerArgs(
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ class NativeBlackBoxTestSupport : BeforeEachCallback {
|
||||
val settings = createTestRunSettings()
|
||||
|
||||
// Set the essential compiler property.
|
||||
System.setProperty("kotlin.native.home", settings.get<KotlinNativeHome>().path)
|
||||
System.setProperty("kotlin.native.home", settings.get<KotlinNativeHome>().dir.path)
|
||||
|
||||
// Inject the required properties to test instance.
|
||||
with(settings.get<BlackBoxTestInstances>().enclosingTestInstance) {
|
||||
@@ -60,7 +60,7 @@ class NativeSimpleTestSupport : BeforeEachCallback {
|
||||
val settings = createSimpleTestRunSettings()
|
||||
|
||||
// Set the essential compiler property.
|
||||
System.setProperty("kotlin.native.home", settings.get<KotlinNativeHome>().path)
|
||||
System.setProperty("kotlin.native.home", settings.get<KotlinNativeHome>().dir.path)
|
||||
|
||||
// Inject the required properties to test instance.
|
||||
with(settings.get<SimpleTestInstances>().enclosingTestInstance) {
|
||||
@@ -96,7 +96,7 @@ private object NativeTestSupport {
|
||||
}
|
||||
|
||||
val nativeHome = computeNativeHome()
|
||||
val hostManager = HostManager(distribution = Distribution(nativeHome.path), experimental = false)
|
||||
val hostManager = HostManager(distribution = Distribution(nativeHome.dir.path), experimental = false)
|
||||
|
||||
val nativeTargets = computeNativeTargets(hostManager)
|
||||
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ internal abstract class SourceBasedCompilation<A : TestCompilationArtifact>(
|
||||
) {
|
||||
override fun applySpecificArgs(argsBuilder: ArgsBuilder): Unit = with(argsBuilder) {
|
||||
add(
|
||||
"-repo", home.dir.resolve("klib").path,
|
||||
"-repo", home.librariesDir.path,
|
||||
"-output", expectedArtifact.path
|
||||
)
|
||||
memoryModel.compilerFlags?.let { compilerFlags -> add(compilerFlags) }
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ internal class PredefinedTestCaseGroupProvider(annotation: PredefinedTestCases)
|
||||
private fun substituteRealPaths(value: String, settings: Settings): String =
|
||||
if ('$' in value) {
|
||||
// N.B. Here, more substitutions can be supported in the future if it would be necessary.
|
||||
value.replace(PredefinedPaths.KOTLIN_NATIVE_DISTRIBUTION, settings.get<KotlinNativeHome>().path)
|
||||
value.replace(PredefinedPaths.KOTLIN_NATIVE_DISTRIBUTION, settings.get<KotlinNativeHome>().dir.path)
|
||||
} else
|
||||
value
|
||||
}
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ internal class KotlinNativeTargets(val testTarget: KonanTarget, val hostTarget:
|
||||
* The Kotlin/Native home.
|
||||
*/
|
||||
internal class KotlinNativeHome(val dir: File) {
|
||||
val path: String get() = dir.path
|
||||
val librariesDir: File = dir.resolve("klib")
|
||||
val stdlibFile: File = librariesDir.resolve("common/stdlib")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user