quickcheck/testrunner
Simon Howard c8824b131a Rewrite to make better use of make.
Instead of having the test runner do the extraction, make can do it for
us. This allows for better parallelization. It also lets the WADs be
extracted separately (and potentially modified) before the tests are
run; I'm planning to reuse this for wadptr so that I can test WADs play
back as intended after being compressed.
2023-10-05 19:21:47 -04:00

28 lines
524 B
Bash
Executable file

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