| The Gaudi Framework v32r1 (f65d50dc)

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

## Constructor & Destructor Documentation

## ◆ __init__()

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

Definition at line 670 of file GaudiTest.py.

670 def __init__(self, reffile, cause, result_key, preproc=normalizeExamples):
671 self.reffile = os.path.expandvars(reffile)
672 self.cause = cause
673 self.result_key = result_key
674 self.preproc = preproc
675

## Member Function Documentation

## ◆ __call__()

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

Definition at line 676 of file GaudiTest.py.

676 def __call__(self, stdout, result):
677 causes = []
678 if os.path.isfile(self.reffile):
679 orig = open(self.reffile).xreadlines()
680 if self.preproc:
681 orig = self.preproc(orig)
682 else:
683 orig = []
684
685 new = stdout.splitlines()
686 if self.preproc:
687 new = self.preproc(new)
688 #open(self.reffile + ".test","w").writelines(new)
689 diffs = difflib.ndiff(orig, new, charjunk=difflib.IS_CHARACTER_JUNK)
690 filterdiffs = map(lambda x: x.strip(),
691 filter(lambda x: x[0] != " ", diffs))
692 #filterdiffs = [x.strip() for x in diffs]
693 if filterdiffs:
694 result[self.result_key] = result.Quote("\n".join(filterdiffs))
695 result[self.result_key] += result.Quote("""
696 Legend:
697 -) reference file
698 +) standard output of the test""")
699 causes.append(self.cause)
700
701 return causes
702
703
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:25

## Member Data Documentation

## ◆ cause

GaudiTest.ReferenceFileValidator.cause

Definition at line 672 of file GaudiTest.py.

## ◆ preproc

GaudiTest.ReferenceFileValidator.preproc

Definition at line 674 of file GaudiTest.py.

## ◆ reffile

GaudiTest.ReferenceFileValidator.reffile

Definition at line 671 of file GaudiTest.py.

## ◆ result_key

GaudiTest.ReferenceFileValidator.result_key

Definition at line 673 of file GaudiTest.py.

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

- GaudiPolicy/qmtest_classes/GaudiTest.py