[Native][tests] Always run DumpedTestListing test at the host target
This is for simplification’s sake. We need to run executable file with --ktest_list_tests flag and compare test listing with the test listing produced during the compilation. ^KT-50316
This commit is contained in:
+1
@@ -34,6 +34,7 @@ import org.junit.jupiter.api.Test
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@Tag("infrastructure")
|
@Tag("infrastructure")
|
||||||
|
@EnforcedHostTarget
|
||||||
@TestMetadata(TEST_SUITE_PATH)
|
@TestMetadata(TEST_SUITE_PATH)
|
||||||
@TestDataPath("\$PROJECT_ROOT")
|
@TestDataPath("\$PROJECT_ROOT")
|
||||||
class InfrastructureDumpedTestListingTest : AbstractNativeSimpleTest() {
|
class InfrastructureDumpedTestListingTest : AbstractNativeSimpleTest() {
|
||||||
|
|||||||
+12
-3
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.konan.blackboxtest.support
|
package org.jetbrains.kotlin.konan.blackboxtest.support
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail
|
import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail
|
||||||
|
|
||||||
/*************** Process-level system properties ***************/
|
/*************** Process-level system properties ***************/
|
||||||
@@ -23,10 +24,18 @@ internal enum class ProcessLevelProperty(shortName: String) {
|
|||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
internal annotation class EnforcedProperty(val property: ClassLevelProperty, val propertyValue: String)
|
internal annotation class EnforcedProperty(val property: ClassLevelProperty, val propertyValue: String)
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
internal annotation class EnforcedHostTarget
|
||||||
|
|
||||||
internal class EnforcedProperties(testClass: Class<*>) {
|
internal class EnforcedProperties(testClass: Class<*>) {
|
||||||
private val enforcedAnnotations: Map<ClassLevelProperty, String> = testClass.annotations
|
private val enforcedAnnotations: Map<ClassLevelProperty, String> = buildMap {
|
||||||
.filterIsInstance<EnforcedProperty>()
|
testClass.annotations.forEach { annotation ->
|
||||||
.associate { it.property to it.propertyValue }
|
when (annotation) {
|
||||||
|
is EnforcedProperty -> this[annotation.property] = annotation.propertyValue
|
||||||
|
is EnforcedHostTarget -> this[ClassLevelProperty.TEST_TARGET] = HostManager.host.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
operator fun get(propertyType: ClassLevelProperty): String? = enforcedAnnotations[propertyType]
|
operator fun get(propertyType: ClassLevelProperty): String? = enforcedAnnotations[propertyType]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user