statcheck/testrunner

27 lines
580 B
Text
Raw Normal View History

2024-08-31 06:01:55 +00:00
#!/usr/bin/env python3
import os
from os.path import join
2024-08-31 06:01:55 +00:00
import shlex
import sys
from common import *
2024-08-31 06:01:55 +00:00
source_port = os.getenv("SOURCE_PORT")
assert source_port != "", "SOURCE_PORT environment variable not set."
2024-08-31 06:01:55 +00:00
lmp_file, out_file = sys.argv[1:]
cfg = read_config(lmp_file)
args = [
source_port, "-iwad", cfg["iwad"],
2024-08-31 06:01:55 +00:00
"-statdump", out_file,
"-timedemo", lmp_file,
2024-08-31 06:09:35 +00:00
] + shlex.split(os.getenv("DOOMOPTS", ""))
2024-08-31 06:01:55 +00:00
if "pwad" in cfg:
args.extend(("-file", join("extract", cfg["pwad"])))
print(shlex.join(args))
sys.stdout.close()
os.spawnvp(os.P_WAIT, args[0], args)