-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.gradle
71 lines (65 loc) · 2.34 KB
/
tests.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
71
configurations {
antClasspath
}
test {
useJUnitPlatform()
systemProperty 'com.athaydes.spockframework.report.showCodeBlocks', true
maxParallelForks 1
forkEvery 100
maxHeapSize= '2G'
}
dependencies {
testImplementation 'org.codehaus.groovy:groovy-all:3.0.9'
testImplementation platform("org.spockframework:spock-bom:2.0-M4-groovy-3.0")
testImplementation 'org.spockframework:spock-core'
testImplementation 'org.spockframework:spock-junit4'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:3.4.6'
testImplementation( "com.athaydes:spock-reports:2.0-groovy-3.0" ) {
transitive = false // this avoids affecting your version of Groovy/Spock
}
testImplementation fileTree(project.projectDir) {
include "lib/test/*.jar"
}
antClasspath('org.apache.ant:ant-junit:1.9.2') { transitive = false }
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}
ant.taskdef(name: 'junit', classname: 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask',
classpath: configurations.antClasspath.asPath)
sourceSets{
test {
java {
srcDirs 'src-test/src'
outputDir = file("src-test/build/classes")
}
resources {
srcDirs 'src-test/resources'
}
groovy {
srcDirs "src-test/test/groovy"
}
}
}
if(file('modules').exists() && file('modules').isDirectory()){
file('modules').eachDir {
sourceSets.test.java.srcDirs += it.toString()+"/src-test/src"
sourceSets.test.resources.srcDirs += it.toString()+"/src-test/resources"
sourceSets.test.java.outputDir = file("src-test/build/classes")
sourceSets.test.groovy.srcDirs += it.toString()+"/src-test/test/groovy"
sourceSets.test.groovy.outputDir = file("src-test/build/classes")
}
}
if(file('modules_core').exists() && file('modules_core').isDirectory()){
file('modules_core').eachDir {
sourceSets.test.java.srcDirs += it.toString()+"/src-test"
sourceSets.test.resources.srcDirs += it.toString()+"/src-test/resources"
sourceSets.test.java.outputDir = file("src-test/build/classes")
}
}
task depsTest {
doLast {
configurations.compileClasspath.getFiles().each { file ->
dependencies.testImplementation files(file)
}
}
}