| # Gaudi Framework, version v21r7p1 |

Home |  | Generated: 15 Feb 2010

# GaudiTest::BasicOutputValidator Class Reference

List of all members.

## Public Member Functions
def | __init__
def | __call__
## Public Attributes
| reference
| cause
| result_key
## Private Member Functions
def | __CompareText

## Detailed Description

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

## Member Function Documentation

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

Definition at line 285 of file GaudiTest.py.

    00285                                            :
    00286         self.reference = ref
    00287         self.cause = cause
    00288         self.result_key = result_key
    00289
        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 290 of file GaudiTest.py.

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

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

## Member Data Documentation

GaudiTest::BasicOutputValidator::reference

Definition at line 286 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::cause

Definition at line 287 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::result_key

Definition at line 288 of file GaudiTest.py.

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

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