aboutsummaryrefslogtreecommitdiffstats
path: root/filters/test.sh
blob: 65a1d4d3a179ac33a381ce3eed7c673779569361 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

here=$(dirname $0)
fail=0

for vec in $here/vectors/*.in; do
	tool=$(basename $vec | sed 's/-.*//')
	expected=${vec%%.in}.expected
	tmp=$(mktemp)
	if ! $FILTERS_TEST_PREFIX $here/../$tool -f $vec > $tmp; then
		fail=1
	fi
	if diff -u "$expected" "$tmp"; then
		echo "ok      $tool < $vec > $tmp"
	else
		echo "error   $tool < $vec > $tmp"
		fail=1
	fi
	rm -f -- "$tmp"
done

exit $fail