blob: d367e2259bf92705ce9b4c39d7e758d79493a876 [file] [log] [blame]
Kirill Timofeeva5186962017-10-25 14:25:47 +03001dependencies {
Kirill Timofeeva5186962017-10-25 14:25:47 +03002 testCompile "com.devexperts.lincheck:core:$lincheck_version"
3}
4
Venkat Peri740c4852018-03-21 10:00:55 -04005task checkJdk16() {
6 // only fail w/o JDK_16 when actually trying to compile, not during project setup phase
7 doLast {
8 if (!System.env.JDK_16) {
9 throw new GradleException("JDK_16 environment variable is not defined. " +
10 "Can't build against JDK 1.6 runtime and run JDK 1.6 compatibility tests. " +
11 "Please ensure JDK 1.6 is installed and that JDK_16 points to it.")
12 }
13 }
14}
15
Kirill Timofeeva5186962017-10-25 14:25:47 +030016tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
17 kotlinOptions.jdkHome = System.env.JDK_16
Venkat Peri740c4852018-03-21 10:00:55 -040018 // only fail when actually trying to compile, not during project setup phase
19 dependsOn(checkJdk16)
Kirill Timofeeva5186962017-10-25 14:25:47 +030020}
21
22tasks.withType(Test) {
23 minHeapSize = '1g'
24 maxHeapSize = '1g'
25 enableAssertions = true
26 systemProperty 'java.security.manager', 'kotlinx.coroutines.experimental.TestSecurityManager'
27}
28
29test {
30 exclude '**/*LFTest.*'
31}
32
33task lockFreedomTest(type: Test, dependsOn: testClasses) {
34 classpath = files(configurations.testRuntime,
35 sourceSets.main.output.classesDirs, //clear, untransformed classes
36 sourceSets.test.output.classesDirs)
37 include '**/*LFTest.*'
38}
Roman Elizarovfaf53c72017-10-27 09:53:47 +030039
Venkat Peri740c4852018-03-21 10:00:55 -040040task jdk16Test(type: Test, dependsOn: [testClasses, checkJdk16]) {
Kirill Timofeeva5186962017-10-25 14:25:47 +030041 executable = "$System.env.JDK_16/bin/java"
42 exclude '**/*LinearizabilityTest.*'
43 exclude '**/*LFTest.*'
Vsevolod Tolstopyatovf2b4e0e2018-05-25 18:58:01 +030044 exclude '**/*CancellableContinuationExceptionHandlingTest.*'
Kirill Timofeeva5186962017-10-25 14:25:47 +030045}
Roman Elizarovfaf53c72017-10-27 09:53:47 +030046
Roman Elizarovd66ee722017-12-20 10:44:48 +030047task moreTest(dependsOn: [lockFreedomTest, jdk16Test])
48
49build.dependsOn moreTest
Kirill Timofeeva5186962017-10-25 14:25:47 +030050
51task testsJar(type: Jar, dependsOn: testClasses) {
52 classifier = 'tests'
53 from sourceSets.test.output
54}
55
56artifacts {
57 archives testsJar
Venkat Peri740c4852018-03-21 10:00:55 -040058}