mediawiki-extensions-AbuseF.../parser_native/runtests.sh

25 lines
431 B
Bash
Raw Normal View History

#! /bin/ksh
npass=0
nfail=0
ntotal=0
for test in *.t; do
2008-08-10 20:48:25 +00:00
printf "%-20s " "$test"
filter=$(head -1 $test)
2008-08-10 20:48:25 +00:00
vars=$(tail -n +2 $test)
expect=$(cat ${test%.t}.r)
result=$(../maketest "$filter" $vars | (cd ..; ./af_parser))
if [ "$expect" = "$result" ]; then
echo ...ok
npass=$((npass + 1))
else
echo ...FAIL
nfail=$((nfail + 1))
fi
ntotal=$((ntotal + 1))
done
echo "Ran $ntotal tests. PASS: $npass FAIL: $nfail"