| The Gaudi Framework v28r2p1 (f1a77ff4)

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

## Constructor & Destructor Documentation

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

Definition at line 356 of file GaudiTest.py.

356 def __init__(self,ref,cause,result_key):
357 self.reference = ref
358 self.cause = cause
359 self.result_key = result_key
360
GaudiTest.BasicOutputValidator.__init__
def __init__(self, ref, cause, result_key)
Definition: GaudiTest.py:356
GaudiTest.BasicOutputValidator.result_key
result_key
Definition: GaudiTest.py:359
GaudiTest.BasicOutputValidator.cause
cause
Definition: GaudiTest.py:358
GaudiTest.BasicOutputValidator.reference
reference
Definition: GaudiTest.py:357

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

361 def __call__(self, out, result):
362 """Validate the output of the program.
363
364 'stdout' -- A string containing the data written to the standard output
365 stream.
366
367 'stderr' -- A string containing the data written to the standard error
368 stream.
369
370 'result' -- A 'Result' object. It may be used to annotate
371 the outcome according to the content of stderr.
372
373 returns -- A list of strings giving causes of failure."""
374
375 causes = []
376 # Check to see if theoutput matches.
377 if not self.__CompareText(out, self.reference):
378 causes.append(self.cause)
379 result[self.result_key] = result.Quote(self.reference)
380
381 return causes
382
GaudiTest.BasicOutputValidator.result_key
result_key
Definition: GaudiTest.py:359
GaudiTest.BasicOutputValidator.cause
cause
Definition: GaudiTest.py:358
GaudiTest.BasicOutputValidator.reference
reference
Definition: GaudiTest.py:357
GaudiTest.BasicOutputValidator.__call__
def __call__(self, out, result)
Definition: GaudiTest.py:361
GaudiTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: GaudiTest.py:383

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

383 def __CompareText(self, s1, s2):
384 """Compare 's1' and 's2', ignoring line endings.
385
386 's1' -- A string.
387
388 's2' -- A string.
389
390 returns -- True if 's1' and 's2' are the same, ignoring
391 differences in line endings."""
392
393 # The "splitlines" method works independently of the line ending
394 # convention in use.
395 if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
396 # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
397 to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
398 keep_line = lambda l: not to_ignore.match(l)
399 return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
400 else:
401 return s1.splitlines() == s2.splitlines()
402
GaudiTest.ROOT6WorkAroundEnabled
def ROOT6WorkAroundEnabled(id=None)
Definition: GaudiTest.py:25
GaudiTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: GaudiTest.py:383

## Member Data Documentation

GaudiTest.BasicOutputValidator.cause

Definition at line 358 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.reference

Definition at line 357 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.result_key

Definition at line 359 of file GaudiTest.py.

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

- GaudiPolicy/qmtest_classes/GaudiTest.py