| The Gaudi Framework v27r1

- 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
GaudiTesting.BaseTest.ReferenceFileValidator Class Reference

## Public Member Functions
def | __init__
def | __call__ (self, stdout, result)

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

## Detailed Description

Definition at line 851 of file BaseTest.py.

## Constructor & Destructor Documentation

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

Definition at line 852 of file BaseTest.py.

852 def __init__(self,reffile, cause, result_key, preproc=normalizeExamples):
853 self.reffile = os.path.expandvars(reffile)
854 self.cause=cause
855 self.result_key = result_key
856 self.preproc = preproc
857
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:855
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:853
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:854
GaudiTesting.BaseTest.ReferenceFileValidator.__init__
def __init__
Definition: BaseTest.py:852
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:856

## Member Function Documentation

def GaudiTesting.BaseTest.ReferenceFileValidator.__call__ | ( |  | self,
|  |  | stdout,
|  |  | result
| ) |  |

Definition at line 858 of file BaseTest.py.

858 def __call__(self,stdout, result) :
859 causes=[]
860 if os.path.isfile(self.reffile):
861 orig=open(self.reffile).xreadlines()
862 if self.preproc:
863 orig = self.preproc(orig)
864 else:
865 orig = []
866 new = stdout.splitlines()
867 if self.preproc:
868 new = self.preproc(new)
869
870 diffs = difflib.ndiff(orig,new,charjunk=difflib.IS_CHARACTER_JUNK)
871 filterdiffs = map(lambda x: x.strip(),filter(lambda x: x[0] != " ",diffs))
872 if filterdiffs:
873 result[self.result_key] = result.Quote("\n".join(filterdiffs))
874 result[self.result_key] += result.Quote("""
875 Legend:
876 -) reference file
877 +) standard output of the test""")
878 causes.append(self.cause)
879 return causes
880
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:855
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:853
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:854
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:25
GaudiTesting.BaseTest.ReferenceFileValidator.__call__
def __call__(self, stdout, result)
Definition: BaseTest.py:858
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:856

## Member Data Documentation

GaudiTesting.BaseTest.ReferenceFileValidator.cause

Definition at line 854 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.preproc

Definition at line 856 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.reffile

Definition at line 853 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.result_key

Definition at line 855 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py