-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathbuild.gradle
70 lines (56 loc) · 2.04 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
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.*'
systemProperty 'kotlinx.coroutines.scheduler.keep.alive.sec', '100000' // any unpark problem hangs test
}
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 '**/exceptions/.*'
}
// Always run those tests
task moreTest(dependsOn: [lockFreedomTest])
// Run these tests only during nightly stress test
task extraTest(dependsOn: [jdk16Test])
build.dependsOn moreTest
extraTest.onlyIf { project.properties['stressTest'] != null }
task testsJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
archives testsJar
}