Minor. Update tests to support them on Android
This commit is contained in:
@@ -71,6 +71,10 @@ android {
|
|||||||
ktest1 {
|
ktest1 {
|
||||||
dimension "box"
|
dimension "box"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ktest2 {
|
||||||
|
dimension "box"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -96,4 +100,5 @@ dependencies {
|
|||||||
|
|
||||||
ktest0Implementation fileTree(dir: 'libs/test', include: ['libtest0.jar'])
|
ktest0Implementation fileTree(dir: 'libs/test', include: ['libtest0.jar'])
|
||||||
ktest1Implementation fileTree(dir: 'libs/test', include: ['libtest1.jar'])
|
ktest1Implementation fileTree(dir: 'libs/test', include: ['libtest1.jar'])
|
||||||
|
ktest2Implementation fileTree(dir: 'libs/test', include: ['libtest2.jar'])
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -138,12 +138,12 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
|
|||||||
private fun writeFiles(filesToCompile: List<KtFile>, environment: KotlinCoreEnvironment) {
|
private fun writeFiles(filesToCompile: List<KtFile>, environment: KotlinCoreEnvironment) {
|
||||||
if (filesToCompile.isEmpty()) return
|
if (filesToCompile.isEmpty()) return
|
||||||
|
|
||||||
//3000 files per folder that would be used by flavor to avoid multidex usage,
|
//2500 files per folder that would be used by flavor to avoid multidex usage,
|
||||||
// each folder would be jared by build.gradle script
|
// each folder would be jared by build.gradle script
|
||||||
writtenFilesCount += filesToCompile.size
|
writtenFilesCount += filesToCompile.size
|
||||||
val index = writtenFilesCount / 3000
|
val index = writtenFilesCount / 2500
|
||||||
val outputDir = File(pathManager.getOutputForCompiledFiles(index))
|
val outputDir = File(pathManager.getOutputForCompiledFiles(index))
|
||||||
assertTrue("Add flavors for ktest$index", index < 2)
|
assertTrue("Add flavors for ktest$index", index < 3)
|
||||||
|
|
||||||
println("Generating ${filesToCompile.size} files into ${outputDir.name}, configuration: '${environment.configuration}'...")
|
println("Generating ${filesToCompile.size} files into ${outputDir.name}, configuration: '${environment.configuration}'...")
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
|
package test
|
||||||
import helpers.*
|
import helpers.*
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
import kotlin.coroutines.intrinsics.*
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|||||||
+1
-1
@@ -3,10 +3,10 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
|
package test
|
||||||
import helpers.*
|
import helpers.*
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
import kotlin.coroutines.intrinsics.*
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
c.startCoroutine(EmptyContinuation)
|
c.startCoroutine(EmptyContinuation)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
|
package test
|
||||||
import helpers.*
|
import helpers.*
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
import kotlin.coroutines.intrinsics.*
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
c.startCoroutine(EmptyContinuation)
|
c.startCoroutine(EmptyContinuation)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// WITH_REFLECT
|
// WITH_REFLECT
|
||||||
|
package test
|
||||||
|
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
@@ -16,7 +17,7 @@ fun f(): @Anno(String::class, CharSequence::class, [Double::class, Long::class,
|
|||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"[@Anno(k1=class java.lang.String, k2=interface java.lang.CharSequence, " +
|
"[@test.Anno(k1=class java.lang.String, k2=interface java.lang.CharSequence, " +
|
||||||
"ka=[class java.lang.Double, class java.lang.Long, class java.lang.Integer])]",
|
"ka=[class java.lang.Double, class java.lang.Long, class java.lang.Integer])]",
|
||||||
::f.returnType.annotations.toString()
|
::f.returnType.annotations.toString()
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,7 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// WITH_REFLECT
|
// WITH_REFLECT
|
||||||
|
package test
|
||||||
|
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
@@ -66,11 +67,11 @@ fun f(): @Anno(
|
|||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"[@Anno(b=1, c=x, d=3.14, f=-2.72, i=42424242, j=239239239239239, s=42, z=true, " +
|
"[@test.Anno(b=1, c=x, d=3.14, f=-2.72, i=42424242, j=239239239239239, s=42, z=true, " +
|
||||||
"ba=[-1], ca=[y], da=[-3.14159], fa=[2.7218], ia=[424242], ja=[239239239239], sa=[-43], za=[false, true], " +
|
"ba=[-1], ca=[y], da=[-3.14159], fa=[2.7218], ia=[424242], ja=[239239239239], sa=[-43], za=[false, true], " +
|
||||||
"str=lol, k=class java.lang.Number, k2=class [I, e=EXPRESSION, a=@Nested(value=1), stra=[lmao], " +
|
"str=lol, k=class java.lang.Number, k2=class [I, e=EXPRESSION, a=@test.Nested(value=1), stra=[lmao], " +
|
||||||
"ka=[class java.lang.Double, class kotlin.Unit, class [J, class [Ljava.lang.String;], " +
|
"ka=[class java.lang.Double, class kotlin.Unit, class [J, class [Ljava.lang.String;], " +
|
||||||
"ea=[TYPEALIAS, FIELD], aa=[@Nested(value=2), @Nested(value=3)])]",
|
"ea=[TYPEALIAS, FIELD], aa=[@test.Nested(value=2), @test.Nested(value=3)])]",
|
||||||
::f.returnType.annotations.toString()
|
::f.returnType.annotations.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -4,7 +4,7 @@
|
|||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS, NATIVE
|
||||||
|
|
||||||
// WITH_REFLECT
|
// WITH_REFLECT
|
||||||
|
package test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertNotEquals
|
import kotlin.test.assertNotEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
@@ -58,10 +58,10 @@ fun box(): String {
|
|||||||
val dpz = D::class.constructors.single().call(+0.0)
|
val dpz = D::class.constructors.single().call(+0.0)
|
||||||
val fmz = F::class.constructors.single().call(-0.0f)
|
val fmz = F::class.constructors.single().call(-0.0f)
|
||||||
val fpz = F::class.constructors.single().call(+0.0f)
|
val fpz = F::class.constructors.single().call(+0.0f)
|
||||||
check(::dMinusZero.annotations.single() as D, dmz, "@D\\(d=-0.0\\)")
|
check(::dMinusZero.annotations.single() as D, dmz, "@test.D\\(d=-0.0\\)")
|
||||||
check(::dPlusZero.annotations.single() as D, dpz, "@D\\(d=0.0\\)")
|
check(::dPlusZero.annotations.single() as D, dpz, "@test.D\\(d=0.0\\)")
|
||||||
check(::fMinusZero.annotations.single() as F, fmz, "@F\\(f=-0.0f?\\)")
|
check(::fMinusZero.annotations.single() as F, fmz, "@test.F\\(f=-0.0f?\\)")
|
||||||
check(::fPlusZero.annotations.single() as F, fpz, "@F\\(f=0.0f?\\)")
|
check(::fPlusZero.annotations.single() as F, fpz, "@test.F\\(f=0.0f?\\)")
|
||||||
|
|
||||||
checkNot(dmz, dpz)
|
checkNot(dmz, dpz)
|
||||||
checkNot(fmz, fpz)
|
checkNot(fmz, fpz)
|
||||||
|
|||||||
Reference in New Issue
Block a user