| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
def | __call__

## Public Attributes
| reference
| cause
| result_key

## Private Member Functions
def | __CompareText

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

## Constructor & Destructor Documentation

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

Definition at line 354 of file GaudiTest.py.

354
355 def __init__(self,ref,cause,result_key):
356 self.reference = ref
357 self.cause = cause
358 self.result_key = result_key

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

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

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

381
382 def __CompareText(self, s1, s2):
383 """Compare 's1' and 's2', ignoring line endings.
384
385 's1' -- A string.
386
387 's2' -- A string.
388
389 returns -- True if 's1' and 's2' are the same, ignoring
390 differences in line endings."""
391
392 # The "splitlines" method works independently of the line ending
393 # convention in use.
394 return s1.splitlines() == s2.splitlines()

## Member Data Documentation

GaudiTest.BasicOutputValidator.cause

Definition at line 356 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.reference

Definition at line 355 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.result_key

Definition at line 357 of file GaudiTest.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiPolicy/qmtest_classes/GaudiTest.py