| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# 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::__call__ | ( |  | self,
|  |  | stdout,
|  |  | result |
| ) |  |  |

Definition at line 504 of file GaudiTest.py.

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

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

Definition at line 499 of file GaudiTest.py.

    00500                                                                                :
    00501         self.reffile = os.path.expandvars(reffile)
    00502         self.cause = cause
    00503         self.result_key = result_key
            self.preproc = preproc

## Member Data Documentation

GaudiTest::ReferenceFileValidator::cause

Definition at line 501 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 503 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::reffile

Definition at line 500 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 502 of file GaudiTest.py.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines