From 0753a912539b596e904a34596b527ce6ca71ffd9 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Mon, 23 Nov 2020 10:59:50 -0800 Subject: [PATCH] Add MacOSX64 target to coroutines and test modules (#20) --- README.md | 2 ++ coroutines/build.gradle.kts | 1 + test/build.gradle.kts | 1 + test/src/macosX64Main/kotlin/runTest.kt | 13 +++++++++++++ 4 files changed, 17 insertions(+) create mode 100644 test/src/macosX64Main/kotlin/runTest.kt diff --git a/README.md b/README.md index cc09bf0b..480e6332 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,12 @@ Toolbox of utilities/helpers for Kotlin development. - [`coroutines`](coroutines) - Tools/utilities for [Coroutines] ![badge][badge-js] ![badge][badge-jvm] +![badge][badge-macos] - [`test`](test) - Utilities for test suites ![badge][badge-js] ![badge][badge-jvm] +![badge][badge-macos] [Collections]: https://kotlinlang.org/docs/reference/collections-overview.html diff --git a/coroutines/build.gradle.kts b/coroutines/build.gradle.kts index 45ea27fe..9c75db6d 100644 --- a/coroutines/build.gradle.kts +++ b/coroutines/build.gradle.kts @@ -13,6 +13,7 @@ kotlin { jvm() js().browser() + macosX64() sourceSets { val commonMain by getting { diff --git a/test/build.gradle.kts b/test/build.gradle.kts index cd2a74e7..403131b4 100644 --- a/test/build.gradle.kts +++ b/test/build.gradle.kts @@ -11,6 +11,7 @@ kotlin { jvm() js().browser() + macosX64() sourceSets { val commonMain by getting { diff --git a/test/src/macosX64Main/kotlin/runTest.kt b/test/src/macosX64Main/kotlin/runTest.kt new file mode 100644 index 00000000..55b9205f --- /dev/null +++ b/test/src/macosX64Main/kotlin/runTest.kt @@ -0,0 +1,13 @@ +package com.juul.tuulbox.test + +import kotlinx.cinterop.memScoped +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.runBlocking + +public actual fun runTest( + action: suspend CoroutineScope.() -> Unit +): Unit = runBlocking { + memScoped { + action.invoke(this@runBlocking) + } +}