2000-10-27 04:46:04 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
fail ()
|
|
|
|
{
|
|
|
|
echo "Test failed: $*"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2004-06-08 04:29:16 +02:00
|
|
|
echo_v ()
|
|
|
|
{
|
|
|
|
if [ "$verbose" = "1" ]; then
|
|
|
|
echo "$*"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
error_out=/dev/null
|
|
|
|
if [ "$1" = "-v" ]; then
|
|
|
|
verbose=1
|
|
|
|
error_out=/dev/stderr
|
|
|
|
fi
|
2005-01-24 18:35:44 +01:00
|
|
|
for I in ${srcdir:-.}/markups/fail-*.gmarkup; do
|
2004-06-08 04:29:16 +02:00
|
|
|
echo_v "Parsing $I, should fail"
|
|
|
|
./markup-test $I > /dev/null 2> $error_out && fail "failed to generate error on $I"
|
2002-05-19 00:06:54 +02:00
|
|
|
if test "$?" != "1"; then
|
|
|
|
fail "unexpected error on $I"
|
|
|
|
fi
|
2000-10-27 04:46:04 +02:00
|
|
|
done
|
|
|
|
|
2005-01-24 18:35:44 +01:00
|
|
|
for I in ${srcdir:-.}/markups/valid-*.gmarkup; do
|
2004-06-08 04:29:16 +02:00
|
|
|
echo_v "Parsing $I, should succeed"
|
|
|
|
./markup-test $I > /dev/null 2> $error_out || fail "failed on $I"
|
2000-10-27 04:46:04 +02:00
|
|
|
done
|
|
|
|
|
2004-06-08 04:29:16 +02:00
|
|
|
echo_v "All tests passed."
|