1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/sh
set -e
# Switch to the test directory
cd $(dirname $0)
at_exit() {
echo "info: test exiting"
}
trap at_exit INT TERM EXIT
PROG="$AUTOPKGTEST_TMP/test-example-code-program"
c++ -Wall -Werror test-example-code.cc -lmstch -o "$PROG" 2>&1
if type valgrind > /dev/null 2>&1 ; then
VALGRIND="valgrind"
fi
if $VALGRIND "$PROG" | diff - test-example-code-expected.out; then
echo "success: program produced expected output"
else
echo "failure: program did not produce expected output"
fi
rm -f "$PROG"
|