quickcheck/testrunner

38 lines
687 B
Text
Raw Normal View History

2019-11-11 23:17:57 +00:00
#!/bin/bash
set -eu
tmp=$(mktemp -d)
ORIGDIR=$PWD
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
rm -rf "$tmp"
fi
shift
SDL_VIDEODRIVER=dummy
export SDL_VIDEODRIVER
$SOURCE_PORT -iwad miniwad.wad \
-mb 32 \
-nodraw -noblit -nosound -noautoload -nogui -nograbmouse \
-statdump statdump.txt \
2019-11-12 00:24:17 +00:00
"$@" >log.txt 2>errs.txt || true
2019-11-11 23:17:57 +00:00
if [ ! -e statdump.txt ]; then
(echo "No statdump output produced.";
cat log.txt; cat errs.txt) >/dev/stderr
else
cat statdump.txt
fi
rm -rf "$tmp"