[Native][tests] Fix warnings in debugger tests

This commit is contained in:
Pavel Punegov
2021-08-16 16:49:08 +03:00
committed by Space
parent 4049cf94b1
commit 7e1c776376
3 changed files with 6 additions and 5 deletions

View File

@@ -32,6 +32,7 @@ class ToolDriver(
else
arrayOf("-target", target())
@Suppress("UNUSED_PARAMETER")
private fun compile(output: Path, vararg args: String, argsCalculator:() -> Array<String>) {
check(!Files.exists(output))
val allArgs = arrayOf(*crossPlatform(), *argsCalculator())
@@ -74,9 +75,9 @@ class ToolDriver(
DwarfUtilParser().parse(StringReader(out)).tags.toList().processor()
}
fun swiftc(output: Path, swiftSrc: Path, vararg args: String) {
fun swiftc(output: Path, swiftSrc: Path, vararg args: String): String {
val swiftProcess = subprocess(DistProperties.swiftc, "-o", output.toString(), swiftSrc.toString(), *args)
val out = swiftProcess.takeIf { it.process.exitValue() == 0 }?.stdout ?: error(swiftProcess.stderr)
return swiftProcess.takeIf { it.process.exitValue() == 0 }?.stdout ?: error(swiftProcess.stderr)
}
}

View File

@@ -1,6 +1,6 @@
package org.jetbrains.kotlin.native.test.debugger
import junit.framework.Assert.*
import org.junit.Assert.*
import org.junit.Ignore
import org.junit.Test

View File

@@ -173,7 +173,7 @@ fun dwarfDumpComplexTest(test:ToolDriverHelper.()->Unit) {
with(Files.createTempDirectory("dwarfdump_test_complex")) {
toFile().deleteOnExit()
val driver = ToolDriverHelper(ToolDriver(), this).test()
ToolDriverHelper(ToolDriver(), this).test()
}
}
@@ -186,7 +186,7 @@ fun lldbComplexTest(test:ToolDriverHelper.()->Unit) {
with(Files.createTempDirectory("lldb_test_complex")) {
toFile().deleteOnExit()
val driver = ToolDriverHelper(ToolDriver(), this).test()
ToolDriverHelper(ToolDriver(), this).test()
}
}