[atomicfu-K/N] Tests for K/N atomicfu-compiler-plugin

* `nativeTest` task now allows to provide compiler plugins that may be enabled during test compilation
* test sets for JVM and K/N backends are equal

KT-60800 describes all the issues with native tests that were solved in this commit.

Co-authored-by: Dmitriy Dolovov <Dmitriy.Dolovov@jetbrains.com>

Merge-request: KT-MR-11401
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
This commit is contained in:
mvicsokolova
2023-08-16 09:41:29 +00:00
committed by Space Team
parent 8f03eb9314
commit 9ff0e0b046
38 changed files with 2644 additions and 33 deletions
@@ -0,0 +1,276 @@
/*
* 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.
*/
package org.jetbrains.kotlin.konan.blackboxtest;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.junit.jupiter.api.Tag;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseStandardTestCaseGroupProvider;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
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("plugins/atomicfu/atomicfu-compiler/testData/nativeBox")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class AtomicfuNativeTestGenerated extends AbstractNativeBlackBoxTest {
@Test
public void testAllFilesPresentInNativeBox() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Atomic_extensions {
@Test
public void testAllFilesPresentInAtomic_extensions() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ArrayInlineExtensionTest.kt")
public void testArrayInlineExtensionTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ArrayInlineExtensionTest.kt");
}
@Test
@TestMetadata("ArrayLoopTest.kt")
public void testArrayLoopTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ArrayLoopTest.kt");
}
@Test
@TestMetadata("ComplexLoopTest.kt")
public void testComplexLoopTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ComplexLoopTest.kt");
}
@Test
@TestMetadata("ExtensionLoopTest.kt")
public void testExtensionLoopTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ExtensionLoopTest.kt");
}
@Test
@TestMetadata("ExtensionsTest.kt")
public void testExtensionsTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ExtensionsTest.kt");
}
@Test
@TestMetadata("InlineExtensionWithTypeParameterTest.kt")
public void testInlineExtensionWithTypeParameterTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/InlineExtensionWithTypeParameterTest.kt");
}
@Test
@TestMetadata("LambdaTest.kt")
public void testLambdaTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/LambdaTest.kt");
}
@Test
@TestMetadata("LockFreeIntBitsTest.kt")
public void testLockFreeIntBitsTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/LockFreeIntBitsTest.kt");
}
@Test
@TestMetadata("LockTest.kt")
public void testLockTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/LockTest.kt");
}
@Test
@TestMetadata("ParameterizedInlineFunExtensionTest.kt")
public void testParameterizedInlineFunExtensionTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomic_extensions/ParameterizedInlineFunExtensionTest.kt");
}
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Atomics_basic {
@Test
public void testAllFilesPresentInAtomics_basic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ArithmeticTest.kt")
public void testArithmeticTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/ArithmeticTest.kt");
}
@Test
@TestMetadata("AtomicArrayTest.kt")
public void testAtomicArrayTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/AtomicArrayTest.kt");
}
@Test
@TestMetadata("IndexArrayElementGetterTest.kt")
public void testIndexArrayElementGetterTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/IndexArrayElementGetterTest.kt");
}
@Test
@TestMetadata("InitializationOrderTest.kt")
public void testInitializationOrderTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/InitializationOrderTest.kt");
}
@Test
@TestMetadata("LateinitPropertiesTest.kt")
public void testLateinitPropertiesTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/LateinitPropertiesTest.kt");
}
@Test
@TestMetadata("LockFreeLongCounterTest.kt")
public void testLockFreeLongCounterTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/LockFreeLongCounterTest.kt");
}
@Test
@TestMetadata("LockFreeQueueTest.kt")
public void testLockFreeQueueTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/LockFreeQueueTest.kt");
}
@Test
@TestMetadata("LockFreeStackTest.kt")
public void testLockFreeStackTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/LockFreeStackTest.kt");
}
@Test
@TestMetadata("LoopTest.kt")
public void testLoopTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/LoopTest.kt");
}
@Test
@TestMetadata("MultiInitTest.kt")
public void testMultiInitTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/MultiInitTest.kt");
}
@Test
@TestMetadata("ScopeTest.kt")
public void testScopeTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/ScopeTest.kt");
}
@Test
@TestMetadata("SimpleLockTest.kt")
public void testSimpleLockTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/SimpleLockTest.kt");
}
@Test
@TestMetadata("UncheckedCastTest.kt")
public void testUncheckedCastTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/atomics_basic/UncheckedCastTest.kt");
}
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/delegated")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Delegated {
@Test
public void testAllFilesPresentInDelegated() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/delegated"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("DelegatedPropertiesTest.kt")
public void testDelegatedPropertiesTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/delegated/DelegatedPropertiesTest.kt");
}
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/locks")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Locks {
@Test
public void testAllFilesPresentInLocks() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/locks"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ReentrantLockTest.kt")
public void testReentrantLockTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/locks/ReentrantLockTest.kt");
}
@Test
@TestMetadata("SynchronizedObjectTest.kt")
public void testSynchronizedObjectTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/locks/SynchronizedObjectTest.kt");
}
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/top-level")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Top_level {
@Test
public void testAllFilesPresentInTop_level() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/top-level"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("FieldInObjectTest.kt")
public void testFieldInObjectTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/top-level/FieldInObjectTest.kt");
}
@Test
@TestMetadata("TopLevelTest.kt")
public void testTopLevelTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/top-level/TopLevelTest.kt");
}
}
@Nested
@TestMetadata("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/trace")
@TestDataPath("$PROJECT_ROOT")
@Tag("atomicfu-native")
@UseStandardTestCaseGroupProvider()
public class Trace {
@Test
public void testAllFilesPresentInTrace() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/trace"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("TraceTest.kt")
public void testTraceTest() throws Exception {
runTest("plugins/atomicfu/atomicfu-compiler/testData/nativeBox/trace/TraceTest.kt");
}
}
}