[Native][tests] Move golden data outside of Gradle build file

This commit is contained in:
Dmitriy Dolovov
2021-08-27 22:56:40 +03:00
parent c2e2d3a43e
commit 1a863106e6
488 changed files with 2349 additions and 718 deletions
@@ -0,0 +1,3 @@
AAA
BB
C
@@ -0,0 +1 @@
Hello, world!
@@ -0,0 +1,9 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// TODO: remove kotlin_native.io once overrides are in place.
fun main(args : Array<String>) {
println("Hello, world!")
}
@@ -0,0 +1 @@
Hello, world!
@@ -0,0 +1 @@
Hello.
@@ -0,0 +1 @@
Hello.
@@ -0,0 +1 @@
Hello.
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
fun fail() {
println("Test failed, this is a wrong main() function.")
}
fun foo(args: Array<String>) {
println("Hello.")
}
fun bar() {
println("Hello, without args.")
}
fun main(args: Array<String>) {
fail()
}
@@ -0,0 +1 @@
Hello, without args.
@@ -0,0 +1 @@
This is main without args
@@ -0,0 +1,3 @@
true
false
false
@@ -0,0 +1,3 @@
2
3
4
@@ -0,0 +1,9 @@
239
0
97
1065353216
1072693248
1
0
true
true
@@ -0,0 +1 @@
Hello, world!
@@ -0,0 +1 @@
Hello World
@@ -0,0 +1 @@
you entered 'Hello World'
@@ -0,0 +1,4 @@
239
true
3.14159
A
@@ -0,0 +1,2 @@
Hello
Пока
@@ -0,0 +1,16 @@
Infinity 2147483647 -1
3.4028235E38
NAN2SHORT:: 0
2147483647 -1
FLOAT:: Infinity INT:: 2147483647
FLOAT:: 1.7014117E38 INT:: 2147483647
FLOAT:: 3.4028235E38 INT:: 2147483647
FLOAT:: 3.14 INT:: 3
FLOAT:: NaN INT:: 0
FLOAT:: -33333.125 INT:: -33333
FLOAT:: 1.4E-45 INT:: 0
FLOAT:: -Infinity INT:: -2147483648
FLOAT:: -1.2 INT:: -1
FLOAT:: -12.6 INT:: -12
FLOAT:: 2.3 INT:: 2
OK
@@ -0,0 +1,10 @@
main
B::constructor(1)
A::companion
A::companion::foo
A::companion::foo
B::constructor(0)
B::constructor()
A::Obj
A::AObj::foo
A::AObj::foo
@@ -0,0 +1,2 @@
Init Test
Done
@@ -0,0 +1,5 @@
init globalValue2
init globalValue3
1
globalValue2
globalValue3
@@ -0,0 +1,2 @@
1073741824
true
@@ -0,0 +1 @@
PASSED
@@ -0,0 +1 @@
41
@@ -0,0 +1,4 @@
239
238
30
29
@@ -0,0 +1 @@
Done
@@ -0,0 +1,14 @@
127
-1
239
A
Ё
1122334455
112233445566778899
3.14159265358
1.0E27
1.0E7
1.0E-300
true
false
@@ -0,0 +1 @@
ello
@@ -0,0 +1,2 @@
H e l l o
Hello
@@ -0,0 +1,18 @@
-128
127
-32768
32767
-2147483648
2147483647
-9223372036854775808
9223372036854775807
1.4E-45
3.4028235E38
-Infinity
Infinity
NaN
4.9E-324
1.7976931348623157E308
-Infinity
Infinity
NaN
@@ -0,0 +1,9 @@
5
6
7
8
9
10
11
12
13
@@ -0,0 +1,4 @@
4 2
1-1
69
38
@@ -0,0 +1,6 @@
0
2
4
6
8
40
@@ -0,0 +1,2 @@
1 2 3 7 8 9 -128 -1
1 2 3 7 8 9 -128 -1
@@ -0,0 +1 @@
OK
@@ -0,0 +1,3 @@
abc
[a, b, c, d]
[n, s, a]
@@ -0,0 +1,2 @@
123
abcd
@@ -0,0 +1,2 @@
[a, b, x]
[-1, 0, 42, 239, 100500]
@@ -0,0 +1,2 @@
[a, b, x]
[-1, 0, 42, 239, 100500]
@@ -0,0 +1,2 @@
true
3
@@ -0,0 +1,3 @@
Before
Caught Throwable
Done
@@ -0,0 +1,3 @@
Before
Caught Error
Done
@@ -0,0 +1 @@
Error happens
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
42
@@ -0,0 +1 @@
zzz
@@ -0,0 +1 @@
zzz
@@ -0,0 +1,3 @@
Data(s=Hello)
null
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,6 @@
true
true
ПРИВЕТ
привет
Пока
true
@@ -0,0 +1,5 @@
HelloKotlin
42
0.1
true
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,10 @@
Hello
Привет
𐀀
12
12
12
😥
😥
@@ -0,0 +1,3 @@
35
20
OK
@@ -0,0 +1 @@
true
@@ -0,0 +1,4 @@
frozen bit is true
Worker: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))
Main: SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))
OK
@@ -0,0 +1 @@
OK, cannot mutate frozen
@@ -0,0 +1,5 @@
Worker 1: Hello world
Worker2: 42
Worker3: 239.0
Worker4: a
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,2 @@
OK
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,2 @@
123
OK
@@ -0,0 +1,2 @@
Got Input processed
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,3 @@
OK
true
true
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1 @@
OK
@@ -0,0 +1,2 @@
Got 42
OK
@@ -0,0 +1,2 @@
Got 3
OK
@@ -0,0 +1,2 @@
Got 42
OK
@@ -0,0 +1,3 @@
Input
Got kotlin.Unit
OK
@@ -0,0 +1,3 @@
SharedData(string=Hello, int=10, member=SharedDataMember(double=0.1))
Got kotlin.Unit
OK
@@ -0,0 +1,6 @@
zzz
42
OK
first 2
second 3
frozen OK
@@ -0,0 +1,90 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
package runtime.workers.worker9_experimentalMM
import kotlin.test.*
import kotlin.native.concurrent.*
@Test fun runTest1() {
withLock { println("zzz") }
val worker = Worker.start()
val future = worker.execute(TransferMode.SAFE, {}) {
withLock {
println("42")
}
}
future.result
worker.requestTermination().result
println("OK")
}
fun withLock(op: () -> Unit) {
op()
}
@Test fun runTest2() {
val worker = Worker.start()
val future = worker.execute(TransferMode.SAFE, {}) {
val me = Worker.current
var x = 1
me.executeAfter (20000) {
println("second ${++x}")
}
me.executeAfter(10000) {
println("first ${++x}")
}
}
worker.requestTermination().result
}
@Test fun runTest3() {
val worker = Worker.start()
if (Platform.memoryModel == MemoryModel.EXPERIMENTAL) {
worker.executeAfter {
println("unfrozen OK")
}
} else {
assertFailsWith<IllegalStateException> {
worker.executeAfter {
println("shall not happen")
}
}
}
assertFailsWith<IllegalArgumentException> {
worker.executeAfter(-1, {
println("shall not happen")
}.freeze())
}
worker.executeAfter(0, {
println("frozen OK")
}.freeze())
worker.requestTermination().result
}
class Node(var node: Node?, var outher: Node?)
fun makeCyclic(): Node {
val inner = Node(null, null)
inner.node = inner
val outer = Node(null, null)
inner.outher = outer
return outer
}
@Test fun runTest4() {
val worker = Worker.start()
val future = worker.execute(TransferMode.SAFE, { }) {
makeCyclic().also {
kotlin.native.internal.GC.collect()
}
}
assert(future.result != null)
worker.requestTermination().result
}

Some files were not shown because too many files have changed in this diff Show More