| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# GaudiTest::ReferenceFileValidator Class Reference

List of all members.

## Detailed Description

Definition at line 494 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 495 of file GaudiTest.py.

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

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

Definition at line 500 of file GaudiTest.py.

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

## Member Data Documentation

GaudiTest::ReferenceFileValidator::reffile

Definition at line 496 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::cause

Definition at line 497 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 498 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 499 of file GaudiTest.py.

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

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