Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 1 | dependencies { |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 2 | testCompile "com.devexperts.lincheck:core:$lincheck_version" |
| 3 | } |
| 4 | |
Venkat Peri | 740c485 | 2018-03-21 10:00:55 -0400 | [diff] [blame] | 5 | task 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 Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 16 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { |
| 17 | kotlinOptions.jdkHome = System.env.JDK_16 |
Venkat Peri | 740c485 | 2018-03-21 10:00:55 -0400 | [diff] [blame] | 18 | // only fail when actually trying to compile, not during project setup phase |
| 19 | dependsOn(checkJdk16) |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | tasks.withType(Test) { |
| 23 | minHeapSize = '1g' |
| 24 | maxHeapSize = '1g' |
| 25 | enableAssertions = true |
| 26 | systemProperty 'java.security.manager', 'kotlinx.coroutines.experimental.TestSecurityManager' |
| 27 | } |
| 28 | |
| 29 | test { |
| 30 | exclude '**/*LFTest.*' |
| 31 | } |
| 32 | |
| 33 | task 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 Elizarov | faf53c7 | 2017-10-27 09:53:47 +0300 | [diff] [blame] | 39 | |
Venkat Peri | 740c485 | 2018-03-21 10:00:55 -0400 | [diff] [blame] | 40 | task jdk16Test(type: Test, dependsOn: [testClasses, checkJdk16]) { |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 41 | executable = "$System.env.JDK_16/bin/java" |
| 42 | exclude '**/*LinearizabilityTest.*' |
| 43 | exclude '**/*LFTest.*' |
Vsevolod Tolstopyatov | f2b4e0e | 2018-05-25 18:58:01 +0300 | [diff] [blame] | 44 | exclude '**/*CancellableContinuationExceptionHandlingTest.*' |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 45 | } |
Roman Elizarov | faf53c7 | 2017-10-27 09:53:47 +0300 | [diff] [blame] | 46 | |
Roman Elizarov | d66ee72 | 2017-12-20 10:44:48 +0300 | [diff] [blame] | 47 | task moreTest(dependsOn: [lockFreedomTest, jdk16Test]) |
| 48 | |
| 49 | build.dependsOn moreTest |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 50 | |
| 51 | task testsJar(type: Jar, dependsOn: testClasses) { |
| 52 | classifier = 'tests' |
| 53 | from sourceSets.test.output |
| 54 | } |
| 55 | |
| 56 | artifacts { |
| 57 | archives testsJar |
Venkat Peri | 740c485 | 2018-03-21 10:00:55 -0400 | [diff] [blame] | 58 | } |