Changeset 11127 in ntrip for trunk/BNC/tests/run_tests.py
- Timestamp:
- Oct 24, 2026, 11:15:22 PM (32 hours ago)
- File:
-
- 1 edited
-
trunk/BNC/tests/run_tests.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/tests/run_tests.py
r11069 r11127 30 30 {"dir" (subdirectory of the work dir), "config", "raw" 31 31 (relative to the work dir), "args", "exit_code", "timeout"}; 32 outputs may refer to their files as "<dir>/Output/..." 32 outputs may refer to their files as "<dir>/Output/..."; 33 instead of a BNC run, {"dir", "tool": [script in tools/, args]} 34 runs a Python tool in the work directory, stdout to <dir>/stdout.txt 33 35 34 36 BNC runs in tests/work/<name>/, which contains an "Input" symlink to … … 178 180 179 181 182 def run_tool(work, spec): 183 """Run tools/<script> with args in the work directory, stdout to 184 <dir>/stdout.txt. Returns the exit code or None on timeout.""" 185 outdir = os.path.join(work, spec["dir"]) 186 os.makedirs(outdir, exist_ok=True) 187 cmd = [sys.executable, "-I", os.path.join(TESTS, "tools", spec["tool"][0])] + spec["tool"][1:] 188 with open(os.path.join(outdir, "stdout.txt"), "wb") as out: 189 try: 190 return subprocess.run(cmd, cwd=work, stdout=out, stderr=subprocess.STDOUT, 191 timeout=spec.get("timeout", 600)).returncode 192 except subprocess.TimeoutExpired: 193 return None 194 195 180 196 def run_case(name, bnc, update): 181 197 res = Result(name) … … 217 233 # in its own subdirectory of the work directory, raw relative to work/ 218 234 for post in case.get("post", []): 219 pcode = run_bnc(bnc, os.path.join(work, post["dir"]), post, work) 235 if "tool" in post: 236 pcode = run_tool(work, post) 237 else: 238 pcode = run_bnc(bnc, os.path.join(work, post["dir"]), post, work) 220 239 if pcode is None or pcode != post.get("exit_code", 0): 221 240 res.fail("post step %s: exit code %s" % (post["dir"], pcode)) … … 250 269 expfile = os.path.join(expdir, ref + ".gz") 251 270 if update: 271 if spec.get("debug_trace") and not actual.strip() and os.path.exists(expfile): 272 # build without BNC_DEBUG_SSR: keep the existing trace reference 273 written.add(os.path.basename(expfile)) 274 res.skip("%s: no BNC_DEBUG_SSR trace in this build, reference kept" % ref) 275 continue 252 276 write_expected(expfile, actual) 253 277 written.add(os.path.basename(expfile))
Note:
See TracChangeset
for help on using the changeset viewer.
