10 test -t 1 && colorize=1
12 test -n "$colorize" &&
17 comm --nocheck-order --output-delimiter=::: -3 $@ |
18 perl -pe"END{exit !!\$.} s/^:::/$(color 31)>/ || s/^/$(color 32)</"
24 -G) regenerate=1 && shift;;
25 -*) echo "Usage: $0 [-G] [<files>...]"; exit 64;;
29 for candidate in ${@:-t*.in}
31 test_count=$((test_count+1))
32 file="${candidate%.in}"
33 test -r "$file.in" || continue
35 name="$(echo ${file#*-} | tr _ \ )"
37 case "$name" in *\ -*) cmd="$cmd -${name#* -}";; esac
39 if test -n "$regenerate"
43 echo "ok $test_count # skip $file.out"
48 if test -e $file.sh; then $cmd 2>&1 | ./$file.sh; fi &&
49 if test -e $file.out; then $cmd 2>&1 | diffcmd "$file.out" -; fi
54 fail_count=$((fail_count+1))
58 echo "ok $test_count - $name"
62 if test $fail_count = 0
65 echo "# passed all $test_count test(s)"
68 echo "# failed $fail_count among $test_count test(s)"
69 fail_count=1 # exit code