From a8b0f8a145d71d091f72b296ed4ad778e1710b76 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 6 Oct 2022 17:35:47 +0200 Subject: [PATCH] [Native][tests] Minor: Add check to ensure all custom KLIBs are valid --- .../blackboxtest/support/settings/TestProcessSettings.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt index 49e7921e9be..bd2df3d0bda 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt @@ -64,7 +64,14 @@ internal enum class TestMode(private val description: String) { * The set of custom (external) klibs that should be passed to the Kotlin/Native compiler. */ @JvmInline -internal value class CustomKlibs(val klibs: Set) +internal value class CustomKlibs(val klibs: Set) { + init { + val invalidKlibs = klibs.filterNot { it.isDirectory || (it.isFile && it.extension == "klib") } + assertTrue(invalidKlibs.isEmpty()) { + "There are invalid KLIBs that should be passed for the Kotlin/Native compiler: ${klibs.joinToString { "[$it]" }}" + } + } +} /** * Whether to force [TestKind.STANDALONE] for all tests where [TestKind] is assumed to be [TestKind.REGULAR] otherwise: