@@ -11,98 +11,6 @@ buildscript {
1111 }
1212}
1313
14- // source: https://github.com/mendhak/Gradle-Travis-Colored-Output/blob/master/ColoredOutput.gradle
15- tasks. withType(Test ) {
16-
17- boolean TRAVIS_FOLDING = project. hasProperty(' TRAVIS_FOLDING' ) ? project. TRAVIS_FOLDING : true
18- String ANSI_BOLD_WHITE = " \u 001B[0;1m" ;
19- String ANSI_RESET = " \u 001B[0m" ;
20- String ANSI_BLACK = " \u 001B[30m" ;
21- String ANSI_RED = " \u 001B[31m" ;
22- String ANSI_GREEN = " \u 001B[32m" ;
23- String ANSI_YELLOW = " \u 001B[33m" ;
24- String ANSI_BLUE = " \u 001B[34m" ;
25- String ANSI_PURPLE = " \u 001B[35m" ;
26- String ANSI_CYAN = " \u 001B[36m" ;
27- String ANSI_WHITE = " \u 001B[37m" ;
28- String CHECK_MARK = " \u 2713" ;
29- String NEUTRAL_FACE = " \u 0CA0_\u 0CA0" ;
30- String X_MARK = " \u 274C" ;
31-
32- beforeSuite { suite ->
33- if (suite. name. startsWith(" Test Run" ) || suite. name. startsWith(" Gradle Worker" )) {
34- return ;
35- }
36-
37- if (suite. parent != null && suite. className != null ) {
38- if (TRAVIS_FOLDING ) {
39- out. println (" travis_fold:start:" + suite. name + " \r " );
40- }
41- out. println (ANSI_BOLD_WHITE + suite. name + ANSI_RESET );
42- }
43-
44- }
45-
46- afterTest { descriptor , result ->
47- def indicator = ANSI_WHITE
48-
49- if (result. failedTestCount > 0 ) {
50- indicator = ANSI_RED + X_MARK ;
51- } else if (result. skippedTestCount > 0 ) {
52- indicator = ANSI_YELLOW + NEUTRAL_FACE ;
53- } else {
54- indicator = ANSI_GREEN + CHECK_MARK ;
55- }
56-
57- out. println (' ' + indicator + ANSI_RESET + " " + descriptor. name);
58-
59- if (result. failedTestCount > 0 ) {
60- out. println (' ' );
61- }
62- }
63-
64- afterSuite { desc , result ->
65- if (desc. parent != null && desc. className != null ) {
66-
67- if (TRAVIS_FOLDING && result. failedTestCount == 0 ) {
68- out. println (" travis_fold:end:" + desc. name + " \r " );
69- }
70- out. println (" " );
71- }
72-
73- if (! desc. parent) { // will match the outermost suite
74- def failStyle = ANSI_RED ;
75- def skipStyle = ANSI_YELLOW ;
76- def summaryStyle = ANSI_WHITE ;
77- if (result. failedTestCount > 0 ) {
78- failStyle = ANSI_RED ;
79- }
80- if (result. skippedTestCount > 0 ) {
81- skipStyle = ANSI_YELLOW ;
82- }
83-
84- switch (result. resultType) {
85- case TestResult.ResultType . SUCCESS :
86- summaryStyle = ANSI_GREEN ;
87- break ;
88- case TestResult.ResultType . FAILURE :
89- summaryStyle = ANSI_RED ;
90- break ;
91- }
92-
93- out. println (" --------------------------------------------------------------------------" );
94- out. println (" Results: " + summaryStyle + " ${ result.resultType} " + ANSI_RESET
95- + " (${ result.testCount} tests, "
96- + ANSI_GREEN + " ${ result.successfulTestCount} passed" + ANSI_RESET
97- + " , " + failStyle + " ${ result.failedTestCount} failed" + ANSI_RESET
98- + " , " + skipStyle + " ${ result.skippedTestCount} skipped" + ANSI_RESET
99- + " )" );
100- out. println (" --------------------------------------------------------------------------" );
101- }
102- }
103-
104- }
105-
10614apply plugin : ' java'
10715apply plugin : ' org.springframework.boot'
10816apply plugin : ' io.spring.dependency-management'
0 commit comments