From 625915eebb9d06c825058448d0942d20f62db6f6 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Fri, 6 Nov 2020 14:12:26 +0300 Subject: [PATCH] Cache testing with debug build --- kotlin-native/backend.native/tests/build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 210226e4b4b..a7ad979658d 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -121,8 +121,16 @@ ext.konanNoRun = true final CacheTesting cacheTesting = CacheTestingKt.configureCacheTesting(project) if (cacheTesting != null) { - // Note: can't do this in [CacheTesting.configure] since task classes aren't accessible there. + // Check for debug build and set the -g option. + if (project.globalTestArgs.contains("-opt")) { + throw new IllegalArgumentException("Cache testing should be run with debug build. " + + "Remove -opt options from the test args") + } + if (!project.globalTestArgs.contains("-g")) { + project.globalTestArgs.add("-g") + } + // Note: can't do this in [CacheTesting.configure] since task classes aren't accessible there. tasks.withType(KonanCompileNativeBinary.class).configureEach { dependsOn cacheTesting.buildCacheTask extraOpts cacheTesting.compilerArgs