diff --git a/compiler/testData/codegen/box/cinterop/funptr.kt b/native/native.tests/testData/standalone/funptr.kt similarity index 99% rename from compiler/testData/codegen/box/cinterop/funptr.kt rename to native/native.tests/testData/standalone/funptr.kt index f560abf614d..36ce2a9474d 100644 --- a/compiler/testData/codegen/box/cinterop/funptr.kt +++ b/native/native.tests/testData/standalone/funptr.kt @@ -116,7 +116,7 @@ typealias NotSoLongSignatureFunction = ( Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int ) -> Int -fun box(): String { +fun main() { val atoiPtr = getAtoiPtr()!! val getPrintIntPtrPtr = getGetPrintIntPtrPtr()!! @@ -145,8 +145,6 @@ fun box(): String { val notSoLongSignaturePtr: CPointer>? = getNotSoLongSignatureFunctionPtr() printIntPtr(notSoLongSignaturePtr!!.invoke(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) printIntPtr(notSoLongSignatureFunction(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) - - return "OK" } fun Boolean.ifThenOneElseZero() = if (this) 1 else 0 diff --git a/compiler/testData/codegen/box/cinterop/funptr.out b/native/native.tests/testData/standalone/funptr.out similarity index 100% rename from compiler/testData/codegen/box/cinterop/funptr.out rename to native/native.tests/testData/standalone/funptr.out diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index 54ac5505320..15c0ac48a56 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -4808,12 +4808,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); } - @Test - @TestMetadata("funptr.kt") - public void testFunptr() throws Exception { - runTest("compiler/testData/codegen/box/cinterop/funptr.kt"); - } - @Test @TestMetadata("globals.kt") public void testGlobals() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index 6aab98ef5e2..72f6482c8f7 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -4918,12 +4918,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); } - @Test - @TestMetadata("funptr.kt") - public void testFunptr() throws Exception { - runTest("compiler/testData/codegen/box/cinterop/funptr.kt"); - } - @Test @TestMetadata("globals.kt") public void testGlobals() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeStandaloneTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeStandaloneTestGenerated.java index 7f1884f56e1..8b03f40803f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeStandaloneTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeStandaloneTestGenerated.java @@ -34,6 +34,12 @@ public class FirNativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("funptr.kt") + public void testFunptr() throws Exception { + runTest("native/native.tests/testData/standalone/funptr.kt"); + } + @Test @TestMetadata("kt56048.kt") public void testKt56048() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index 6c5ac5a42eb..8f4397386f7 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -4698,12 +4698,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); } - @Test - @TestMetadata("funptr.kt") - public void testFunptr() throws Exception { - runTest("compiler/testData/codegen/box/cinterop/funptr.kt"); - } - @Test @TestMetadata("globals.kt") public void testGlobals() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index 82b5e42136d..0623d959e70 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -4809,12 +4809,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); } - @Test - @TestMetadata("funptr.kt") - public void testFunptr() throws Exception { - runTest("compiler/testData/codegen/box/cinterop/funptr.kt"); - } - @Test @TestMetadata("globals.kt") public void testGlobals() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeStandaloneTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeStandaloneTestGenerated.java index 1711d20fb5f..30965051645 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeStandaloneTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeStandaloneTestGenerated.java @@ -31,6 +31,12 @@ public class NativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("funptr.kt") + public void testFunptr() throws Exception { + runTest("native/native.tests/testData/standalone/funptr.kt"); + } + @Test @TestMetadata("kt56048.kt") public void testKt56048() throws Exception { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt index 689234d2c77..f313ffbe29d 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt @@ -34,6 +34,7 @@ import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.FREE_COMP import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.IGNORE_NATIVE import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.IGNORE_NATIVE_K1 import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.IGNORE_NATIVE_K2 +import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.OUTPUT_DATA_FILE import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunCheck import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks import org.jetbrains.kotlin.konan.test.blackbox.support.settings.* @@ -52,6 +53,7 @@ import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_BACKEND import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_BACKEND_K2 import org.jetbrains.kotlin.test.directives.model.StringDirective import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue +import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertFalse import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail import org.jetbrains.kotlin.utils.addIfNotNull import java.io.File @@ -126,7 +128,11 @@ private class ExtTestDataFile( else MANDATORY_SOURCE_TRANSFORMERS + customSourceTransformers - structureFactory.ExtTestDataFileStructure(testDataFile, allSourceTransformers) + structureFactory.ExtTestDataFileStructure(testDataFile, allSourceTransformers).also { + assertFalse(it.directives.contains(OUTPUT_DATA_FILE.name)) { + "${testDataFile.absolutePath}: directive ${OUTPUT_DATA_FILE.name} is not supported by ExtTestDataFile" + } + } } private val isExpectedFailure: Boolean = settings.isIgnoredTarget(structure.directives)