diff options
Diffstat (limited to 'cmd')
| -rwxr-xr-x | cmd/lulu/test | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd/lulu/test b/cmd/lulu/test index 3aacc99..3a98d91 100755 --- a/cmd/lulu/test +++ b/cmd/lulu/test @@ -10,21 +10,20 @@ export money='[0-9]+(\.[0-9]+)? [A-Z]{3}' export pkgid='[0-9]{4}X[0-9]{4}\.[A-Z]{2}\.[A-Z]{3}\.[A-Z]{2}\.[A-Z0-9]{5,8}\.[A-Z]{3}' export time='[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z' - - -[[ ! -d testout ]] && mkdir testout -[[ ! -d testerr ]] && mkdir testerr +[[ -d testout ]] || mkdir testout +[[ -d testerr ]] || mkdir testerr [[ $# -gt 0 ]] && tests="tests/$1" || tests=tests/* for test in $tests do - echo $test... + echo $test base=${test##*/} want=testdata/$base check=testchecks/$base out=testout/$base err=testerr/$base - if [ -f $want ]; then # check against expected output + if [ -f $want ] + then # check against expected output if ! sh ${flags} $test >$out 2>$err then echo "FAIL $test: error: $err" @@ -36,7 +35,8 @@ do diff $want $out exit 1 fi - elif [ -f $check ]; then # use script to check output + elif [ -f $check ] + then # use script to check output if ! sh ${flags} $test >$out 2>$err then echo "FAIL $test: error: $err" @@ -48,7 +48,8 @@ do echo "FAIL $test: check failed: $check" exit 1 fi - elif [ -f $test ]; then # test should fail + elif [ -f $test ] + then # test should fail if sh ${flags} $test >$out 2>$err then echo "FAIL $test: expected error; got \"$(cat $out)\"" |