8000 [K2/N] Unlock old testinfra runs with K2 frontend · AndroidKotlinID/kotlin@26b6c0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 26b6c0b

Browse files
vsukharevSpace Team
authored andcommitted
[K2/N] Unlock old testinfra runs with K2 frontend
Merge-request: KT-MR-8552 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
1 parent b01ef84 commit 26b6c0b

File tree

4 files changed

+53
-59
lines changed

4 files changed

+53
-59
lines changed

kotlin-native/backend.native/tests/build.gradle

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,8 @@ standaloneTest("cleaner_in_tls_worker") {
908908
}
909909

910910
standaloneTest("worker_bound_reference0") {
911-
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
911+
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
912+
!isK2(project) // KT-56272
912913
source = "runtime/concurrent/worker_bound_reference0.kt"
913914
flags = ['-tr']
914915

@@ -1444,7 +1445,8 @@ task localClass_localHierarchy(type: KonanLocalTest) {
14441445
}
14451446

14461447
standaloneTest("objectDeclaration_globalConstants") {
1447-
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
1448+
disabled = (cacheTesting != null) || // Cache is not compatible with -opt.
1449+
isK2(project) // KT-56189
14481450
flags = ["-opt", "-opt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
14491451
source = "codegen/objectDeclaration/globalConstants.kt"
14501452
}
@@ -2754,12 +2756,6 @@ standaloneTest("kt-49240-stack-trace-completeness") {
27542756
source = "runtime/exceptions/kt-49240-stack-trace-completeness.kt"
27552757
}
27562758

2757-
standaloneTest("stack_trace_out_of_bounds") {
2758-
disabled = !supportsCoreSymbolication(project) || project.globalTestArgs.contains('-opt') || (project.testTarget == 'ios_arm64')
2759-
flags = ['-g', '-Xg-generate-debug-trampoline=enable', '-Xbinary=stripDebugInfoFromNativeLibs=false']
2760-
source = "runtime/exceptions/stack_trace_out_of_bounds.kt"
2761-
}
8000
2762-
27632759
standaloneTest("kt-37572") {
27642760
disabled = !supportsCoreSymbolication(project) || project.globalTestArgs.contains('-opt')
27652761
flags = ['-g', '-Xbinary=sourceInfoType=coresymbolication']
@@ -2903,6 +2899,7 @@ standaloneTest("runtime_math_exceptions") {
29032899
}
29042900

29052901
standaloneTest("runtime_math") {
2902+
disabled = isK2(project) // KT-56189
29062903
source = "stdlib_external/numbers/MathTest.kt"
29072904
flags = ['-tr']
29082905
}
@@ -3151,6 +3148,7 @@ task concatenation(type: KonanLocalTest) {
31513148
}
31523149

31533150
task const_infinity(type: KonanLocalTest) {
3151+
disabled = isK2(project) // KT-56189
31543152
source = "codegen/basics/const_infinity.kt"
31553153
}
31563154

@@ -3272,6 +3270,7 @@ task initializers3(type: KonanLocalTest) {
32723270
}
32733271

32743272
task initializers4(type: KonanLocalTest) {
3273+
disabled = isK2(project) // KT-56189
32753274
useGoldenData = true
32763275
source = "runtime/basic/initializers4.kt"
32773276
}
@@ -3468,18 +3467,21 @@ standaloneTest("array_out_of_memory") {
34683467
}
34693468

34703469
standaloneTest("mpp1") {
3470+
disabled = isK2(project) // KT-56071
34713471
source = "codegen/mpp/mpp1.kt"
34723472
flags = ['-tr', '-Xmulti-platform']
34733473
}
34743474

34753475
linkTest("mpp2") {
3476+
disabled = isK2(project) // KT-56071
34763477
useGoldenData = true
34773478
source = "codegen/mpp/mpp2.kt"
34783479
lib = "codegen/mpp/libmpp2.kt"
34793480
flags = ['-Xmulti-platform']
34803481
}
34813482

34823483
standaloneTest("mpp_default_args") {
3484+
disabled = isK2(project) // KT-56071
34833485
source = "codegen/mpp/mpp_default_args.kt"
34843486
flags = ['-tr', '-Xmulti-platform']
34853487
}
@@ -3570,7 +3572,8 @@ task vararg_of_literals(type: KonanLocalTest) {
35703572
}
35713573

35723574
standaloneTest('tailrec') {
3573-
disabled = isAggressiveGC // TODO: Investigate why too slow
3575+
disabled = isAggressiveGC || // TODO: Investigate why too slow
3576+
isK2(project) // KT-56269
35743577
useGoldenData = true
35753578
source = "lower/tailrec.kt"
35763579
flags = ['-XXLanguage:-ProhibitTailrecOnVirtualMember', '-e', 'lower.tailrec.main']
@@ -4643,7 +4646,8 @@ interopTest("interop_globals") {
46434646
}
46444647

46454648
interopTest("interop_macros") {
4646-
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
4649+
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
4650+
isK2(project) // KT-56041
46474651
source = "interop/basics/macros.kt"
46484652
interop = 'cmacros'
46494653
}
@@ -4718,7 +4722,8 @@ interopTest("interop_concurrentTerminate") {
47184722
}
47194723

47204724
interopTest("interop_incompleteTypes") {
4721-
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
4725+
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
4726+
isK2(project) // KT-56027
47224727
source = "interop/incomplete_types/main.kt"
47234728
interop = 'incomplete_types'
47244729
}
@@ -4959,7 +4964,7 @@ standaloneTest("interop_opengl_teapot") {
49594964

49604965
if (PlatformInfo.isAppleTarget(project)) {
49614966
interopTest("interop_objc_smoke") {
4962-
enabled = !isNoopGC
4967+
enabled = !isNoopGC && !isK2(project) // KT-56030
49634968
source = "interop/objc/smoke.kt"
49644969
interop = 'objcSmoke'
49654970
doBeforeBuild {
@@ -5010,6 +5015,7 @@ if (PlatformInfo.isAppleTarget(project)) {
50105015
}
50115016

50125017
interopTestMultifile("interop_objc_tests") {
5018+
disabled = isK2(project) // KT-55909
50135019
source = "interop/objc/tests/"
50145020
interop = 'objcTests'
50155021
flags = ['-tr', '-e', 'main']
@@ -5043,7 +5049,7 @@ if (PlatformInfo.isAppleTarget(project)) {
50435049
// KT-49034 tests don't need whole compilation pipeline (only frontend) or platform libraries. Consider simplifying them when porting
50445050
// to the new test infra.
50455051
interopTest("interop_kt49034_struct") {
5046-
disabled = (project.testTarget == 'wasm32')
5052+
disabled = (project.testTarget == 'wasm32') || isK2(project) // KT-56028
50475053
interop = 'kt49034_struct'
50485054
source = 'interop/objc/kt49034/struct/main.kt'
50495055

@@ -5052,7 +5058,7 @@ if (PlatformInfo.isAppleTarget(project)) {
50525058
}
50535059

50545060
interopTest("interop_kt49034_objcclass") {
5055-
disabled = (project.testTarget == 'wasm32')
5061+
disabled = (project.testTarget == 'wasm32') || isK2(project) // KT-56028
50565062
interop = 'kt49034_objcclass'
50575063
source = 'interop/objc/kt49034/objcclass/main.kt'
50585064

@@ -5061,7 +5067,7 @@ if (PlatformInfo.isAppleTarget(project)) {
50615067
}
50625068

50635069
interopTest("interop_kt49034_objcprotocol") {
5064-
disabled = (project.testTarget == 'wasm32')
5070+
disabled = (project.testTarget == 'wasm32') || isK2(project) // KT-56028
50655071
interop = 'kt49034_objcprotocol'
50665072
source = 'interop/objc/kt49034/objcprotocol/main.kt'
50675073

@@ -5105,6 +5111,7 @@ if (PlatformInfo.isAppleTarget(project)) {
51055111
}
51065112

51075113
interopTest("interop_objc_foreignException") {
5114+
disabled = isK2(project) // KT-55909
51085115
source = "interop/objc/foreignException/objc_wrap.kt"
51095116
interop = 'foreignException'
51105117
UtilsKt.dependsOnPlatformLibs(it)
@@ -5293,7 +5300,8 @@ if (PlatformInfo.isAppleTarget(project)) {
52935300

52945301
standaloneTest("interop_kt55653") {
52955302
// Test depends on macOS-specific AppKit
5296-
enabled = (project.testTarget == 'macos_x64' || project.testTarget == 'macos_arm64' || project.testTarget == null)
5303+
enabled = (project.testTarget == 'macos_x64' || project.testTarget == 'macos_arm64' || project.testTarget == null) &&
5304+
!isK2(project) // KT-56030
52975305
source = "interop/objc/kt55653/main.kt"
52985306
useGoldenData = true
52995307
UtilsKt.dependsOnPlatformLibs(it)
@@ -5355,7 +5363,7 @@ standaloneTest("interop_zlib") {
53555363
}
53565364

53575365
standaloneTest("interop_objc_illegal_sharing") {
5358-
disabled = !isAppleTarget(project)
5366+
disabled = !isAppleTarget(project) || isK2(project) // KT-55902
53595367
source = "interop/objc/illegal_sharing.kt"
53605368
UtilsKt.dependsOnPlatformLibs(it)
53615369
if (isExperimentalMM) {
@@ -5415,7 +5423,8 @@ dynamicTest("kt41904") {
54155423
for (i in 0..2) {
54165424
dynamicTest("kt42796_$i") {
54175425
clangTool = "clang++"
5418-
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
5426+
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
5427+
(i==1 && isK2(project)) // KT-56182
54195428
source = "produce_dynamic/kt-42796/main-${i}.kt"
54205429
cSource = "$projectDir/produce_dynamic/kt-42796/main.cpp"
54215430
useGoldenData = true
@@ -5451,7 +5460,8 @@ dynamicTest("interop_concurrentRuntime") {
54515460
}
54525461

54535462
dynamicTest("interop_kt42397") {
5454-
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
5463+
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
5464+
isK2(project) // KT-56182
54555465
source = "interop/kt42397/knlibrary.kt"
54565466
cSource = "$projectDir/interop/kt42397/test.cpp"
54575467
clangTool = "clang++"
@@ -5601,6 +5611,7 @@ linkTest("private_fake_overrides_1") {
56015611
}
56025612

56035613
linkTest("remap_expect_property_refs") {
5614+
disabled = isK2(project) // KT-56071
56045615
source = "codegen/mpp/remap_expect_property_ref_main.kt"
56055616
lib = "codegen/mpp/remap_expect_property_ref_lib.kt"
56065617
flags = ["-Xmulti-platform"]
@@ -5697,6 +5708,7 @@ if (isAppleTarget(project)) {
56975708
}
56985709
}
56995710
framework(frameworkName) {
5711+
enabled = !isK2(project) // KT-56182
57005712
sources = ['objcexport']
57015713
library = libraryName
57025714
opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xexport-kdoc", "-Xbinary=bundleId=foo.bar"]
@@ -5753,6 +5765,7 @@ if (isAppleTarget(project)) {
57535765
}
57545766
}
57555767
framework(frameworkName) {
5768+
enabled = !isK2(project) // KT-56182
57565769
sources = ['objcexport']
57575770
artifact = frameworkArtifactName
57585771
library = libraryName
@@ -5808,6 +5821,7 @@ if (isAppleTarget(project)) {
58085821
}
58095822
}
58105823
framework(frameworkName) {
5824+
enabled = !isK2(project) // KT-56182
58115825
sources = ['objcexport']
58125826
artifact = frameworkArtifactName
58135827
library = libraryName
@@ -5840,6 +5854,7 @@ if (isAppleTarget(project)) {
58405854
}
58415855
}
58425856
framework(frameworkName) {
5857+
enabled = !isK2(project) // KT-56182
58435858
sources = ['objcexport']
58445859
artifact = frameworkArtifactName
58455860
library = libraryName
@@ -5872,6 +5887,7 @@ if (isAppleTarget(project)) {
58725887
}
58735888
}
58745889
framework(frameworkName) {
5890+
enabled = !isK2(project) // KT-56182
58755891
sources = ['objcexport']
58765892
artifact = frameworkArtifactName
58775893
library = libraryName
@@ -5905,6 +5921,7 @@ if (isAppleTarget(project)) {
59055921

59065922
codesign = false
59075923
framework(frameworkName) {
5924+
enabled = !isK2(project) // KT-56182
59085925
sources = ['objcexport']
59095926
bitcode = false
59105927
artifact = frameworkArtifactName
@@ -5921,11 +5938,13 @@ if (isAppleTarget(project)) {
59215938

59225939
frameworkTest('testValuesGenericsFramework') {
59235940
framework('ValuesGenerics') {
5941+
enabled = !isK2(project) // KT-56028
59245942
sources = ['objcexport/values.kt', 'framework/values_generics']
59255943
}
59265944
swiftSources = ['framework/values_generics/']
59275945
}
59285946

5947+
if(!isK2(project)) // KT-56271
59295948
frameworkTest("testStdlibFramework") {
59305949
framework('Stdlib') {
59315950
sources = ['framework/stdlib']
@@ -6251,6 +6270,10 @@ task buildKonanTests { t ->
62516270

62526271
// These tests should not be built into the TestRunner's test executable
62536272
def excludeList = [ "codegen/inline/returnLocalClassFromBlock.kt" ]
6273+
if (isK2(project)) {
6274+
excludeList += "codegen/basics/const_infinity.kt" // KT-56189
6275+
excludeList += "runtime/basic/initializers4.kt" // KT-56189
6276+
}
62546277
project.tasks
62556278
.withType(KonanStandaloneTest.class)
62566279
.each {

kotlin-native/backend.native/tests/objcexport/coroutines.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ fun startCoroutineUninterceptedOrReturn(fn: suspend Any?.() -> Any?, receiver: A
231231
fn.startCoroutineUninterceptedOrReturn(receiver, ResultHolderCompletion(resultHolder))
232232

233233
@Throws(Throwable::class)
234-
@Suppress("INVISIBLE_MEMBER")
234+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
235235
fun startCoroutineUninterceptedOrReturn(fn: suspend Any?.(Any?) -> Any?, receiver: Any?, param: Any?, resultHolder: ResultHolder<Any?>) =
236236
fn.startCoroutineUninterceptedOrReturn(receiver, param, ResultHolderCompletion(resultHolder))
237237

kotlin-native/backend.native/tests/runtime/exceptions/stack_trace_out_of_bounds.kt

Lines changed: 0 additions & 39 deletions
This file was deleted.

kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/PlatformInfo.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ object PlatformInfo {
5151
return getTarget(project).needSmallBinary()
5252
}
5353

54+
@JvmStatic
55+
fun isK2(project: Project): Boolean {
56+
return project.globalTestArgs.contains("-language-version") &&
57+
// Enough future versions are specified until K1 will be stopped to test
58+
(project.globalTestArgs.contains("2.0")
59+
|| project.globalTestArgs.contains("2.1")
60+
|| project.globalTestArgs.contains("2.2")
61+
)
62+
}
63+
5464
@JvmStatic
5565
fun supportsLibBacktrace(project: Project): Boolean {
5666
return getTarget(project).supportsLibBacktrace()

0 commit comments

Comments
 (0)
0