1+ #! /bin/bash
2+ #
3+ # Nazi Zombies: Portable
4+ # QuakeC Round 100 test runs on every bundled map.
5+ # ----
6+ # This is intended to be used via a Docker
7+ # container running ubuntu:24.10.
8+ #
9+ set -o errexit
10+
11+ # tzdata will try to display an interactive install prompt by
12+ # default, so make sure we define our system as non-interactive.
13+ export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
14+
15+ WORKING_DIRECTORY=" /working"
16+ OUTPUT_LOG=" ${WORKING_DIRECTORY} /run.log"
17+ REPO_PWD=$( pwd)
18+
19+ function setup_container()
20+ {
21+ echo " [INFO]: Installing dependancies.."
22+ apt update -y
23+ apt install libsdl2-dev wget zip python3 python3-pip -y
24+ wget https://raw.githubusercontent.com/nzp-team/QCHashTableGenerator/main/requirements.txt
25+ pip install -r requirements.txt --break-system-packages
26+ rm requirements.txt
27+ mkdir -p " ${WORKING_DIRECTORY} "
28+ }
29+
30+ function download_nzp()
31+ {
32+ echo " [INFO]: Obtaining latest Nazi Zombies: Portable Linux x86_64 release.."
33+ cd " ${WORKING_DIRECTORY} "
34+ wget https://github.com/nzp-team/nzportable/releases/download/nightly/nzportable-linux64.zip
35+ mkdir nzportable-linux64
36+ unzip nzportable-linux64.zip -d nzportable-linux64/
37+ chmod +x nzportable-linux64/nzportable64-sdl
38+ }
39+
40+ function build_quakec()
41+ {
42+ echo " [INFO]: Building QuakeC.."
43+ cd " ${REPO_PWD} /tools"
44+ local cmd=" ./qc-compiler-gnu.sh"
45+ ${cmd}
46+
47+ echo " [INFO]: Moving QuakeC to game download.."
48+ cp " ${REPO_PWD} /build/fte/qwprogs.dat" " ${WORKING_DIRECTORY} /nzportable-linux64/nzp/"
49+ }
50+
51+ function run_test()
52+ {
53+ echo " [INFO]: Running tests.."
54+ cd " ${WORKING_DIRECTORY} /nzportable-linux64/"
55+
56+ # Iterate through every map..
57+ while read -r map; do
58+ local pretty_name=$( basename ${map} .bsp)
59+ echo " [INFO]: Running [${pretty_name} ].."
60+
61+ local cmd=" ./nzportable64-sdl +map ${pretty_name} +vid_renderer headless +sys_testmode 2 +slowmo 100"
62+ ${cmd}
63+ done < <( find nzp/maps/ -type f -name " *.bsp" )
64+
65+ echo " [INFO]: TEST PASSED."
66+ }
67+
68+ function main()
69+ {
70+ setup_container;
71+ download_nzp;
72+ build_quakec;
73+ run_test;
74+ }
75+
76+ main;
0 commit comments