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 _ \ )"
36 set -- barcat "$file.in"
37 case "$name" in *\ -*) set -- "$@" "-${name#* -}";; esac
38 case "$name" in *' |'*) set -- sh -c "\$0 \$1 $3" "$@";; esac
40 if test -n "$regenerate"
44 echo "ok $test_count # skip $file.out"
48 elif test -e "$file.out"
50 "$@" 2>&1 | diffcmd "$file.out" -
53 echo "not ok $test_count - $name # TODO"
60 fail_count=$((fail_count+1))
64 echo "ok $test_count - $name"
68 if test $fail_count = 0
71 echo "# passed all $test_count test(s)"
74 echo "# failed $fail_count among $test_count test(s)"
75 fail_count=1 # exit code