| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 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 495 of file GaudiTest.py.

## Member Function Documentation

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

Definition at line 496 of file GaudiTest.py.

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

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

Definition at line 501 of file GaudiTest.py.

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

## Member Data Documentation

GaudiTest::ReferenceFileValidator::reffile

Definition at line 497 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::cause

Definition at line 498 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 499 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 500 of file GaudiTest.py.

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

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