5daf496eb2a91b1ee916c16c8744fe9c3b2eaaf5
[barcat.git] / t / regress.t
1 #!/bin/sh
2
3 cd "${0%/*}" || exit 1
4
5 test_count=0
6
7 COLUMNS=40
8 diffcmd='diff --unchanged-line-format= --old-line-format=<%L --new-line-format=>%L'
9
10 for candidate in ${@:-t*.in}
11 do
12         test_count=$((test_count+1))
13         file="${candidate%.in}"
14         test -r "$file.in" || continue
15
16         name="$(echo ${file#*-} | tr _ \ )"
17         cmd="barcat $file.in"
18         case "$name" in *\ -*) cmd="$cmd -${name#* -}";; esac
19
20         $cmd 2>&1 | $diffcmd "$file.out" - || printf 'not '
21         echo "ok $test_count - $name"
22 done
23
24 echo "1..$test_count"