e594c724ee
- Simplify regress.sh, sort tests.
38 lines
705 B
Bash
38 lines
705 B
Bash
# $FreeBSD$
|
|
|
|
echo '1..42'
|
|
|
|
COUNTER=1
|
|
|
|
do_test() {
|
|
local c
|
|
c=${COUNTER}
|
|
COUNTER=$((COUNTER+1))
|
|
sh $1 > tmp.stdout 2> tmp.stderr
|
|
if [ $? -ne $2 ]; then
|
|
echo "not ok ${c} - ${1} # wrong exit status"
|
|
rm tmp.stdout tmp.stderr
|
|
return
|
|
fi
|
|
for i in stdout stderr; do
|
|
if [ -f ${1}.${i} ]; then
|
|
if ! cmp -s tmp.${i} ${1}.${i}; then
|
|
echo "not ok ${c} - ${1} # wrong output on ${i}"
|
|
rm tmp.stdout tmp.stderr
|
|
return
|
|
fi
|
|
elif [ -s tmp.${i} ]; then
|
|
echo "not ok ${c} - ${1} # wrong output on ${i}"
|
|
rm tmp.stdout tmp.stderr
|
|
return
|
|
fi
|
|
done
|
|
echo "ok ${c} - ${1}"
|
|
rm tmp.stdout tmp.stderr
|
|
}
|
|
|
|
TESTS=$(find -s . -name "*.[01]")
|
|
for i in ${TESTS} ; do
|
|
do_test ${i} ${i##*.}
|
|
done
|