From c8824b131a41552970abd70d4533acb5f54723c0 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 5 Oct 2023 19:21:47 -0400 Subject: [PATCH] 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. --- GNUmakefile | 158 +++++++++++++++++++++++++++++++-------------- extract/.gitignore | 1 + testrunner | 26 ++------ 3 files changed, 119 insertions(+), 66 deletions(-) create mode 100644 extract/.gitignore diff --git a/GNUmakefile b/GNUmakefile index 1ee4f3c..b8b125f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,55 +1,119 @@ 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 +# Quiet output, convert to lower case, don't restore timestamps, +# overwrite without prompt, extract to extract/ directory. +UNZIPOPTS = -q -LL -DD -o -d extract + +OUTPUTS = +WADS = extract/miniwad.wad + +all: check + +extract/%: + unzip $(UNZIPOPTS) $< $(subst extract/,,$@) + +extract/miniwad.wad: miniwad.zip +testrunner: $(SOURCE_PORT) extract/miniwad.wad + +# Alien Vendetta, Ancalagon 4:13:37 +extract/av.wad: pwads/av_new.zip +extract/30av-25337.lmp: demos/avall-41337.zip + +output/av.txt: testrunner extract/av.wad extract/30av-25337.lmp + ./testrunner -merge av.wad -timedemo extract/30av-25337.lmp >$@ + +WADS += extract/av.wad +OUTPUTS += output/av.txt + +# Cyberdreams, SuperWeaponDude 19:04 +extract/cyber110.wad: pwads/cydreams.zip +extract/cyber110.deh: pwads/cydreams.zip +extract/30cyx1904.lmp: demos/cyallx1904.zip + +output/cydreams.txt: testrunner extract/cyber110.wad extract/cyber110.deh extract/30cyx1904.lmp + ./testrunner -deh cyber110.deh -merge cyber110.wad -timedemo extract/30cyx1904.lmp >$@ + +WADS += extract/cyber110.wad +OUTPUTS += output/cydreams.txt + +# Doom 2 The Way Id Did, William "crate" Striegl 45:25 +extract/d2twid.wad: pwads/d2twid.zip +extract/30id-4525.lmp: demos/30id-4525.zip + +output/d2twid.txt: testrunner extract/d2twid.wad extract/30id-4525.lmp + ./testrunner -nodehlump -merge d2twid.wad -timedemo extract/30id-4525.lmp >$@ + +WADS += extract/d2twid.wad +OUTPUTS += output/d2twid.txt + +# Eternal Doom, ELMLE 2:18:54 +extract/eternall.wad: pwads/eternal.zip +extract/30et-13854.lmp: demos/etall-21854.zip + +output/eternal.txt: testrunner extract/eternall.wad extract/30et-13854.lmp + ./testrunner -merge eternall.wad -timedemo extract/30et-13854.lmp >$@ + +WADS += extract/eternall.wad +OUTPUTS += output/eternal.txt + +# Hell Revealed, Yonatan Donner/Haggay Niv 43:39 +extract/hr.wad: pwads/hr.zip +extract/hqr-4339.lmp: demos/hrall-4339.zip + +output/hr.txt: testrunner extract/hr.wad extract/hqr-4339.lmp + ./testrunner -merge hr.wad -timedemo extract/hqr-4339.lmp >$@ + +WADS += extract/hr.wad +OUTPUTS += output/hr.txt + +# Hell Revealed 2, tchkb 2:29:44 +extract/hr2final.wad: pwads/hr2final.zip +extract/h2alls2-22944.lmp: demos/h2all-22944.zip + +output/hr2.txt: testrunner extract/hr2final.wad extract/h2alls2-22944.lmp + ./testrunner -merge hr2final.wad -timedemo extract/h2alls2-22944.lmp >$@ + +WADS += extract/hr2final.wad +OUTPUTS += output/hr2.txt + +# Memento Mori, stx-Vile 83:56 +extract/mm.wad: pwads/mm_allup.zip +extract/30mm8356.lmp: demos/30mm8356.zip + +output/mm.txt: testrunner extract/mm.wad extract/30mm8356.lmp + ./testrunner -merge mm.wad -timedemo extract/30mm8356.lmp >$@ + +WADS += extract/mm.wad +OUTPUTS += output/mm.txt + +# Memento Mori 2, Cyberdemon531 49:38 +extract/mm2.wad: pwads/mm2.zip +extract/mm2allnomo4938.lmp: demos/m2allo4938.zip + +output/mm2.txt: testrunner extract/mm2.wad extract/mm2allnomo4938.lmp + ./testrunner -merge mm2.wad -timedemo extract/mm2allnomo4938.lmp >$@ + +WADS += extract/mm2.wad +OUTPUTS += output/mm2.txt + +# Plutonia 2, Red-XIII 1:05:04 +extract/pl2.wad: pwads/pl2.zip +extract/pl2all1.lmp: demos/p2all-6504.zip + +output/pl2.txt: testrunner extract/pl2.wad extract/pl2all1.lmp + ./testrunner -gameversion final -merge pl2.wad -timedemo extract/pl2all1.lmp >$@ + +WADS += extract/pl2.wad +OUTPUTS += output/pl2.txt + + +wads: $(WADS) check: $(OUTPUTS) - diff -x .gitignore -ur expected output + @diff -x .gitignore -ur expected output && echo all tests passed 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 -- \ - -nodehlump -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 >$@ + rm -rf output/* extract/* +.PHONY: wads check clean all diff --git a/extract/.gitignore b/extract/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/extract/.gitignore @@ -0,0 +1 @@ +* diff --git a/testrunner b/testrunner index 4cf0c2f..9ee06c1 100755 --- a/testrunner +++ b/testrunner @@ -9,32 +9,20 @@ cleanup() { } trap cleanup EXIT -cd "$tmp" -unzip -oq "$ORIGDIR/miniwad.zip" +export SDL_VIDEODRIVER=dummy -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 +export DOOMWADDIR=$PWD/extract $SOURCE_PORT -iwad miniwad.wad \ -mb 24 \ -nodraw -noblit -nosound -noautoload -nogui -nograbmouse \ - -statdump statdump.txt \ - "$@" >log.txt 2>&1 || true + -statdump $tmp/statdump.txt \ + "$@" >$tmp/log.txt 2>&1 || true -if [ ! -e statdump.txt ]; then - (echo "No statdump output produced."; cat log.txt) >/dev/stderr +if [ ! -e $tmp/statdump.txt ]; then + (echo "No statdump output produced."; cat $tmp/log.txt) >/dev/stderr exit 1 else - cat statdump.txt + cat $tmp/statdump.txt fi