| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 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 281 of file GaudiTest.py.

## Member Function Documentation

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

Definition at line 286 of file GaudiTest.py.

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

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

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

## Member Data Documentation

GaudiTest::BasicOutputValidator::reference

Definition at line 287 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::cause

Definition at line 288 of file GaudiTest.py.

GaudiTest::BasicOutputValidator::result_key

Definition at line 289 of file GaudiTest.py.

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

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