[Native][tests] Minor: Add check to ensure all custom KLIBs are valid

This commit is contained in:
Dmitriy Dolovov
2022-10-06 17:35:47 +02:00
committed by Space Team
parent 09c6746d64
commit a8b0f8a145
@@ -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<File>)
internal value class CustomKlibs(val klibs: Set<File>) {
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: