20
20
# pylint: disable=E1101
24
import xboa.test.XBOATest
26
27
class TestXBOA(unittest.TestCase): # pylint: disable=R0904
28
29
Run the tests and check they return 0
31
def setUp(self): # pylint: disable = C0103
32
"""Set up; skip if no xboa installs found"""
34
self._get_test_target()
35
if self.xboa_test == None:
36
raise unittest.SkipTest("No xboa installed in third party")
38
def _get_test_target(self):
40
Look for xboa versions in third_party/build of *this* MAUS install;
41
if none found, return, else set self.xboa_test to the most recent
42
version (as determined by folder name)
44
xboa_path = os.path.expandvars(
45
"${MAUS_ROOT_DIR}/third_party/build/*xboa*")
46
xboa_installs = glob.glob(xboa_path)
47
if len(xboa_installs) == 0:
48
# we only run tests if xboa is installed in this setup (rather than
49
# installed from somewhere else)
52
# this loop is supposed to test on the most recent version of xboa
53
# installed in case of multiple versions; or a dev version if it
55
xboa_installs = sorted(xboa_installs)
56
for self.xboa_test in xboa_installs:
57
if "dev" in self.xboa_test:
35
ROOT.gROOT.SetBatch(True) #pylint: disable=E1101
36
# xboa v0.15.3 does not have a test_all
37
# calling test_old() instead to get pylint tests to pass through
39
# passes, fails, warns = xboa.test.XBOATest.test_all()
40
passes, fails, warns = xboa.test.XBOATest.test_old()
41
self.assertEqual(fails, 0, msg = str((passes, fails, warns)))
42
ROOT.gROOT.SetBatch(False) #pylint: disable=E1101
64
os.chdir(self.xboa_test+"/test")
65
subprocess.check_output(["python", "XBOATest.py"])
44
68
if __name__ == "__main__":