16
16
* limitations under the License.
17
17
*/
18
18
19
+ import java.util.regex.Pattern
20
+
19
21
import groovy.json.JsonSlurper
20
22
import groovy.text.SimpleTemplateEngine
21
23
@@ -36,9 +38,9 @@ class Tester {
36
38
// Constants?
37
39
int defaultTimeoutSeconds = 60
38
40
String testExt = ' .test'
39
- String executeAnchorDir = ' / src/ '
40
- String testFileSpec = " **/ *${ testExt} "
41
- String testSearchDir = ' ../../ ..'
41
+ String executeAnchorDir = File . separator + ' src' + File . separator
42
+ String testFileSpec = ' ** ' + File . separator + " *${ testExt} "
43
+ String testSearchDir = ' ..' + File . separator + ' .. ' + File . separator + ' ..'
42
44
String sdExt = ' .dsd.json'
43
45
String optionPrefix = ' arg.'
44
46
String metricsFile = ' output_metrics.txt'
@@ -49,8 +51,9 @@ class Tester {
49
51
String testPrefix = ' test_'
50
52
String ignorePrefix = ' ignore_'
51
53
52
- final static String defaultInputPath = ' ../../data'
53
- final static String defaultOutputPath = System . getProperty(' user.dir' ) + ' /tmp/PipelineTester'
54
+ final static String defaultInputPath = ' ..' + File . separator + ' ..' + File . separator + ' data'
55
+ final static String defaultOutputPath = System . getProperty(' user.dir' ) +
56
+ File . separator + ' tmp' + File . separator + ' PipelineTester'
54
57
55
58
// Controlled by setup sections
56
59
int testTimeoutSeconds = defaultTimeoutSeconds
@@ -113,7 +116,7 @@ class Tester {
113
116
114
117
// Reset filename and section number
115
118
// along with other test-specific objects
116
- currentTestFilename = path. split(File . separator)[-1 ]
119
+ currentTestFilename = path. split(Pattern . quote( File . separator) )[-1 ]
117
120
currentTestFilename = currentTestFilename.
118
121
take(currentTestFilename. length() - testExt. length())
119
122
sectionNumber = 0
@@ -220,7 +223,7 @@ class Tester {
220
223
info(' Test files' , sprintf (' %3s' , filesUsed ? filesUsed : ' -' ))
221
224
info(' Tests found' , sprintf (' %3s' , testsFound ? testsFound : ' -' ))
222
225
info(' Tests passed' ,sprintf (' %3s' , testsPassed ? testsPassed : ' -' ))
223
- info(' Tests failed' , sprintf (' %3s' , testsFailed ? failedTests : ' -' ))
226
+ info(' Tests failed' , sprintf (' %3s' , testsFailed ? testsFailed : ' -' ))
224
227
info(' Tests skipped' , sprintf (' %3s' , testsSkipped ? testsSkipped : ' -' ))
225
228
info(' Tests ignored' , sprintf (' %3s' , testsIgnored ? testsIgnored : ' -' ))
226
229
info(' Warnings' , sprintf (' %3s' , numWarnings ? numWarnings : ' -' ))
@@ -516,7 +519,7 @@ class Tester {
516
519
*/
517
520
private recordFailedTest (testName ) {
518
521
519
- failedTests. add(" ${ currentTestFilename} / ${ testName} " )
522
+ failedTests. add(" ${ currentTestFilename} " + File . separator + " ${ testName} " )
520
523
521
524
}
522
525
0 commit comments