| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 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 496 of file GaudiTest.py.

## Member Function Documentation

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

Definition at line 497 of file GaudiTest.py.

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

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

Definition at line 502 of file GaudiTest.py.

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

## Member Data Documentation

GaudiTest::ReferenceFileValidator::reffile

Definition at line 498 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::cause

Definition at line 499 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 500 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 501 of file GaudiTest.py.

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

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