diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-05-18 14:06:23 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-05-18 14:07:00 +1200 |
commit | 19d133f4a6b2be47e7266264017a67061e3eff31 (patch) | |
tree | f053189de228296219043115f8019b11c621178e /test/test.sh | |
parent | 11608a72784bc821d0acbaabfb00fcb652bf40f2 (diff) | |
download | pgm-interlace-19d133f4a6b2be47e7266264017a67061e3eff31.tar.xz |
Testing: Add expectations on stderr for error cases
Diffstat (limited to 'test/test.sh')
-rwxr-xr-x | test/test.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh index 6ca0d41..d916a5b 100755 --- a/test/test.sh +++ b/test/test.sh @@ -2,18 +2,18 @@ fail() { - echo -e '[\e[1;31mFAIL\e[0m] '$i + echo -e '[\e[1;31mFAIL\e[0m] '$i $@ } xfail() { - echo -e '[\e[1;35mXFAIL\e[0m] '$i + echo -e '[\e[1;35mXFAIL\e[0m] '$i $@ } pass() { - echo -e '[\e[0;32mPASS\e[0m] '$i + echo -e '[\e[0;32mPASS\e[0m] '$i $@ } ######################### @@ -30,12 +30,16 @@ for i in {pass,error,xfail}/*.sh ; do expected="$name.pgm.expected" out="$name.pgm.out" log="$name.stderr.log" + log_expected="$log.expected" ./$(basename $i) 2> "$log" result=$? if [ -f "$expected" ] ; then diff "$expected" "$out" result=$? fi + if [ -f "$log_expected" ] ; then + diff "$log_expected" "$log" || fail stderr doesn\'t match + fi case $test_type in pass) if [ $result -eq 0 ] ; then @@ -64,6 +68,6 @@ for i in {pass,error,xfail}/*.sh ; do ;; esac - rm -f "$out" "$log" + rm -f "$out" # "$log" popd > /dev/null done |