diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..7d81ed5 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,55 @@ + +export SOURCE_PORT=/usr/games/chocolate-doom + +OUTPUTS=output/av.txt \ + output/cydreams.txt \ + output/d2twid.txt \ + output/eternal.txt \ + output/hr.txt \ + output/hr2.txt \ + output/mm.txt \ + output/mm2.txt \ + output/pl2.txt + +check: $(OUTPUTS) + diff -x .gitignore -ur output expected + +clean: + rm -rf $(OUTPUTS) + +output/av.txt: $(SOURCE_PORT) + ./testrunner pwads/av_new.zip demos/avall-41337.zip -- \ + -merge AV.WAD -timedemo 30av-25337.lmp >$@ + +output/cydreams.txt: $(SOURCE_PORT) + ./testrunner pwads/cydreams.zip demos/cyallx1904.zip -- \ + -deh Cyber110.deh -merge Cyber110.wad -timedemo 30cyx1904.lmp >$@ + +output/d2twid.txt: $(SOURCE_PORT) + ./testrunner pwads/d2twid.zip demos/30id-4525.zip -- \ + -merge D2TWID.wad -timedemo 30id-4525.lmp >$@ + +output/eternal.txt: $(SOURCE_PORT) + ./testrunner pwads/eternal.zip demos/etall-21854.zip -- \ + -merge ETERNALL.WAD -timedemo 30et-13854.lmp >$@ + +output/hr.txt: $(SOURCE_PORT) + ./testrunner pwads/hr.zip demos/hrall-4339.zip -- \ + -merge HR.WAD -timedemo HQR-4339.LMP >$@ + +output/hr2.txt: $(SOURCE_PORT) + ./testrunner pwads/hr2final.zip demos/h2all-22944.zip -- \ + -merge hr2final.wad -timedemo h2alls2-22944.lmp >$@ + +output/mm.txt: $(SOURCE_PORT) + ./testrunner pwads/mm_allup.zip demos/30mm8356.zip -- \ + -merge MM.WAD -timedemo 30mm8356.lmp >$@ + +output/mm2.txt: $(SOURCE_PORT) + ./testrunner pwads/mm2.zip demos/m2allo4938.zip -- \ + -merge MM2.WAD -timedemo mm2allnomo4938.lmp >$@ + +output/pl2.txt: $(SOURCE_PORT) + ./testrunner pwads/pl2.zip demos/p2all-6504.zip -- \ + -gameversion final -merge PL2.WAD -timedemo pl2all1.lmp >$@ + diff --git a/testrunner b/testrunner new file mode 100755 index 0000000..df01292 --- /dev/null +++ b/testrunner @@ -0,0 +1,37 @@ +#!/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 \ + "$@" >log.txt >>errs.txt || true + +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"