-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-junit-spock-testng.gradle
56 lines (46 loc) · 1.5 KB
/
build-junit-spock-testng.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
apply plugin: 'groovy'
description = 'Gradle example project for executing JUnit(Java, Groovy) + TestNG(Java, Groovy) + Spock(Groovy) test cases.'
defaultTasks 'clean', 'test'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.1.6'
testCompile 'org.testng:testng:6.8.5'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'junit:junit:4.11'
}
// default test task (=JUnit) depends on testTestNG task
// => testTestNG task run, then, test task run.
task testTestNG(type: Test) {
useTestNG()
testReportDir = file('junit-spock-testng/testng/test-reports')
testResultsDir = file('junit-spock-testng/testng/test-results')
}
test {
// default : JUnit
testReportDir = file('junit-spock-testng/junit-spock/test-reports')
testResultsDir = file('junit-spock-testng/junit-spock/test-results')
dependsOn 'testTestNG'
}
// ex:
// test task with useTestNG() depends on testJUnit task
// => testJUnit task run, then, test task with useTestNG() run.
/*
task testJUnit(type: Test) {
// default : JUnit
testReportDir = file('junit-spock-testng/junit-spock/test-reports')
testResultsDir = file('junit-spock-testng/junit-spock/test-results')
}
test {
useTestNG()
testReportDir = file('junit-spock-testng/testng/test-reports')
testResultsDir = file('junit-spock-testng/testng/test-results')
dependsOn 'testJUnit'
}
*/
clean {
delete << 'junit-spock-testng'
}