[K/N] Disable some tests for noop GC
This commit is contained in:
@@ -108,6 +108,7 @@ tasks.withType(RunExternalTestGroup.class).configureEach {
|
||||
}
|
||||
|
||||
ext.isExperimentalMM = project.globalTestArgs.contains("-memory-model") && project.globalTestArgs.contains("experimental")
|
||||
ext.isNoopGC = project.globalTestArgs.contains("-Xgc=noop")
|
||||
|
||||
if (ext.isExperimentalMM) {
|
||||
// TODO: Make it more aggressive and only turn it on for a subset of tests.
|
||||
@@ -209,7 +210,7 @@ task resultsTask() {
|
||||
reports += new KonanTestGroupReport(it.name, it.testGroupReporter.suiteReports)
|
||||
statistics.add(it.testGroupReporter.statistics)
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(KonanGTest).matching { it.state.executed }.each {
|
||||
statistics.add(it.statistics)
|
||||
}
|
||||
@@ -832,19 +833,22 @@ task empty_substring(type: KonanLocalTest) {
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_basic") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_basic.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_workers") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_workers.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_in_main_with_checker") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_in_main_with_checker.kt"
|
||||
goldValue = "42\n"
|
||||
}
|
||||
@@ -862,7 +866,8 @@ standaloneTest("cleaner_leak_without_checker") {
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_leak_with_checker") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_leak_with_checker.kt"
|
||||
expectedExitStatusChecker = { it != 0 }
|
||||
outputChecker = { s -> (s =~ /Cleaner (0x)?[0-9a-fA-F]+ was disposed during program exit/).find() }
|
||||
@@ -874,14 +879,16 @@ standaloneTest("cleaner_in_tls_main_without_checker") {
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_in_tls_main_with_checker") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_in_tls_main_with_checker.kt"
|
||||
expectedExitStatusChecker = { it != 0 }
|
||||
outputChecker = { s -> (s =~ /Cleaner (0x)?[0-9a-fA-F]+ was disposed during program exit/).find() }
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_in_tls_worker") {
|
||||
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_in_tls_worker.kt"
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
@@ -890,6 +897,18 @@ standaloneTest("worker_bound_reference0") {
|
||||
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
||||
source = "runtime/concurrent/worker_bound_reference0.kt"
|
||||
flags = ['-tr']
|
||||
|
||||
if (isNoopGC) {
|
||||
def exclude = [
|
||||
"*.testCollect",
|
||||
"*.testCollectFrozen",
|
||||
"*.testCollectInWorkerFrozen",
|
||||
"*.collectCyclicGarbage",
|
||||
"*.collectCyclicGarbageWithAtomicsFrozen",
|
||||
"*.collectCrossThreadCyclicGarbageWithAtomicsFrozen"
|
||||
]
|
||||
arguments += ["--ktest_filter=*-${exclude.join(":")}"]
|
||||
}
|
||||
}
|
||||
|
||||
task worker0(type: KonanLocalTest) {
|
||||
@@ -958,7 +977,8 @@ task worker9(type: KonanLocalTest) {
|
||||
}
|
||||
|
||||
task worker10(type: KonanLocalTest) {
|
||||
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
||||
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
|
||||
!isNoopGC
|
||||
goldValue = "OK\ntrue\ntrue\n"
|
||||
source = "runtime/workers/worker10.kt"
|
||||
}
|
||||
@@ -1026,7 +1046,8 @@ task freeze5(type: KonanLocalTest) {
|
||||
}
|
||||
|
||||
task freeze6(type: KonanLocalTest) {
|
||||
enabled = (project.testTarget != 'wasm32') // No exceptions on WASM.
|
||||
enabled = (project.testTarget != 'wasm32') && // No exceptions on WASM.
|
||||
!isNoopGC
|
||||
goldValue = "OK\nOK\n"
|
||||
source = "runtime/workers/freeze6.kt"
|
||||
}
|
||||
@@ -1061,6 +1082,7 @@ standaloneTest("lazy2") {
|
||||
}
|
||||
|
||||
standaloneTest("lazy3") {
|
||||
enabled = !isNoopGC
|
||||
source = "runtime/workers/lazy3.kt"
|
||||
}
|
||||
|
||||
@@ -2905,6 +2927,7 @@ task memory_cycles0(type: KonanLocalTest) {
|
||||
}
|
||||
|
||||
task memory_cycles1(type: KonanLocalTest) {
|
||||
enabled = !isNoopGC
|
||||
source = "runtime/memory/cycles1.kt"
|
||||
}
|
||||
|
||||
@@ -2918,6 +2941,7 @@ task memory_escape2(type: KonanLocalTest) {
|
||||
}
|
||||
|
||||
task memory_weak0(type: KonanLocalTest) {
|
||||
enabled = !isNoopGC
|
||||
goldValue = "Data(s=Hello)\nnull\nOK\n"
|
||||
source = "runtime/memory/weak0.kt"
|
||||
}
|
||||
@@ -2977,7 +3001,8 @@ standaloneTest("stress_gc_allocations") {
|
||||
(project.testTarget != "watchos_arm32") &&
|
||||
(project.testTarget != "watchos_arm64") &&
|
||||
(project.testTarget != "watchos_x86") &&
|
||||
(project.testTarget != "watchos_x64")
|
||||
(project.testTarget != "watchos_x64") &&
|
||||
!isNoopGC
|
||||
source = "runtime/memory/stress_gc_allocations.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
@@ -4318,6 +4343,11 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
"Deallocated\nDeallocated\n" +
|
||||
"Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined.\n"
|
||||
|
||||
if (isNoopGC) {
|
||||
// No deallocations for the no-op GC.
|
||||
goldValue = goldValue.replace("Deallocated\n", "")
|
||||
}
|
||||
|
||||
source = "interop/objc/smoke.kt"
|
||||
interop = 'objcSmoke'
|
||||
|
||||
@@ -4346,6 +4376,17 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
interop = 'objcTests'
|
||||
flags = ['-tr', '-e', 'main']
|
||||
|
||||
if (isNoopGC) {
|
||||
def exclude = [
|
||||
"Kt41811Kt.*",
|
||||
"CustomStringKt.testCustomString",
|
||||
"Kt42482Kt.testKT42482",
|
||||
"ObjcWeakRefsKt.testObjCWeakRef",
|
||||
"WeakRefsKt.testWeakRefs"
|
||||
]
|
||||
arguments += ["--ktest_filter=*-${exclude.join(":")}"]
|
||||
}
|
||||
|
||||
doBeforeBuild {
|
||||
mkdir(buildDir)
|
||||
execClangForCompilerTests(project.target) {
|
||||
@@ -4477,6 +4518,7 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
}
|
||||
|
||||
interopTest("interop_objc_kt42172") {
|
||||
enabled = !isNoopGC
|
||||
source = "interop/objc/kt42172/main.kt"
|
||||
interop = "objc_kt42172"
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
@@ -4611,7 +4653,7 @@ dynamicTest("interop_kt42397") {
|
||||
}
|
||||
|
||||
dynamicTest("interop_cleaners_main_thread") {
|
||||
disabled = (project.target.name != project.hostName)
|
||||
disabled = (project.target.name != project.hostName) || isNoopGC
|
||||
source = "interop/cleaners/cleaners.kt"
|
||||
cSource = "$projectDir/interop/cleaners/main_thread.cpp"
|
||||
clangTool = "clang++"
|
||||
@@ -4620,7 +4662,7 @@ dynamicTest("interop_cleaners_main_thread") {
|
||||
}
|
||||
|
||||
dynamicTest("interop_cleaners_second_thread") {
|
||||
disabled = (project.target.name != project.hostName)
|
||||
disabled = (project.target.name != project.hostName) || isNoopGC
|
||||
source = "interop/cleaners/cleaners.kt"
|
||||
cSource = "$projectDir/interop/cleaners/second_thread.cpp"
|
||||
clangTool = "clang++"
|
||||
@@ -4851,6 +4893,9 @@ if (isAppleTarget(project)) {
|
||||
opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xexport-kdoc"]
|
||||
}
|
||||
swiftSources = ['objcexport']
|
||||
if (isNoopGC) {
|
||||
swiftExtraOpts += ["-D", "NOOP_GC"]
|
||||
}
|
||||
}
|
||||
|
||||
frameworkTest('testObjCExportNoGenerics') {
|
||||
@@ -4903,6 +4948,9 @@ if (isAppleTarget(project)) {
|
||||
}
|
||||
swiftSources = ['objcexport']
|
||||
swiftExtraOpts = [ '-D', 'NO_GENERICS' ]
|
||||
if (isNoopGC) {
|
||||
swiftExtraOpts += ["-D", "NOOP_GC"]
|
||||
}
|
||||
}
|
||||
|
||||
frameworkTest('testObjCExportStatic') {
|
||||
@@ -4933,6 +4981,9 @@ if (isAppleTarget(project)) {
|
||||
isStatic = true
|
||||
}
|
||||
swiftSources = ['objcexport']
|
||||
if (isNoopGC) {
|
||||
swiftExtraOpts += ["-D", "NOOP_GC"]
|
||||
}
|
||||
}
|
||||
|
||||
frameworkTest('testValuesGenericsFramework') {
|
||||
|
||||
@@ -66,6 +66,8 @@ class DeallocRetainTests : SimpleTestProvider {
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
#if !NOOP_GC
|
||||
test("Test1", test1)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,10 +317,12 @@ func testExceptions() throws {
|
||||
try assertTrue(error.kotlinException is MyError)
|
||||
}
|
||||
|
||||
#if !NOOP_GC
|
||||
try assertFalse(TestThrowingConstructorRelease.deinitialized)
|
||||
try testThrowing { try TestThrowingConstructorRelease(doThrow: true) }
|
||||
ValuesKt.gc()
|
||||
try assertTrue(TestThrowingConstructorRelease.deinitialized)
|
||||
#endif
|
||||
|
||||
try testThrowing { try Throwing(doThrow: true) }
|
||||
|
||||
@@ -781,8 +783,10 @@ func setAssociatedObject(object: AnyObject, value: AnyObject) {
|
||||
}
|
||||
|
||||
func testWeakRefs() throws {
|
||||
#if !NOOP_GC
|
||||
try testWeakRefs0(frozen: false)
|
||||
try testWeakRefs0(frozen: true)
|
||||
#endif
|
||||
}
|
||||
|
||||
func testWeakRefs0(frozen: Bool) throws {
|
||||
@@ -1123,6 +1127,7 @@ class TestSharedRefs {
|
||||
try testLambdaSimple()
|
||||
try testObjectPartialRelease()
|
||||
|
||||
#if !NOOP_GC
|
||||
try testBackgroundRefCount(createObject: { $0.createLambda() })
|
||||
try testBackgroundRefCount(createObject: { $0.createRegularObject() })
|
||||
try testBackgroundRefCount(createObject: { $0.createCollection() })
|
||||
@@ -1137,6 +1142,7 @@ class TestSharedRefs {
|
||||
|
||||
try testRememberNewObject(createObject: { $0.createFrozenRegularObject() })
|
||||
try testRememberNewObject(createObject: { $0.createFrozenCollection() })
|
||||
#endif
|
||||
|
||||
usleep(300 * 1000)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user