cfad47cfa3/t3compiler/testscripts/test_diff

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