ATLAS Offline Software
Loading...
Searching...
No Matches
doubleTestComp.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3import json
4import sys
5import os, os.path
6
7testStatus = int(os.environ["ATLAS_CTEST_TESTSTATUS"])
8if testStatus != 0:
9 print(f"Post evaluation: ERROR: previous step went wrong (exit code {testStatus})")
10 sys.exit(testStatus)
11
12if os.path.exists("NoDBConnection.txt"):
13 # in case we don't have a db connection we don't run this test
14 sys.exit(0)
15
16
17foundUnequal=False
18
19for ft in ["L1Menu", "L1Prescales", "Bunchgroups", "HLTMenu", "HLTPrescales"]:
20 with open("%s1.json" % ft, 'r') as fh1, open("%s2.json" % ft, 'r') as fh2:
21 j1 = json.load(fh1)
22 j2 = json.load(fh2)
23
24 if j1 == j2:
25 print(f"Post evaluation: Files {ft}1.json and {ft}2.json are identical")
26 else:
27 print(f"Post evaluation: ERROR: Files {ft}1.json and {ft}2.json are not identical !!")
28 foundUnequal = True
29
30if foundUnequal:
31 sys.exit(1)
32else:
33 sys.exit(0)
void print(char *figname, TCanvas *c1)