BC native tests port to Konan's TestRunner
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package runtime.memory.basic0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class A {
|
||||
var field: B? = null
|
||||
}
|
||||
|
||||
class B(var field: Int)
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
@Test fun runTest() {
|
||||
val a = A()
|
||||
a.field = B(2)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package runtime.memory.cycles0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
data class Node(val data: Int, var next: Node?, var prev: Node?, val outer: Node?)
|
||||
|
||||
fun makeCycle(len: Int, outer: Node?): Node {
|
||||
@@ -35,7 +39,7 @@ fun createCycles(junk: Node) {
|
||||
|
||||
}
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
@Test fun runTest() {
|
||||
// Create outer link from cyclic garbage.
|
||||
val outer = Node(42, null, null, null)
|
||||
createCycles(outer)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package runtime.memory.escape0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
//fun foo1(arg: String) : String = foo0(arg)
|
||||
fun foo1(arg: Any) : Any = foo0(arg)
|
||||
|
||||
@@ -46,7 +50,7 @@ fun zoo7(arg1: Any, arg2: Any, selector: Int) : Any {
|
||||
return if (selector < 2) arg1 else arg2;
|
||||
}
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
@Test fun runTest() {
|
||||
//val z = zoo7(Any(), Any(), 1)
|
||||
val x = zoo5(Any())
|
||||
//println(bar(foo1(foo2("")), foo2(foo1(""))))
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package runtime.memory.escape1
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class B(val s: String)
|
||||
|
||||
class A {
|
||||
@@ -9,6 +13,6 @@ fun foo(): B {
|
||||
return a.b
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@Test fun runTest() {
|
||||
println(foo().s)
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
package runtime.memory.escape2
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class A(val s: String)
|
||||
|
||||
class B {
|
||||
@@ -17,7 +21,7 @@ fun bar(b: B) {
|
||||
|
||||
val global = B()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@Test fun runTest() {
|
||||
bar(global)
|
||||
println(global.a!!.s)
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
fun main(args: Array<String>) {
|
||||
package runtime.memory.throw_cleanup
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
foo(false)
|
||||
try {
|
||||
foo(true)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package runtime.memory.var1
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class Integer(val value: Int) {
|
||||
operator fun inc() = Integer(value + 1)
|
||||
}
|
||||
@@ -7,7 +11,7 @@ fun foo(x: Any, y: Any) {
|
||||
y.use()
|
||||
}
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
@Test fun runTest() {
|
||||
var x = Integer(0)
|
||||
|
||||
for (i in 0..1) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
fun main(args : Array<String>) {
|
||||
package runtime.memory.var2
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
var x = Any()
|
||||
|
||||
for (i in 0..1) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
fun main(args : Array<String>) {
|
||||
package runtime.memory.var3
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
foo().use()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
fun main(args : Array<String>) {
|
||||
package runtime.memory.var4
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
var x = Error()
|
||||
|
||||
for (i in 0..1) {
|
||||
|
||||
Reference in New Issue
Block a user