quickcheck/testrunner

29 lines
524 B
Text
Raw Normal View History

2019-11-11 23:17:57 +00:00
#!/bin/bash
set -eu
ORIGDIR=$PWD
tmp=$(mktemp -d)
cleanup() {
rm -rf "$tmp"
}
trap cleanup EXIT
2019-11-11 23:17:57 +00:00
export SDL_VIDEODRIVER=dummy
2019-11-11 23:17:57 +00:00
export DOOMWADDIR=$PWD/extract
2019-11-11 23:17:57 +00:00
$SOURCE_PORT -iwad miniwad.wad \
-mb 24 \
2019-11-11 23:17:57 +00:00
-nodraw -noblit -nosound -noautoload -nogui -nograbmouse \
-statdump $tmp/statdump.txt \
"$@" >$tmp/log.txt 2>&1 || true
2019-11-11 23:17:57 +00:00
if [ ! -e $tmp/statdump.txt ]; then
(echo "No statdump output produced."; cat $tmp/log.txt) >/dev/stderr
exit 1
2019-11-11 23:17:57 +00:00
else
cat $tmp/statdump.txt
2019-11-11 23:17:57 +00:00
fi