| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
GaudiTest.ReferenceFileValidator Class Reference

## Public Member Functions
def | __init__ (self, reffile, cause, result_key, preproc=normalizeExamples)
def | __call__ (self, stdout, result)

## Public Attributes
| reffile
| cause
| result_key
| preproc

## Detailed Description

Definition at line 594 of file GaudiTest.py.

## Constructor & Destructor Documentation

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

Definition at line 595 of file GaudiTest.py.

595 def __init__(self, reffile, cause, result_key, preproc = normalizeExamples):
596 self.reffile = os.path.expandvars(reffile)
597 self.cause = cause
598 self.result_key = result_key
599 self.preproc = preproc
GaudiTest.ReferenceFileValidator.__init__
def __init__(self, reffile, cause, result_key, preproc=normalizeExamples)
Definition: GaudiTest.py:595
GaudiTest.ReferenceFileValidator.result_key
result_key
Definition: GaudiTest.py:598
GaudiTest.ReferenceFileValidator.cause
cause
Definition: GaudiTest.py:597
GaudiTest.ReferenceFileValidator.preproc
preproc
Definition: GaudiTest.py:599
GaudiTest.ReferenceFileValidator.reffile
reffile
Definition: GaudiTest.py:596

## Member Function Documentation

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

Definition at line 600 of file GaudiTest.py.

600 def __call__(self, stdout, result):
601 causes = []
602 if os.path.isfile(self.reffile):
603 orig = open(self.reffile).xreadlines()
604 if self.preproc:
605 orig = self.preproc(orig)
606 else:
607 orig = []
608
609 new = stdout.splitlines()
610 if self.preproc:
611 new = self.preproc(new)
612 #open(self.reffile + ".test","w").writelines(new)
613 diffs = difflib.ndiff(orig,new,charjunk=difflib.IS_CHARACTER_JUNK)
614 filterdiffs = map(lambda x: x.strip(),filter(lambda x: x[0] != " ",diffs))
615 #filterdiffs = [x.strip() for x in diffs]
616 if filterdiffs:
617 result[self.result_key] = result.Quote("\n".join(filterdiffs))
618 result[self.result_key] += result.Quote("""
619 Legend:
620 -) reference file
621 +) standard output of the test""")
622 causes.append(self.cause)
623
624 return causes
625
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:25
GaudiTest.ReferenceFileValidator.__call__
def __call__(self, stdout, result)
Definition: GaudiTest.py:600
GaudiTest.ReferenceFileValidator.result_key
result_key
Definition: GaudiTest.py:598
GaudiTest.ReferenceFileValidator.cause
cause
Definition: GaudiTest.py:597
GaudiTest.ReferenceFileValidator.preproc
preproc
Definition: GaudiTest.py:599
GaudiTest.ReferenceFileValidator.reffile
reffile
Definition: GaudiTest.py:596

## Member Data Documentation

GaudiTest.ReferenceFileValidator.cause

Definition at line 597 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.preproc

Definition at line 599 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.reffile

Definition at line 596 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.result_key

Definition at line 598 of file GaudiTest.py.

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

- GaudiPolicy/qmtest_classes/GaudiTest.py