2016-02-28 19:18:54 +00:00

24 lines
510 B
Bash
Executable File

#!/bin/sh
set -e
testdir=$tmp/tests
mkdir -p $testdir
touch $testdir/.urchin
testcase=$testdir/testcase
contents="$1"
expectation="$2"
# Set up the test suite.
echo "$contents" > $testcase
chmod +x $testcase
case "$expectation" in ok) regex='^ok 1 - testcase';;
not\ ok) regex='^not ok 1 - testcase';;
skip) regex='^ok 1 - testcase # SKIP';;
*) chmod -x $testcase;;
esac
# Run the test suite
../../urchin -n -t $testdir | grep "$regex"