Gradle, native: Fix creating test binaries for non-host platforms
Issue #KT-31725 fixed
This commit is contained in:
+11
-3
@@ -1173,7 +1173,15 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
// Check that test binaries can be accessed in a buildscript.
|
||||
build("checkNewGetters") {
|
||||
assertSuccessful()
|
||||
listOf("test.$suffix", "another.$suffix").forEach {
|
||||
val suffixes = listOf("exe", "kexe", "wasm")
|
||||
val names = listOf("test", "another")
|
||||
val files = names.flatMap { name ->
|
||||
suffixes.map { suffix ->
|
||||
"$name.$suffix"
|
||||
}
|
||||
}
|
||||
|
||||
files.forEach {
|
||||
assertContains("Get test: $it")
|
||||
assertContains("Find test: $it")
|
||||
}
|
||||
@@ -1187,7 +1195,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
|Probably you are accessing the default test binary using the 'binaries.getExecutable("test", DEBUG)' method.
|
||||
|Since 1.3.40 tests are represented by a separate binary type. To get the default test binary, use:
|
||||
|
|
||||
| binaries.getTest(DEBUG)
|
||||
| binaries.getTest("DEBUG")
|
||||
""".trimMargin()
|
||||
)
|
||||
}
|
||||
@@ -1199,7 +1207,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
|Probably you are accessing the default test binary using the 'binaries.findExecutable("test", DEBUG)' method.
|
||||
|Since 1.3.40 tests are represented by a separate binary type. To get the default test binary, use:
|
||||
|
|
||||
| binaries.findTest(DEBUG)
|
||||
| binaries.findTest("DEBUG")
|
||||
""".trimMargin()
|
||||
)
|
||||
assertContains("Find test: null")
|
||||
|
||||
+5
-2
@@ -25,7 +25,10 @@ kotlin {
|
||||
fromPreset(presets.linuxX64, 'linux64')
|
||||
fromPreset(presets.mingwX64, 'mingw64')
|
||||
|
||||
configure([macos64, linux64, mingw64]) {
|
||||
// Test creating and accessing test binaries for cross-targets
|
||||
fromPreset(presets.wasm32, 'wasm')
|
||||
|
||||
configure([macos64, linux64, mingw64, wasm]) {
|
||||
compilations.create("anotherTest")
|
||||
binaries {
|
||||
test("another", [DEBUG]) {
|
||||
@@ -68,7 +71,7 @@ task checkOldFind {
|
||||
task checkNewGetters {
|
||||
doLast {
|
||||
kotlin.targets {
|
||||
configure([macos64, linux64, mingw64]) {
|
||||
configure([macos64, linux64, mingw64, wasm]) {
|
||||
println("Get test: ${binaries.getTest(DEBUG).outputFile.name}")
|
||||
println("Find test: ${binaries.findTest(DEBUG).outputFile.name}")
|
||||
println("Get test: ${binaries.getTest("another", DEBUG).outputFile.name}")
|
||||
|
||||
Reference in New Issue
Block a user