DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
fddetdataformats_binding_tests.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
3import subprocess
4import sys
5from pathlib import Path
6
7
8def run_script(script_dir: Path, script_name: str) -> int:
9 script_path = script_dir / script_name
10 if not script_path.exists():
11 print(f"MISSING: {script_name}")
12 return 1
13
14 print(f"\n=== Running {script_name} ===")
15 result = subprocess.run([sys.executable, str(script_path)], check=False)
16 return result.returncode
17
18
19def main() -> int:
20 script_dir = Path(__file__).resolve().parent
21
22 scripts = [
23 "TDEEth_binding_test.py",
24 "DAPHNE_binding_test.py",
25 "DAPHNEStream_binding_test.py",
26 "DAPHNEEth_binding_test.py",
27 "DAPHNEEthStream_binding_test.py",
28 "WIBEth_binding_test.py",
29 ]
30
31 failures = 0
32 for script in scripts:
33 failures += 1 if run_script(script_dir, script) != 0 else 0
34
35 print("\n=== Summary ===")
36 if failures == 0:
37 print("All fddetdataformats binding tests passed")
38 else:
39 print(f"{failures} binding test script(s) failed")
40
41 return failures
42
43
44if __name__ == "__main__":
45 sys.exit(main())
int run_script(Path script_dir, str script_name)