Skip to content

Commit 82e323a

Browse files
skip test where the os has no test prepared
Signed-off-by: Thomas Nellemann Kramer <[email protected]>
1 parent 0db82b9 commit 82e323a

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ approvalTest = tasks.register("approvalTest", Test) {
203203
dependsOn copyJarToBin, copyRunScripts
204204

205205
def output = -1
206+
def weRanATest = false
206207
def runningOs = OS_NAME.toLowerCase()
207208

208209
if (runningOs == "linux") {
@@ -214,21 +215,27 @@ approvalTest = tasks.register("approvalTest", Test) {
214215

215216
def proc = "./approvaltest".execute()
216217
proc.waitForProcessOutput(System.out, System.err)
218+
weRanATest = true
217219
}
218220
if (runningOs.contains("windows")) {
219221
println "Windows detected"
220222
def proc = "./approvaltestWin.cmd".execute()
221223
proc.waitForProcessOutput(System.out, System.err)
224+
weRanATest = true
222225
}
223226

224-
output = new BuildHelper().compareFiles(approvalExpectedOutput, approvalActualOutput, true)
225-
println "exit from compare: ${output}"
226-
227-
if (output != 0) {
228-
println "*** FAIL ***"
229-
throw new StopExecutionException("${approvalExpectedOutput} and ${approvalActualOutput} are different")
227+
if (!weRanATest){
228+
println "No prepared test for the OS detected: ${runningOs} - skipping"
230229
} else {
231-
println "${approvalExpectedOutput} matches ${approvalActualOutput} - PASS"
230+
output = new BuildHelper().compareFiles(approvalExpectedOutput, approvalActualOutput, true)
231+
println "exit from compare: ${output}"
232+
233+
if (output != 0) {
234+
println "*** FAIL ***"
235+
throw new StopExecutionException("${approvalExpectedOutput} and ${approvalActualOutput} are different")
236+
} else {
237+
println "${approvalExpectedOutput} matches ${approvalActualOutput} - PASS"
238+
}
232239
}
233240
}
234241

0 commit comments

Comments
 (0)