![]() |
|
|
Generated: 8 Jan 2009 |
Basic implementation of an option validator for Gaudi tests. This implementation is based on the standard (LCG) validation functions used in QMTest.
Definition at line 262 of file GaudiTest.py.
Public Member Functions | |
| def | __init__ |
| def | __call__ |
Public Attributes | |
| reference | |
| cause | |
| result_key | |
Private Member Functions | |
| def | __CompareText |
| def GaudiTest::BasicOutputValidator::__init__ | ( | self, | ||
| ref, | ||||
| cause, | ||||
| result_key | ||||
| ) |
Definition at line 267 of file GaudiTest.py.
00267 : 00268 self.reference = ref 00269 self.cause = cause 00270 self.result_key = result_key 00271 def __call__(self, out, result):
| def GaudiTest::BasicOutputValidator::__call__ | ( | self, | ||
| out, | ||||
| result | ||||
| ) |
Validate the output of the program. 'stdout' -- A string containing the data written to the standard output stream. 'stderr' -- A string containing the data written to the standard error stream. 'result' -- A 'Result' object. It may be used to annotate the outcome according to the content of stderr. returns -- A list of strings giving causes of failure.
Definition at line 272 of file GaudiTest.py.
00272 : 00273 """Validate the output of the program. 00274 00275 'stdout' -- A string containing the data written to the standard output 00276 stream. 00277 00278 'stderr' -- A string containing the data written to the standard error 00279 stream. 00280 00281 'result' -- A 'Result' object. It may be used to annotate 00282 the outcome according to the content of stderr. 00283 00284 returns -- A list of strings giving causes of failure.""" 00285 00286 causes = [] 00287 # Check to see if theoutput matches. 00288 if not self.__CompareText(out, self.reference): 00289 causes.append(self.cause) 00290 result[self.result_key] = result.Quote(self.reference) 00291 00292 return causes 00293 def __CompareText(self, s1, s2):
| def GaudiTest::BasicOutputValidator::__CompareText | ( | self, | ||
| s1, | ||||
| s2 | ||||
| ) | [private] |
Compare 's1' and 's2', ignoring line endings. 's1' -- A string. 's2' -- A string. returns -- True if 's1' and 's2' are the same, ignoring differences in line endings.
Definition at line 294 of file GaudiTest.py.
00294 : 00295 """Compare 's1' and 's2', ignoring line endings. 00296 00297 's1' -- A string. 00298 00299 's2' -- A string. 00300 00301 returns -- True if 's1' and 's2' are the same, ignoring 00302 differences in line endings.""" 00303 00304 # The "splitlines" method works independently of the line ending 00305 # convention in use. 00306 return s1.splitlines() == s2.splitlines() 00307 class FilePreprocessor:
Definition at line 268 of file GaudiTest.py.
Definition at line 269 of file GaudiTest.py.
Definition at line 270 of file GaudiTest.py.