Commit a1d201cd authored by Marco Clemencic's avatar Marco Clemencic
Browse files

simplified the call chain to GaudiTesting.BaseTest.ValidateOutput

removed the useless BaseTest.validator method, and changed the code
so that derived classes need to override ValidateOutput.
parent c6eca0af
......@@ -85,9 +85,6 @@ class BaseTest(object):
self.stack_trace = None
self.basedir = os.getcwd()
def validator(self, stdout='',stderr=''):
pass
def run(self):
logging.debug('running test %s', self.name)
......@@ -253,20 +250,11 @@ class BaseTest(object):
#-------------------------------------------------#
def ValidateOutput(self, stdout, stderr, result):
# checking if default validation or not
if self.validator is not BaseTest.validator:
self.validator(stdout, stderr, result, self.causes,
self.reference, self.error_reference)
else:
if self.stderr == '':
self.validateWithReference(stdout, stderr, result, causes)
elif stderr.strip() != self.stderr.strip():
self.causes.append('standard error')
return result, causes
if not self.stderr:
self.validateWithReference(stdout, stderr, result, self.causes)
elif stderr.strip() != self.stderr.strip():
self.causes.append('standard error')
return result, self.causes
def findReferenceBlock(self,reference=None, stdout=None, result=None, causes=None, signature_offset=0, signature=None, id = None):
"""
......
......@@ -73,39 +73,40 @@ class QMTTest(BaseTest):
return apply(self.callable, args, kwargs)
# local names to be exposed in the script
exported_symbols = {"self":self,
"stdout":stdout,
"stderr":stderr,
"result":result,
"causes":self.causes,
exported_symbols = {"self": self,
"stdout": stdout,
"stderr": stderr,
"result": result,
"causes": self.causes,
"findReferenceBlock":
CallWrapper(self.findReferenceBlock, {"stdout":stdout,
"result":result,
"causes":self.causes}),
CallWrapper(self.findReferenceBlock,
{"stdout": stdout,
"result": result,
"causes": self.causes}),
"validateWithReference":
CallWrapper(self.validateWithReference, {"stdout":stdout,
"stderr":stderr,
"result":result,
"causes":self.causes}),
CallWrapper(self.validateWithReference,
{"stdout": stdout,
"stderr": stderr,
"result": result,
"causes": self.causes}),
"countErrorLines":
CallWrapper(self.countErrorLines, {"stdout":stdout,
"result":result,
"causes":self.causes}),
CallWrapper(self.countErrorLines,
{"stdout": stdout,
"result": result,
"causes": self.causes}),
"checkTTreesSummaries":
CallWrapper(self.CheckTTreesSummaries, {"stdout":stdout,
"result":result,
"causes":self.causes}),
CallWrapper(self.CheckTTreesSummaries,
{"stdout": stdout,
"result": result,
"causes": self.causes}),
"checkHistosSummaries":
CallWrapper(self.CheckHistosSummaries, {"stdout":stdout,
"result":result,
"causes":self.causes})
CallWrapper(self.CheckHistosSummaries,
{"stdout": stdout,
"result": result,
"causes": self.causes})
}
#print self.validator
exec self.validator in globals(), exported_symbols
return result, self.causes
else:
if self.stderr == '':
self.validateWithReference(stdout, stderr, result, self.causes)
elif stderr.strip() != self.stderr.strip():
self.causes.append('standard error')
return result, self.causes
return super(QMTTest, self).ValidateOutput(stdout, stderr, result)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment