[Native][tests] Re-organize Gradle tasks and test suite classes

This commit is contained in:
Dmitriy Dolovov
2021-12-09 02:41:06 +03:00
parent 835de3083a
commit 72bb38dc68
8 changed files with 21 additions and 30 deletions
@@ -20,8 +20,8 @@ fun main() {
// External box tests.
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "NativeExtBlackBoxTestGenerated",
annotations = listOf(daily(), provider<UseExtTestCaseGroupProvider>())
suiteTestClassName = "ExternalTestGenerated",
annotations = listOf(external(), provider<UseExtTestCaseGroupProvider>())
) {
model("codegen/box", targetBackend = TargetBackend.NATIVE)
model("codegen/boxInline", targetBackend = TargetBackend.NATIVE)
@@ -31,7 +31,7 @@ fun main() {
// Samples (how to utilize the abilities of new test infrastructure).
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "NativeInfraBlackBoxTestGenerated",
suiteTestClassName = "InfrastructureTestGenerated",
annotations = listOf(infrastructure(), provider<UseStandardTestCaseGroupProvider>())
) {
model("samples")
@@ -42,5 +42,6 @@ fun main() {
}
private inline fun <reified T : Annotation> provider() = annotation(T::class.java)
private fun daily() = annotation(Tag::class.java, "daily")
private fun external() = annotation(Tag::class.java, "external")
private fun infrastructure() = annotation(Tag::class.java, "infrastructure")
@@ -18,9 +18,8 @@ import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
import kotlin.coroutines.Continuation
@Suppress("ClassName")
@Tag("infrastructure")
class TestInfra_CompressedNamesTest {
class InfrastructureCompressedNamesTest {
@Test
fun targetNameCompression() {
val knownTargets: Set<KonanTarget> = KonanTarget.predefinedTargets.values.toSet()
@@ -16,14 +16,13 @@ import org.junit.jupiter.api.fail
import java.io.File
import kotlin.io.path.createTempDirectory
@Suppress("ClassName")
@Tag("infrastructure")
class TestInfra_GlobsExpansionTest {
class InfrastructureGlobsExpansionTest {
private lateinit var testDir: File
@BeforeEach
fun setUp() {
testDir = createTempDirectory(TestInfra_GlobsExpansionTest::class.java.sanitizedName).toFile()
testDir = createTempDirectory(InfrastructureGlobsExpansionTest::class.java.sanitizedName).toFile()
}
@Test
@@ -11,9 +11,8 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
@Suppress("ClassName")
@Tag("infrastructure")
class TestInfra_NamedEntitiesTest {
class InfrastructureNamedEntitiesTest {
@Test
fun parsePackageName() {
listOf(
@@ -12,9 +12,8 @@ import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
@Suppress("ClassName")
@Tag("infrastructure")
class TestInfra_OutputFilterTest {
class InfrastructureOutputFilterTest {
@Test
fun noFiltering() {
val randomTestOutput = List(100) { (Char.MIN_VALUE..Char.MAX_VALUE).random() }.joinToString("")
@@ -11,9 +11,8 @@ import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
@Suppress("ClassName")
@Tag("infrastructure")
class TestInfra_TestListingTest {
class InfrastructureTestListingTest {
@Test
fun successfullyParsed() = assertEquals(
listOf(
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.TestFactory
@Tag("daily")
@Tag("external")
@PredefinedTestCases(
TC(
name = "nativeStdlib",
@@ -54,7 +54,7 @@ import org.junit.jupiter.api.TestFactory
sourceLocations = ["libraries/kotlin.test/common/src/test/kotlin/**.kt"]
)
)
class NativeStdlibBlackBoxTest : AbstractNativeBlackBoxTest() {
class StdlibTest : AbstractNativeBlackBoxTest() {
@TestFactory
fun kotlinTest() = dynamicTestCase(TestCaseId.Named("kotlinTest"))