| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# GaudiTest::ReferenceFileValidator Class Reference

List of all members.

## Detailed Description

Definition at line 439 of file GaudiTest.py.

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

## Member Function Documentation

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

Definition at line 440 of file GaudiTest.py.

    00440                                                                                :
    00441         self.reffile = os.path.expandvars(reffile)
    00442         self.cause = cause
    00443         self.result_key = result_key
    00444         self.preproc = preproc
        def __call__(self, stdout, result):

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

Definition at line 445 of file GaudiTest.py.

    00445                                       :
    00446         causes = []
    00447         if os.path.isfile(self.reffile):
    00448             orig = open(self.reffile).xreadlines()
    00449             if self.preproc:
    00450                 orig = self.preproc(orig)
    00451         else:
    00452             orig = []
    00453
    00454         new = stdout.splitlines()
    00455         if self.preproc:
    00456             new = self.preproc(new)
    00457         #open(self.reffile + ".test","w").writelines(new)
    00458         diffs = difflib.ndiff(orig,new,charjunk=difflib.IS_CHARACTER_JUNK)
    00459         filterdiffs = map(lambda x: x.strip(),filter(lambda x: x[0] != " ",diffs))
    00460         #filterdiffs = [x.strip() for x in diffs]
    00461         if filterdiffs:
    00462             result[self.result_key] = result.Quote("\n".join(filterdiffs))
    00463             result[self.result_key] += result.Quote("""
    00464 Legend:
    00465         -) reference file
    00466         +) standard output of the test""")
    00467             causes.append(self.cause)
    00468
    00469         return causes
    00470
    ########################################################################

## Member Data Documentation

GaudiTest::ReferenceFileValidator::reffile

Definition at line 441 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::cause

Definition at line 442 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 443 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 444 of file GaudiTest.py.

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

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