| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions | Public Attributes | Private Member Functions

# GaudiTest::BasicOutputValidator Class Reference

Output Validation Classes. More...

List of all members.

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

## Constructor & Destructor Documentation

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

Definition at line 286 of file GaudiTest.py.

    00287                                            :
    00288         self.reference = ref
    00289         self.cause = cause
    00290         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 291 of file GaudiTest.py.

    00292                                    :
    00293         """Validate the output of the program.
    00294
    00295         'stdout' -- A string containing the data written to the standard output
    00296         stream.
    00297
    00298         'stderr' -- A string containing the data written to the standard error
    00299         stream.
    00300
    00301         'result' -- A 'Result' object. It may be used to annotate
    00302         the outcome according to the content of stderr.
    00303
    00304         returns -- A list of strings giving causes of failure."""
    00305
    00306         causes = []
    00307         # Check to see if theoutput matches.
    00308         if not self.__CompareText(out, self.reference):
    00309             causes.append(self.cause)
    00310             result[self.result_key] = result.Quote(self.reference)
    00311
    00312         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 313 of file GaudiTest.py.

    00314                                    :
    00315         """Compare 's1' and 's2', ignoring line endings.
    00316
    00317         's1' -- A string.
    00318
    00319         's2' -- A string.
    00320
    00321         returns -- True if 's1' and 's2' are the same, ignoring
    00322         differences in line endings."""
    00323
    00324         # The "splitlines" method works independently of the line ending
    00325         # convention in use.
    00326         return s1.splitlines() == s2.splitlines()

## Member Data Documentation

GaudiTest::BasicOutputValidator::cause

Definition at line 286 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::reference

Definition at line 286 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::result_key

Definition at line 286 of file GaudiTest.py.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines