| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

Public Member Functions | Public Attributes

# 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 502 of file GaudiTest.py.

## Constructor & Destructor Documentation

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

Definition at line 503 of file GaudiTest.py.

    00504                                                                                :
    00505         self.reffile = os.path.expandvars(reffile)
    00506         self.cause = cause
    00507         self.result_key = result_key
            self.preproc = preproc

## Member Function Documentation

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

Definition at line 508 of file GaudiTest.py.

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

## Member Data Documentation

GaudiTest::ReferenceFileValidator::cause

Definition at line 503 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::preproc

Definition at line 503 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::reffile

Definition at line 503 of file GaudiTest.py.

GaudiTest::ReferenceFileValidator::result_key

Definition at line 503 of file GaudiTest.py.

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

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

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