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
39 *' |'*) set -- sh -c "\$0 \$1 $3" "$@";;
40 *) set -- "$1" "$2" $3
43 if test -n "$regenerate"
47 echo "ok $test_count # skip $file.out"
51 elif test -e "$file.out"
53 "$@" 2>&1 | diffcmd "$file.out" -
56 echo "not ok $test_count - $name # TODO"
63 fail_count=$((fail_count+1))
67 echo "ok $test_count - $name"
71 if test $fail_count = 0
74 echo "# passed all $test_count test(s)"
77 echo "# failed $fail_count among $test_count test(s)"
78 fail_count=1 # exit code