[K/N][tests] Move stress tests into a separate project
This commit is contained in:
committed by
Space Team
parent
60d425e2c7
commit
aee87468a6
@@ -4,20 +4,22 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(kotlinStdlib())
|
||||
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
testImplementation(intellijCore())
|
||||
testImplementation(commonDependency("commons-lang:commons-lang"))
|
||||
testImplementation(commonDependency("org.jetbrains.teamcity:serviceMessages"))
|
||||
testImplementation(project(":kotlin-compiler-runner-unshaded"))
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(projectTests(":compiler:tests-common-new"))
|
||||
testImplementation(projectTests(":compiler:test-infrastructure"))
|
||||
// Reexport these dependencies to every user of nativeTest()
|
||||
testApi(kotlinStdlib())
|
||||
testApi(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
testApi(intellijCore())
|
||||
testApi(commonDependency("commons-lang:commons-lang"))
|
||||
testApi(commonDependency("org.jetbrains.teamcity:serviceMessages"))
|
||||
testApi(project(":kotlin-compiler-runner-unshaded"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(projectTests(":compiler:tests-common-new"))
|
||||
testApi(projectTests(":compiler:test-infrastructure"))
|
||||
testApi(project(":native:kotlin-native-utils"))
|
||||
testApi(project(":native:executors"))
|
||||
|
||||
testImplementation(projectTests(":generators:test-generator"))
|
||||
testImplementation(project(":compiler:ir.serialization.native"))
|
||||
testImplementation(project(":compiler:fir:native"))
|
||||
testImplementation(project(":native:kotlin-native-utils"))
|
||||
testApi(project(":native:executors")) // Reexport this dependency to every user of nativeTest()
|
||||
testImplementation(project(":kotlin-util-klib-abi"))
|
||||
testImplementation(project(":native:swift:swift-export-standalone"))
|
||||
testImplementation(projectTests(":kotlin-util-klib-abi"))
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(platform(libs.junit.bom))
|
||||
testImplementation(libs.junit.jupiter.api)
|
||||
testRuntimeOnly(libs.junit.jupiter.engine)
|
||||
|
||||
testImplementation(projectTests(":native:native.tests"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { none() }
|
||||
"test" {
|
||||
projectDefault()
|
||||
generatedTestDir()
|
||||
}
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
|
||||
nativeTest(
|
||||
"test",
|
||||
null,
|
||||
requirePlatformLibs = true,
|
||||
allowParallelExecution = false, // Stress tests are resource-intensive tests and they must be run in isolation.
|
||||
)
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
// KIND: STANDALONE_NO_TR
|
||||
// Test depends on macOS-specific AppKit
|
||||
// DISABLE_NATIVE: isAppleTarget=false
|
||||
// DISABLE_NATIVE: targetFamily=IOS
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan.test.blackbox;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.group.UseStandardTestCaseGroupProvider;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.group.FirPipeline;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("native/native.tests/stress/testData")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@UseStandardTestCaseGroupProvider()
|
||||
@Tag("frontend-fir")
|
||||
@FirPipeline()
|
||||
public class FirNativeStressTestGenerated extends AbstractNativeBlackBoxTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInTestData() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/stress/testData"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63423_dispose_on_main_stress.kt")
|
||||
public void testKt63423_dispose_on_main_stress() {
|
||||
runTest("native/native.tests/stress/testData/kt63423_dispose_on_main_stress.kt");
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan.test.blackbox;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.group.UseStandardTestCaseGroupProvider;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("native/native.tests/stress/testData")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@UseStandardTestCaseGroupProvider()
|
||||
public class NativeStressTestGenerated extends AbstractNativeBlackBoxTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInTestData() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/stress/testData"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63423_dispose_on_main_stress.kt")
|
||||
public void testKt63423_dispose_on_main_stress() {
|
||||
runTest("native/native.tests/stress/testData/kt63423_dispose_on_main_stress.kt");
|
||||
}
|
||||
}
|
||||
-6
@@ -46,12 +46,6 @@ public class FirNativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest
|
||||
runTest("native/native.tests/testData/standalone/kt56048.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63423_dispose_on_main_stress.kt")
|
||||
public void testKt63423_dispose_on_main_stress() {
|
||||
runTest("native/native.tests/testData/standalone/kt63423_dispose_on_main_stress.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("native/native.tests/testData/standalone/console")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
-6
@@ -43,12 +43,6 @@ public class NativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest {
|
||||
runTest("native/native.tests/testData/standalone/kt56048.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63423_dispose_on_main_stress.kt")
|
||||
public void testKt63423_dispose_on_main_stress() {
|
||||
runTest("native/native.tests/testData/standalone/kt63423_dispose_on_main_stress.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("native/native.tests/testData/standalone/console")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+20
@@ -526,6 +526,26 @@ fun main() {
|
||||
model("SwiftExport", pattern = "^([^_](.+))$", recursive = false)
|
||||
}
|
||||
}
|
||||
// Stress tests
|
||||
testGroup("native/native.tests/stress/tests-gen", "native/native.tests/stress/testData") {
|
||||
testClass<AbstractNativeBlackBoxTest>(
|
||||
suiteTestClassName = "NativeStressTestGenerated",
|
||||
annotations = listOf(
|
||||
provider<UseStandardTestCaseGroupProvider>(),
|
||||
)
|
||||
) {
|
||||
model("")
|
||||
}
|
||||
testClass<AbstractNativeBlackBoxTest>(
|
||||
suiteTestClassName = "FirNativeStressTestGenerated",
|
||||
annotations = listOf(
|
||||
provider<UseStandardTestCaseGroupProvider>(),
|
||||
*frontendFir(),
|
||||
)
|
||||
) {
|
||||
model("")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user