| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Private Member Functions | List of all members
GaudiTest.BasicOutputValidator Class Reference

Output Validation Classes. More...

## Public Member Functions
def | __init__ (self, ref, cause, result_key)
def | __call__ (self, out, result)

## Public Attributes
| reference
| cause
| result_key

## Private Member Functions
def | __CompareText (self, s1, s2)

## Detailed Description

Output Validation Classes.

    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 374 of file GaudiTest.py.

## Constructor & Destructor Documentation

def GaudiTest.BasicOutputValidator.__init__ | ( |  | self,
|  |  | ref,
|  |  | cause,
|  |  | result_key
| ) |  |

Definition at line 380 of file GaudiTest.py.

380 def __init__(self, ref, cause, result_key):
381 self.reference = ref
382 self.cause = cause
383 self.result_key = result_key
384
GaudiTest.BasicOutputValidator.__init__
def __init__(self, ref, cause, result_key)
Definition: GaudiTest.py:380
GaudiTest.BasicOutputValidator.result_key
result_key
Definition: GaudiTest.py:383
GaudiTest.BasicOutputValidator.cause
cause
Definition: GaudiTest.py:382
GaudiTest.BasicOutputValidator.reference
reference
Definition: GaudiTest.py:381

## Member Function Documentation

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 385 of file GaudiTest.py.

385 def __call__(self, out, result):
386 """Validate the output of the program.
387
388 'stdout' -- A string containing the data written to the standard output
389 stream.
390
391 'stderr' -- A string containing the data written to the standard error
392 stream.
393
394 'result' -- A 'Result' object. It may be used to annotate
395 the outcome according to the content of stderr.
396
397 returns -- A list of strings giving causes of failure."""
398
399 causes = []
400 # Check to see if theoutput matches.
401 if not self.__CompareText(out, self.reference):
402 causes.append(self.cause)
403 result[self.result_key] = result.Quote(self.reference)
404
405 return causes
406
GaudiTest.BasicOutputValidator.result_key
result_key
Definition: GaudiTest.py:383
GaudiTest.BasicOutputValidator.cause
cause
Definition: GaudiTest.py:382
GaudiTest.BasicOutputValidator.reference
reference
Definition: GaudiTest.py:381
GaudiTest.BasicOutputValidator.__call__
def __call__(self, out, result)
Definition: GaudiTest.py:385
GaudiTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: GaudiTest.py:407

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 407 of file GaudiTest.py.

407 def __CompareText(self, s1, s2):
408 """Compare 's1' and 's2', ignoring line endings.
409
410 's1' -- A string.
411
412 's2' -- A string.
413
414 returns -- True if 's1' and 's2' are the same, ignoring
415 differences in line endings."""
416
417 # The "splitlines" method works independently of the line ending
418 # convention in use.
419 if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
420 # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
421 to_ignore = re.compile(
422 r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
423
424 def keep_line(l): return not to_ignore.match(l)
425 return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
426 else:
427 return s1.splitlines() == s2.splitlines()
428
429
GaudiTest.ROOT6WorkAroundEnabled
def ROOT6WorkAroundEnabled(id=None)
Definition: GaudiTest.py:25
GaudiTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: GaudiTest.py:407

## Member Data Documentation

GaudiTest.BasicOutputValidator.cause

Definition at line 382 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.reference

Definition at line 381 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.result_key

Definition at line 383 of file GaudiTest.py.

The documentation for this class was generated from the following file:

- GaudiPolicy/qmtest_classes/GaudiTest.py