[K/N][test] Fix cache mode selection for test targets without cache
Execution of tests without cache support should be restricted. Such runs should use default cache mode (without).
This commit is contained in:
+5
-2
@@ -262,10 +262,11 @@ private object NativeTestSupport {
|
||||
kotlinNativeTargets: KotlinNativeTargets,
|
||||
optimizationMode: OptimizationMode
|
||||
): CacheMode {
|
||||
val defaultCache = CacheMode.defaultForTestTarget(distribution, kotlinNativeTargets)
|
||||
val cacheMode = ClassLevelProperty.CACHE_MODE.readValue(
|
||||
enforcedProperties,
|
||||
CacheMode.Alias.values(),
|
||||
default = CacheMode.defaultForTestTarget(distribution, kotlinNativeTargets)
|
||||
default = defaultCache
|
||||
)
|
||||
val useStaticCacheForUserLibraries = when (cacheMode) {
|
||||
CacheMode.Alias.NO -> return CacheMode.WithoutCache
|
||||
@@ -275,7 +276,9 @@ private object NativeTestSupport {
|
||||
}
|
||||
val makePerFileCaches = cacheMode == CacheMode.Alias.STATIC_PER_FILE_EVERYWHERE
|
||||
|
||||
return CacheMode.WithStaticCache(
|
||||
return if (defaultCache == CacheMode.Alias.NO)
|
||||
CacheMode.WithoutCache
|
||||
else CacheMode.WithStaticCache(
|
||||
distribution,
|
||||
kotlinNativeTargets,
|
||||
optimizationMode,
|
||||
|
||||
Reference in New Issue
Block a user