This repository has been archived by the owner on Oct 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
53 lines (43 loc) · 1.88 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
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile group:'org.junit.jupiter', name:'junit-jupiter-api', version:'5.7.0'
compile group:'org.junit.jupiter', name:'junit-jupiter-params', version:'5.7.0'
//junit 5
testImplementation "org.junit.platform:junit-platform-launcher:1.4.2"
testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.0') //!IMPORTANT:do not modify, this is the only syntax travis understands.
testRuntime "org.junit.jupiter:junit-jupiter-engine:5.7.0"
//junit4
compile group:'org.junit.vintage', name:'junit-vintage-engine', version:'5.7.0'
compile group:'junit', name:'junit', version:'4.13.1'
//testNG
compile group: 'org.testng', name: 'testng', version: '6.9.10'
//mockito
compile "org.mockito:mockito-core:3.+"
//testNG
compile group: 'org.testng', name: 'testng', version: '6.9.10'
}
test{
useJUnitPlatform {}
testLogging {
showStandardStreams = true
events "passed", "skipped", "failed"
}
//to get "Test summary: 1 tests, 1 succeeded, 0 failed, 0 skipped"
afterSuite { desc, result ->
if (!desc.parent) {
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
logger.error('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}