Skip to content

Commit

Permalink
Add test infrastructure to run native tests on a background thread
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jun 3, 2021
1 parent ad272ea commit 4a4535f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ kotlin {
useExperimentalAnnotation('kotlinx.coroutines.ExperimentalCoroutinesApi')
}
}

// Add a test binary and execution for native targets which runs on a background thread.
targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests).all {
binaries {
test('background', [org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG]) {
freeCompilerArgs += [
"-trw"
]
}
}
testRuns {
background {
setExecutionSourceFrom(binaries.getByName("backgroundDebugTest"))
}
}
}
}

apply plugin: 'com.diffplug.spotless'
Expand Down

0 comments on commit 4a4535f

Please sign in to comment.