| 1 | #!/bin/sh |
| 2 | # Diff a test result against the reference log |
| 3 | # |
| 4 | # The reference log is in $T3_LOG |
| 5 | # The result file to compare is in $T3_OUT |
| 6 | # |
| 7 | # We'll store a .diff or a .succ file in $T3_OUT based on the result |
| 8 | |
| 9 | # clean up any old success/difference files we have hanging around |
| 10 | rm -f $T3_OUT/$1.succ |
| 11 | rm -f $T3_OUT/$1.diff |
| 12 | |
| 13 | if [ ! -f $T3_OUT/$1.log ]; then |
| 14 | echo 'Output file $T3_OUT/$1.log not created - test failed' > $T3_OUT/$1.diff |
| 15 | exit |
| 16 | fi |
| 17 | |
| 18 | diff $T3_OUT/$1.log $T3_LOG/$1.log > $T3_OUT/$1.diff |
| 19 | if [ $? = "0" ]; then |
| 20 | # test was successful, create the .succ file and remove .log and .diff |
| 21 | echo Success > $T3_OUT/$1.succ |
| 22 | rm $T3_OUT/$1.log |
| 23 | rm $T3_OUT/$1.diff |
| 24 | fi |