Files
kotlin-fork/kotlin-native/backend.native/tests/testing/library_user.kt
T
Stanislav Erokhin f624800b84 Move everything under kotlin-native folder
I was forced to manually do update the following files, because otherwise
they would be ignored according .gitignore settings. Probably they
should be deleted from repo.

Interop/.idea/compiler.xml
Interop/.idea/gradle.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_3.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_3.xml
Interop/.idea/modules.xml
Interop/.idea/modules/Indexer/Indexer.iml
Interop/.idea/modules/Runtime/Runtime.iml
Interop/.idea/modules/StubGenerator/StubGenerator.iml
backend.native/backend.native.iml
backend.native/bc.frontend/bc.frontend.iml
backend.native/cli.bc/cli.bc.iml
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt
backend.native/tests/link/lib/foo.kt
backend.native/tests/link/lib/foo2.kt
backend.native/tests/teamcity-test.property
2020-10-27 21:00:28 +03:00

74 lines
1.7 KiB
Kotlin

import kotlin.native.internal.test.*
import kotlin.test.*
import library.*
open class B : A() {
// Override test methods without a test annotation.
// We should run these methods anyway.
override fun before() {
output.add("B.before")
}
// test0 should be executed.
// Should be executed.
override fun test1() {
output.add("B.test1")
}
// Should be executed
@Ignore
override fun test2() {
output.add("B.test2")
}
// Should be ignored.
@Ignore
@Test
override fun test3() {
output.add("B.test3")
}
// ignored0 should be ignored.
// Should be ignored.
override fun ignored1() {
output.add("B.ignored1")
}
// Should be executed.
@Test
override fun ignored2() {
output.add("B.ignored2")
}
}
// All test methods from B should be executed for C.
class C: B() {}
class D: I1, I2 {
// This method shouldn't be executed because its parent methods annotated
// with @Test belong to an interface instead of an abstract class.
override fun foo(){
output.add("D.foo")
}
}
fun main(args: Array<String>) {
testLauncherEntryPoint(args)
output.forEach(::println)
assertEquals(8, output.count { it == "A.after" })
assertEquals(8, output.count { it == "B.before" })
assertEquals(2, output.count { it == "A.test0" })
assertEquals(2, output.count { it == "B.test1" })
assertEquals(2, output.count { it == "B.test2" })
assertEquals(2, output.count { it == "B.ignored2" })
assertTrue(output.none { it == "B.test3" })
assertTrue(output.none { it == "A.ignored0" })
assertTrue(output.none { it == "B.ignored1" })
assertTrue(output.none { it == "D.foo" })
}