[K/N][Tests] Move funptr.kt to standalone tests due to OUTPUT_DATA_FILE directive

^KT-61259
This commit is contained in:
Vladimir Sukharev
2024-01-19 20:59:40 +01:00
committed by Space Team
parent c286b0efd7
commit 2f3705f0eb
9 changed files with 20 additions and 28 deletions
@@ -116,7 +116,7 @@ typealias NotSoLongSignatureFunction = (
Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int
) -> Int ) -> Int
fun box(): String { fun main() {
val atoiPtr = getAtoiPtr()!! val atoiPtr = getAtoiPtr()!!
val getPrintIntPtrPtr = getGetPrintIntPtrPtr()!! val getPrintIntPtrPtr = getGetPrintIntPtrPtr()!!
@@ -145,8 +145,6 @@ fun box(): String {
val notSoLongSignaturePtr: CPointer<CFunction<NotSoLongSignatureFunction>>? = getNotSoLongSignatureFunctionPtr() val notSoLongSignaturePtr: CPointer<CFunction<NotSoLongSignatureFunction>>? = 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(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)) 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 fun Boolean.ifThenOneElseZero() = if (this) 1 else 0
@@ -4808,12 +4808,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); 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 @Test
@TestMetadata("globals.kt") @TestMetadata("globals.kt")
public void testGlobals() throws Exception { public void testGlobals() throws Exception {
@@ -4918,12 +4918,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); 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 @Test
@TestMetadata("globals.kt") @TestMetadata("globals.kt")
public void testGlobals() throws Exception { public void testGlobals() throws Exception {
@@ -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); 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 @Test
@TestMetadata("kt56048.kt") @TestMetadata("kt56048.kt")
public void testKt56048() throws Exception { public void testKt56048() throws Exception {
@@ -4698,12 +4698,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); 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 @Test
@TestMetadata("globals.kt") @TestMetadata("globals.kt")
public void testGlobals() throws Exception { public void testGlobals() throws Exception {
@@ -4809,12 +4809,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/cinterop/forwardDeclarationsTwoLibs.kt"); 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 @Test
@TestMetadata("globals.kt") @TestMetadata("globals.kt")
public void testGlobals() throws Exception { public void testGlobals() throws Exception {
@@ -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); 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 @Test
@TestMetadata("kt56048.kt") @TestMetadata("kt56048.kt")
public void testKt56048() throws Exception { public void testKt56048() throws Exception {
@@ -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
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.IGNORE_NATIVE_K1 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.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.TestRunCheck
import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks
import org.jetbrains.kotlin.konan.test.blackbox.support.settings.* 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.CodegenTestDirectives.IGNORE_BACKEND_K2
import org.jetbrains.kotlin.test.directives.model.StringDirective import org.jetbrains.kotlin.test.directives.model.StringDirective
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue 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.test.services.JUnit5Assertions.fail
import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addIfNotNull
import java.io.File import java.io.File
@@ -126,7 +128,11 @@ private class ExtTestDataFile(
else else
MANDATORY_SOURCE_TRANSFORMERS + customSourceTransformers 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) private val isExpectedFailure: Boolean = settings.isIgnoredTarget(structure.directives)