forked from junit-team/junit5-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (69 loc) · 2.69 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
71
72
73
74
75
76
77
78
79
80
81
plugins {
id 'java'
id 'eclipse' // optional (to generate Eclipse project files)
id 'idea' // optional (to generate IntelliJ IDEA project files)
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
def junit4Version = '4.12'
def junitVintageVersion = '5.3.2'
def junitJupiterVersion = '5.3.2'
def junitPlatformVersion = '1.3.2'
// JUnit Jupiter
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testCompile("org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") {
because 'allows JUnit 5 tests to run'
}
// JUnit Vintage
testCompile("junit:junit:${junit4Version}")
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
// JUnit Platform Launcher + Console
testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") {
because 'allows tests to run from IDEs that bundle older version of launcher'
}
testRuntime("org.junit.platform:junit-platform-console:${junitPlatformVersion}") {
because 'needed to launch the JUnit Platform Console program'
}
// Brahms - Maingine and Single-File Source-Code Test Engine
testRuntime("de.sormuras:brahms:0.0.14") {
because 'executes programs "public static void main(String...args)" as tests'
}
// Mainrunner
testCompile("com.github.sormuras.mainrunner:mainrunner:1.0.0-M4") {
because 'executes Java programs as tests, contains dedicated Java 8 and 11 implementations'
}
// JQwik
testCompile('net.jqwik:jqwik:0.9.0')
// Spek
testCompile('org.jetbrains.spek:spek-api:1.2.1')
testRuntime('org.jetbrains.spek:spek-junit-platform-engine:1.2.1')
testCompile('org.jetbrains.kotlin:kotlin-stdlib')
testCompile('org.jetbrains.kotlin:kotlin-reflect')
// KotlinTest
testCompile('io.kotlintest:kotlintest-runner-junit5:3.1.10')
testRuntime('org.slf4j:slf4j-nop:1.7.25')
// testRuntime('org.slf4j:slf4j-simple:1.7.25')
}
task consoleLauncherTest(type: JavaExec) {
dependsOn testClasses
def reportsDir = file("$buildDir/test-results")
outputs.dir reportsDir
classpath sourceSets.test.runtimeClasspath
main 'org.junit.platform.console.ConsoleLauncher'
args '--scan-classpath'
args '--details', 'tree'
args '--reports-dir', reportsDir
}
test {
// useJUnitPlatform() ... https://github.com/gradle/gradle/issues/4912
dependsOn consoleLauncherTest
exclude '**/*'
}