[K/N][tests] Migrate entry point runtime tests to new testing infra ^KT-61259
This commit is contained in:
committed by
Space Team
parent
0ab0607bbf
commit
340103098f
@@ -0,0 +1,7 @@
|
||||
// PROGRAM_ARGS: AAA BB C
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
assertContentEquals(arrayOf("AAA", "BB", "C"), args)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// OUTPUT_DATA_FILE: differentEntry.out
|
||||
// ENTRY_POINT: foo
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun foo() {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun foo(args: Array<String>) {
|
||||
println("OK")
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// OUTPUT_DATA_FILE: differentEntryMultiModule.out
|
||||
// ENTRY_POINT: foo
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
fun foo(args: Array<String>) {
|
||||
println("OK")
|
||||
}
|
||||
|
||||
// MODULE: program(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,20 @@
|
||||
// OUTPUT_DATA_FILE: differentEntry.out
|
||||
// ENTRY_POINT: foo
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun foo() {
|
||||
println("OK")
|
||||
}
|
||||
|
||||
fun foo(args: Array<Int>) {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,29 @@
|
||||
// OUTPUT_DATA_FILE: mainOverloading.out
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun main() {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun <T> main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<Int>) {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>, second_arg: Int) {
|
||||
fail()
|
||||
}
|
||||
|
||||
class Foo {
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("OK")
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,25 @@
|
||||
// OUTPUT_DATA_FILE: mainOverloading.out
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun main() {
|
||||
println("OK")
|
||||
}
|
||||
|
||||
fun <T> main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<Int>) {
|
||||
fail()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>, second_arg: Int) {
|
||||
fail()
|
||||
}
|
||||
|
||||
class Foo {
|
||||
fun main(args: Array<String>) {
|
||||
fail()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
+51
@@ -90,4 +90,55 @@ public class FirNativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest
|
||||
runTest("native/native.tests/testData/standalone/console/readlnOrNullEmpty.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("native/native.tests/testData/standalone/entryPoint")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@Tag("standalone")
|
||||
@EnforcedProperty(property = ClassLevelProperty.TEST_KIND, propertyValue = "STANDALONE_NO_TR")
|
||||
@UseStandardTestCaseGroupProvider()
|
||||
@Tag("frontend-fir")
|
||||
@FirPipeline()
|
||||
public class EntryPoint {
|
||||
@Test
|
||||
public void testAllFilesPresentInEntryPoint() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone/entryPoint"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("args.kt")
|
||||
public void testArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/args.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntry.kt")
|
||||
public void testDifferentEntry() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntry.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntryMultiModule.kt")
|
||||
public void testDifferentEntryMultiModule() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntryMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntryNoArgs.kt")
|
||||
public void testDifferentEntryNoArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntryNoArgs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainOverloading.kt")
|
||||
public void testMainOverloading() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/mainOverloading.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainOverloadingNoArgs.kt")
|
||||
public void testMainOverloadingNoArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/mainOverloadingNoArgs.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+49
@@ -85,4 +85,53 @@ public class NativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest {
|
||||
runTest("native/native.tests/testData/standalone/console/readlnOrNullEmpty.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("native/native.tests/testData/standalone/entryPoint")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@Tag("standalone")
|
||||
@EnforcedProperty(property = ClassLevelProperty.TEST_KIND, propertyValue = "STANDALONE_NO_TR")
|
||||
@UseStandardTestCaseGroupProvider()
|
||||
public class EntryPoint {
|
||||
@Test
|
||||
public void testAllFilesPresentInEntryPoint() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone/entryPoint"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("args.kt")
|
||||
public void testArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/args.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntry.kt")
|
||||
public void testDifferentEntry() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntry.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntryMultiModule.kt")
|
||||
public void testDifferentEntryMultiModule() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntryMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("differentEntryNoArgs.kt")
|
||||
public void testDifferentEntryNoArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/differentEntryNoArgs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainOverloading.kt")
|
||||
public void testMainOverloading() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/mainOverloading.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainOverloadingNoArgs.kt")
|
||||
public void testMainOverloadingNoArgs() throws Exception {
|
||||
runTest("native/native.tests/testData/standalone/entryPoint/mainOverloadingNoArgs.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user