Debian Codegraph @

terps/tads/tads3/win32/test/testdiff.bat

raw
1 @echo off
2 @rem Diff a test result against the reference log
3 @rem
4 @rem The reference log is in the %tstlog% directory
5 @rem The result file to compare is in the %tstout% directory
6 @rem
7 @rem We'll store a .DIF or a .SUC file in the %tstout% directory
8 @rem based on the result
9 @rem
10 @rem -bin option: compare files with names %1.bin, write to %1-bin.suc/.dif
11
12 rem presume the diff output file will be %1.suc or %1.dif
13 set testDiffOut=%1
14 set testDiffLog=%1.log
15
16 rem check for -bin option
17 if not %1# == -bin# goto noBinOpt
18 shift
19 set testDiffOut=%1.bin
20 set testDiffLog=%1.bin
21
22 :noBinOpt
23
24 rem clean up any old success/difference files we have hanging around
25 if exist %tstout%\%testDiffOut%.suc del %tstout%\%testDiffOut%.suc
26 if exist %tstout%\%testDiffOut%.dif del %tstout%\%testDiffOut%.dif
27
28 if exist %tstout%\%testDiffLog% goto do_diff
29
30 echo Output file %tstout%\%testDiffLog% not created - test failed > %tstout%\%testDiffOut%.dif
31 goto done
32
33 :do_diff
34 rem diff the new file against the reference log
35 gdiff %tstout%\%testDiffLog% %tstlog%\%testDiffLog% > %tstout%\%testDiffOut%.dif
36 if errorlevel 1 goto hasdiffs
37
38 rem success
39 echo Success > %tstout%\%testDiffOut%.suc
40 del %tstout%\%testDiffLog%
41 del %tstout%\%testDiffOut%.dif
42 goto done
43
44 :hasdiffs
45 rem failure - leave the .LOG and .DIF files in place
46
47 :done
48