]>
git.saurik.com Git - apt.git/blob - triehash/tests/framework.sh
2 # Simple integration test framework
8 rm -f test.output
test.c
test.h
test.tree
14 cat "$@" | sed "s#^#\t#g"
28 [ "$INNER" ] || cleanup
29 [ "$INNER" ] || echo "Testing success of $@"
30 if ! "$@" > test.output
2>&1; then
31 echo "ERROR: Running $@ failed with error $?, messages were:" >&2
38 [ "$INNER" ] || cleanup
39 [ "$INNER" ] || echo "Testing failure of $@"
40 if "$@" > test.output
2>&1; then
41 echo "ERROR: Running $@ unexpectedly succeeded, messages were:" >&2
48 [ "$INNER" ] || echo "Testing output of $2"
49 printf "%b\n" "$1" > expected
50 if ! diff -u "expected" "$2" > test.
diff; then
51 echo "ERROR: Differences between expected output and and $2:" >&2
52 cat test.
diff | sed "s#^#\t#g"
59 [ "$INNER" ] || echo "Testing grep $@"
60 INNER
=1 testsuccess
grep "$@"
68 echo "Testing success and output of $@"
69 INNER
=1 testsuccess
"$@"
70 INNER
=1 testfileequal
"$expect" test.output
82 printf "%b\n" "$WORDS" | perl
-MDevel::Cover
=-summary,0,-silent,1 $(dirname $(dirname $(readlink -f $0)))/triehash.pl
"$@" || return $?