blob: d367e2259bf92705ce9b4c39d7e758d79493a876 [file] [log] [blame]
dependencies {
testCompile "com.devexperts.lincheck:core:$lincheck_version"
}
task checkJdk16() {
// only fail w/o JDK_16 when actually trying to compile, not during project setup phase
doLast {
if (!System.env.JDK_16) {
throw new GradleException("JDK_16 environment variable is not defined. " +
"Can't build against JDK 1.6 runtime and run JDK 1.6 compatibility tests. " +
"Please ensure JDK 1.6 is installed and that JDK_16 points to it.")
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions.jdkHome = System.env.JDK_16
// only fail when actually trying to compile, not during project setup phase
dependsOn(checkJdk16)
}
tasks.withType(Test) {
minHeapSize = '1g'
maxHeapSize = '1g'
enableAssertions = true
systemProperty 'java.security.manager', 'kotlinx.coroutines.experimental.TestSecurityManager'
}
test {
exclude '**/*LFTest.*'
}
task lockFreedomTest(type: Test, dependsOn: testClasses) {
classpath = files(configurations.testRuntime,
sourceSets.main.output.classesDirs, //clear, untransformed classes
sourceSets.test.output.classesDirs)
include '**/*LFTest.*'
}
task jdk16Test(type: Test, dependsOn: [testClasses, checkJdk16]) {
executable = "$System.env.JDK_16/bin/java"
exclude '**/*LinearizabilityTest.*'
exclude '**/*LFTest.*'
exclude '**/*CancellableContinuationExceptionHandlingTest.*'
}
task moreTest(dependsOn: [lockFreedomTest, jdk16Test])
build.dependsOn moreTest
task testsJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
archives testsJar
}