@@ -56,6 +56,7 @@ void defineSourceSet(newName, dependsOn, includedInPred) {
56
56
}
57
57
58
58
static boolean isNativeDarwin (String name ) { return [" ios" , " macos" , " tvos" , " watchos" ]. any { name. startsWith(it) } }
59
+
59
60
static boolean isNativeOther (String name ) { return [" linux" , " mingw" ]. any { name. startsWith(it) } }
60
61
61
62
defineSourceSet(" concurrent" , [" common" ]) { it in [" jvm" , " native" ] }
@@ -77,40 +78,18 @@ kotlin {
77
78
}
78
79
79
80
/*
80
- * Configure four test runs:
81
- * 1) Old memory model, Main thread
82
- * 2) New memory model, Main thread
83
- * 3) Old memory model, BG thread
84
- * 4) New memory model, BG thread (required for Dispatchers.Main tests on Darwin)
81
+ * Configure two test runs:
82
+ * 1) New memory model, Main thread
83
+ * 2) New memory model, BG thread (required for Dispatchers.Main tests on Darwin)
85
84
*
86
85
* All new MM targets are build with optimize = true to have stress tests properly run.
87
86
*/
88
87
targets. withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests . class). configureEach {
89
- binaries {
90
- // Test for memory leaks using a special entry point that does not exit but returns from main
91
- binaries. getTest(" DEBUG" ). freeCompilerArgs + = [" -e" , " kotlinx.coroutines.mainNoExit" ]
92
- }
93
-
94
- binaries. test(" newMM" , [DEBUG ]) {
95
- def thisTest = it
96
- freeCompilerArgs + = [" -e" , " kotlinx.coroutines.mainNoExit" ]
97
- optimized = true
98
- binaryOptions[" memoryModel" ] = " experimental"
99
- testRuns. create(" newMM" ) {
100
- setExecutionSourceFrom(thisTest)
101
- // A hack to get different suffixes in the aggregated report.
102
- executionTask. configure { targetName = " $targetName new MM" }
103
- }
104
- }
105
-
106
- binaries. test(" worker" , [DEBUG ]) {
107
- def thisTest = it
108
- freeCompilerArgs + = [" -e" , " kotlinx.coroutines.mainBackground" ]
109
- testRuns. create(" worker" ) {
110
- setExecutionSourceFrom(thisTest)
111
- executionTask. configure { targetName = " $targetName worker" }
112
- }
113
- }
88
+ def defaultTests = binaries. getTest(" DEBUG" )
89
+ // Test for memory leaks using a special entry point that does not exit but returns from main
90
+ defaultTests. freeCompilerArgs + = [" -e" , " kotlinx.coroutines.mainNoExit" ]
91
+ defaultTests. optimized = true
92
+ defaultTests. binaryOptions[" memoryModel" ] = " experimental"
114
93
115
94
binaries. test(" workerWithNewMM" , [DEBUG ]) {
116
95
def thisTest = it
@@ -150,11 +129,11 @@ def configureNativeSourceSetPreset(name, preset) {
150
129
def implementationConfiguration = configurations[hostMainCompilation. defaultSourceSet. implementationMetadataConfigurationName]
151
130
// Now find the libraries: Finds platform libs & stdlib, but platform declarations are still not resolved due to IDE bugs
152
131
def hostNativePlatformLibs = files(
153
- provider {
154
- implementationConfiguration. findAll {
155
- it. path. endsWith(" .klib" ) || it. absolutePath. contains(" klib${ File.separator} platform" ) || it. absolutePath. contains(" stdlib" )
132
+ provider {
133
+ implementationConfiguration. findAll {
134
+ it. path. endsWith(" .klib" ) || it. absolutePath. contains(" klib${ File.separator} platform" ) || it. absolutePath. contains(" stdlib" )
135
+ }
156
136
}
157
- }
158
137
)
159
138
// Add all those dependencies
160
139
for (suffix in sourceSetSuffixes) {
0 commit comments