From 2bb9b936ac955bed4aeccb69c04666ffe339eabf Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Tue, 13 Feb 2024 08:53:03 +0100 Subject: [PATCH] [K/N][Tests] Small cleanup --- .../kotlin/konan/test/blackbox/ComplexCInteropTest.kt | 9 ++------- .../blackbox/support/compilation/CompilationToolCall.kt | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/ComplexCInteropTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/ComplexCInteropTest.kt index 21070ada3b5..59cb42c8a16 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/ComplexCInteropTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/ComplexCInteropTest.kt @@ -35,7 +35,8 @@ class ClassicComplexCInteropTest : ComplexCInteropTestBase() class FirComplexCInteropTest : ComplexCInteropTestBase() abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { - private val interopObjCDir = File("native/native.tests/testData/interop/objc") + private val interopDir = File("native/native.tests/testData/interop") + private val interopObjCDir = interopDir.resolve("objc") @Test @TestMetadata("smoke.kt") @@ -59,7 +60,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily) val mSources = listOf(interopObjCDir.resolve("smoke.m")) val dylib = compileDylib("objcsmoke", mSources) - println(dylib) if (testRunSettings.configurables.targetTriple.isSimulator) codesign(dylib.resultingArtifact.path) val stringsdict = interopObjCDir.resolve("Localizable.stringsdict") @@ -71,7 +71,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { outputDir = buildDir, freeCompilerArgs = TestCompilerArgs(emptyList(), cinteropArgs = listOf("-header", "smoke.h")) ).assertSuccess().resultingArtifact - println(cinteropKlib) val testCase = generateTestCaseWithSingleFile( sourceFile = interopObjCDir.resolve("$ktFilePrefix.kt"), @@ -88,7 +87,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { ) ) val success = compileToExecutable(testCase, cinteropKlib.asLibraryDependency()).assertSuccess() - println(success) val testExecutable = TestExecutable( success.resultingArtifact, success.loggedData, @@ -105,7 +103,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { val dylib = compileDylib("objctests", mSources) if (testRunSettings.configurables.targetTriple.isSimulator) codesign(dylib.resultingArtifact.path) - println(dylib) val hFiles = interopObjCDir.resolve("tests").listFiles { file: File -> file.name.endsWith(".h") }!!.toList() val cinteropKlib = cinteropToLibrary( @@ -114,7 +111,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { outputDir = buildDir, freeCompilerArgs = TestCompilerArgs(emptyList(), cinteropArgs = hFiles.flatMap { listOf("-header", "tests/${it.name}") }) ).assertSuccess().resultingArtifact - println(cinteropKlib) val ignoredTestGTestPatterns = if (testRunSettings.get() != GCType.NOOP) emptySet() else setOf( "Kt41811Kt.*", @@ -134,7 +130,6 @@ abstract class ComplexCInteropTestBase : AbstractNativeSimpleTest() { extras = TestCase.WithTestRunnerExtras(TestRunnerType.DEFAULT, ignoredTestGTestPatterns), ) val success = compileToExecutable(testCase, cinteropKlib.asLibraryDependency()).assertSuccess() - println(success) val testExecutable = TestExecutable( success.resultingArtifact, success.loggedData, diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/CompilationToolCall.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/CompilationToolCall.kt index eb4db05e08a..70394184212 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/CompilationToolCall.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/compilation/CompilationToolCall.kt @@ -149,7 +149,7 @@ internal fun invokeCInterop( } return when { // cinterop has failed with a known error that was returned as a result. - cinteropResult is Exception -> { + cinteropResult is Throwable -> { CompilationToolCallResult( exitCode = ExitCode.COMPILATION_ERROR, toolOutput = cinteropResult.stackTraceToString(),