diff --git a/build.gradle b/build.gradle index bbe606cb..282773b3 100644 --- a/build.gradle +++ b/build.gradle @@ -165,6 +165,16 @@ task buildDLJC(type: Exec) { commandLine './buildDLJC' } +def configureTestJvmArgs = { Test testTask -> + if (isJava8) { + testTask.jvmArgs += [ + "-Xbootclasspath/p:${configurations.javacJar.asPath}" + ] + } else { + testTask.jvmArgs += compilerArgsForRunningCF + } +} + test { dependsOn(shadowJar) dependsOn('dist') @@ -178,17 +188,6 @@ test { systemProperties += ["emit.test.debug": 'true'] } - if (isJava8) { - jvmArgs += [ - "-Xbootclasspath/p:${configurations.javacJar.asPath}" - ] - } else { - // Without this, the test throw "java.lang.OutOfMemoryError: Java heap space" - // Corresponding pull request: https://github.com/opprop/checker-framework-inference/pull/263 - forkEvery(1) - jvmArgs += compilerArgsForRunningCF - } - testLogging { // Always run the tests outputs.upToDateWhen { false } @@ -373,11 +372,7 @@ afterEvaluate { systemProperties += ["emit.test.debug": 'true'] } - if (isJava8) { - jvmArgs += [ - "-Xbootclasspath/p:${configurations.javacJar.asPath}" - ] - } + configureTestJvmArgs(delegate) testLogging { // Always run the tests