From 118a5cee06f5066c45fe6d9ea5d6cdf963f52449 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Wed, 31 Jan 2024 13:06:12 +0100 Subject: [PATCH] [K/N][Tests] Cleanup tests code from old infra ^KT-61259 --- .../backend.native/tests/build.gradle | 86 ------------------- .../kotlin/native/internal/test/TestRunner.kt | 2 - .../test/blackbox/support/runner/TestRun.kt | 2 - 3 files changed, 90 deletions(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 3d90c0da423..2cd06fcb384 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -1291,92 +1291,6 @@ standaloneTest("interop_opengl_teapot") { */ if (PlatformInfo.isAppleTarget(project)) { - interopTest("interop_objc_smoke") { - enabled = !isNoopGC - source = "interop/objc/smoke.kt" - interop = 'objcSmoke' - doBeforeBuild { - def dylibFile = project.layout.buildDirectory.file("libobjcsmoke.dylib").get().asFile - mkdir(dylibFile.parentFile) - project.extensions.execClang.execClangForCompilerTests(project.target) { - args "$projectDir/interop/objc/smoke.m" - args "-lobjc", '-fobjc-arc' - args '-fPIC', '-shared', '-o', dylibFile.toString() - // Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions: - args '-O2' - } - if (UtilsKt.isSimulatorTarget(project, project.target)) { - UtilsKt.codesign(project, dylibFile.toString()) - } - - copy { - from("interop/objc/Localizable.stringsdict") - into("$testOutputLocal/$name/$target/en.lproj/") - } - } - useGoldenData = true - } - - interopTest("interop_objc_smoke_noopgc") { - enabled = isNoopGC - source = "interop/objc/smoke_noopgc.kt" - interop = 'objcSmoke' - verifyIr = false // KT-57716 - doBeforeBuild { - def dylibFile = project.layout.buildDirectory.file("libobjcsmoke.dylib").get().asFile - mkdir(dylibFile.parentFile) - project.extensions.execClang.execClangForCompilerTests(project.target) { - args "$projectDir/interop/objc/smoke.m" - args "-lobjc", '-fobjc-arc' - args '-fPIC', '-shared', '-o', dylibFile.toString() - // Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions: - args '-O2' - } - if (UtilsKt.isSimulatorTarget(project, project.target)) { - UtilsKt.codesign(project, dylibFile.toString()) - } - - copy { - from("interop/objc/Localizable.stringsdict") - into("$testOutputLocal/$name/$target/en.lproj/") - } - } - // No deallocations for the no-op GC. - useGoldenData = true - } - - interopTestMultifile("interop_objc_tests") { - source = "interop/objc/tests/" - interop = 'objcTests' - flags = ['-tr', '-e', 'main', '-opt-in=kotlin.native.internal.InternalForKotlinNative'] - - if (isNoopGC) { - def exclude = [ - "Kt41811Kt.*", - "CustomStringKt.testCustomString", - "Kt42482Kt.testKT42482", - "ObjcWeakRefsKt.testObjCWeakRef", - "WeakRefsKt.testWeakRefs" - ] - arguments += ["--ktest_filter=*-${exclude.join(":")}"] - } - - doBeforeBuild { - def dylibFile = project.layout.buildDirectory.file("libobjctests.dylib").get().asFile - mkdir(dylibFile.parentFile) - project.extensions.execClang.execClangForCompilerTests(project.target) { - args fileTree("$projectDir/interop/objc/tests/") { include '**/*.m' } - args "-lobjc", '-fobjc-arc' - args '-fPIC', '-shared', '-o', dylibFile.toString() - // Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions: - args '-O2' - } - if (UtilsKt.isSimulatorTarget(project, project.target)) { - UtilsKt.codesign(project, dylibFile.toString()) - } - } - } - standaloneTest("interop_objc_kt61441") { source = "interop/objc/kt61441.kt" UtilsKt.dependsOnPlatformLibs(it) diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt index 53ec1478e5f..9a6fcdb7971 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt @@ -95,7 +95,6 @@ internal class TestProcessor(val suites: List, val args: Array if (c == '*' || c == '?') { @@ -105,7 +104,6 @@ internal class TestProcessor(val suites: List, val args: Array List.get(on // must be in sync with `fromGTestPattern(String)` in kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt internal fun fromGTestPattern(pattern: String): Regex { val result = StringBuilder() - result.append("^") var prevIndex = 0 pattern.forEachIndexed { index, c -> if (c == '*' || c == '?') { @@ -152,7 +151,6 @@ internal fun fromGTestPattern(pattern: String): Regex { } } result.append(pattern.substringEscaped(prevIndex until pattern.length)) - result.append("$") return result.toString().toRegex() }