| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# GaudiTest::ReferenceFileValidator Class Reference

List of all members.

## Public Member Functions
def | __init__
def | __call__
## Public Attributes
| reffile
| cause
| result_key
| preproc

## Detailed Description

Definition at line 498 of file GaudiTest.py.

## Member Function Documentation

def GaudiTest::ReferenceFileValidator::__init__ | ( |  | self,
|  |  | reffile,
|  |  | cause,
|  |  | result_key,
|  |  | preproc = `normalizeExamples` |
| ) |  |  |

Definition at line 499 of file GaudiTest.py.

    00499                                                                                :
    00500         self.reffile = os.path.expandvars(reffile)
    00501         self.cause = cause
    00502         self.result_key = result_key
    00503         self.preproc = preproc
        def __call__(self, stdout, result):

def GaudiTest::ReferenceFileValidator::__call__ | ( |  | self,
|  |  | stdout,
|  |  | result |
| ) |  |  |

Definition at line 504 of file GaudiTest.py.

    00504                                       :
    00505         causes = []
    00506         if os.path.isfile(self.reffile):
    00507             orig = open(self.reffile).xreadlines()
    00508             if self.preproc:
    00509                 orig = self.preproc(orig)
    00510         else:
    00511             orig = []
    00512
    00513         new = stdout.splitlines()
    00514         if self.preproc:
    00515             new = self.preproc(new)
    00516         #open(self.reffile + ".test","w").writelines(new)
    00517         diffs = difflib.ndiff(orig,new,charjunk=difflib.IS_CHARACTER_JUNK)
    00518         filterdiffs = map(lambda x: x.strip(),filter(lambda x: x[0] != " ",diffs))
    00519         #filterdiffs = [x.strip() for x in diffs]
    00520         if filterdiffs:
    00521             result[self.result_key] = result.Quote("\n".join(filterdiffs))
    00522             result[self.result_key] += result.Quote("""
    00523 Legend:
    00524         -) reference file
    00525         +) standard output of the test""")
    00526             causes.append(self.cause)
    00527
    00528         return causes
    00529
    ########################################################################

## Member Data Documentation

GaudiTest::ReferenceFileValidator::reffile

Definition at line 500 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::cause

Definition at line 501 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 502 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 503 of file GaudiTest.py.

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

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