quickcheck/testrunner
2019-11-11 19:40:20 -05:00

40 lines
706 B
Bash
Executable file

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