-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor mpp/native build, introduce "concurrent" source set, test la…
…uncher New source sets: * "concurrent" source set is shared between "jvm" and "native" * "native" source set is subdivided into "nativeDarwin" (Apple) and "nativeOther" (Linux, etc) Native tests are launched in two variants: * A default "test" task runs tests with memory leak checker from "mainNoExit" entry point. * A special "backgroundTest" task runs tests in a background worker from "mainBackground" entry point. Other build improvement: * Modernize old-style IDEA-active hacks to kts helper. * Extract versions of JS test runner dependencies. * Remove redundant google repo reference from android tests.
- Loading branch information
Showing
13 changed files
with
209 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
object Idea { | ||
@JvmStatic // for Gradle | ||
val active: Boolean | ||
get() = System.getProperty("idea.active") == "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
internal expect inline fun workerMain(block: () -> Unit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
import kotlinx.cinterop.* | ||
|
||
internal actual inline fun workerMain(block: () -> Unit) { | ||
autoreleasepool { | ||
block() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
import platform.CoreFoundation.* | ||
import kotlin.native.concurrent.* | ||
import kotlin.native.internal.test.* | ||
import kotlin.system.* | ||
|
||
// This is a separate entry point for tests in background | ||
fun mainBackground(args: Array<String>) { | ||
val worker = Worker.start(name = "main-background") | ||
worker.execute(TransferMode.SAFE, { args.freeze() }) { | ||
val result = testLauncherEntryPoint(it) | ||
exitProcess(result) | ||
} | ||
CFRunLoopRun() | ||
error("CFRunLoopRun should never return") | ||
} | ||
|
||
// This is a separate entry point for tests with leak checker | ||
fun mainNoExit(args: Array<String>) { | ||
workerMain { // autoreleasepool to make sure interop objects are properly freed | ||
testLauncherEntryPoint(args) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
internal actual inline fun workerMain(block: () -> Unit) = block() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
import kotlin.native.concurrent.* | ||
import kotlin.native.internal.test.* | ||
import kotlin.system.* | ||
|
||
// This is a separate entry point for tests in background | ||
fun mainBackground(args: Array<String>) { | ||
val worker = Worker.start(name = "main-background") | ||
worker.execute(TransferMode.SAFE, { args.freeze() }) { | ||
val result = testLauncherEntryPoint(it) | ||
exitProcess(result) | ||
}.result // block main thread | ||
} | ||
|
||
// This is a separate entry point for tests with leak checker | ||
fun mainNoExit(args: Array<String>) { | ||
testLauncherEntryPoint(args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters