Skip to content
Snippets Groups Projects
Commit 7f14dda8 authored by Benedikt Hegner's avatar Benedikt Hegner
Browse files

Merge branch 'QMTestObjects' into 'master'

Allowed to inherit from default QMTTest object

See merge request !360
parents c57e72d6 f5286a84
No related branches found
No related tags found
1 merge request!360Allowed to inherit from default QMTTest object
Pipeline #
...@@ -142,9 +142,18 @@ def main(): ...@@ -142,9 +142,18 @@ def main():
fileToExec = imp.Test() fileToExec = imp.Test()
results = fileToExec.run() results = fileToExec.run()
elif filename.endswith(".qmt"): elif filename.endswith(".qmt"):
from QMTTest import QMTTest # Check which class should be used to instantiate QMTests
fileToTest = QMTTest(filename) # by default it is QMTTest but this can be overwritten via the environment
results = fileToTest.run() try:
test_module = os.environ.get('GAUDI_QMTEST_MODULE', 'GaudiTesting.QMTTest')
test_class = os.environ.get('GAUDI_QMTEST_CLASS', 'QMTTest')
exec 'from {} import {} as test_class'.format(test_module, test_class)
fileToTest = test_class(filename)
results = fileToTest.run()
except Exception, e:
logging.error('Exception caught when trying to instantiate qmt test python object')
logging.error(e)
return 1
report = globals()[opts.report + '_report'] report = globals()[opts.report + '_report']
report(results) report(results)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment