| The Gaudi Framework v29r1 (5cd95fa2)

- 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__ (self, reffile, cause, result_key, preproc=normalizeExamples)
def | __call__ (self, stdout, result)

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

## Detailed Description

Definition at line 943 of file BaseTest.py.

## Constructor & Destructor Documentation

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

Definition at line 944 of file BaseTest.py.

944 def __init__(self, reffile, cause, result_key, preproc=normalizeExamples):
945 self.reffile = os.path.expandvars(reffile)
946 self.cause = cause
947 self.result_key = result_key
948 self.preproc = preproc
949
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:947
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:945
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:946
GaudiTesting.BaseTest.ReferenceFileValidator.__init__
def __init__(self, reffile, cause, result_key, preproc=normalizeExamples)
Definition: BaseTest.py:944
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:948

## Member Function Documentation

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

Definition at line 950 of file BaseTest.py.

950 def __call__(self, stdout, result):
951 causes = []
952 if os.path.isfile(self.reffile):
953 orig = open(self.reffile).xreadlines()
954 if self.preproc:
955 orig = self.preproc(orig)
956 result[self.result_key + '.preproc.orig'] = \
957 result.Quote('\n'.join(map(str.strip, orig)))
958 else:
959 orig = []
960 new = stdout.splitlines()
961 if self.preproc:
962 new = self.preproc(new)
963
964 diffs = difflib.ndiff(orig, new, charjunk=difflib.IS_CHARACTER_JUNK)
965 filterdiffs = map(lambda x: x.strip(), filter(
966 lambda x: x[0] != " ", diffs))
967 if filterdiffs:
968 result[self.result_key] = result.Quote("\n".join(filterdiffs))
969 result[self.result_key] += result.Quote("""
970 Legend:
971 -) reference file
972 +) standard output of the test""")
973 result[self.result_key + '.preproc.new'] = \
974 result.Quote('\n'.join(map(str.strip, new)))
975 causes.append(self.cause)
976 return causes
977
978
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:947
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:945
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:946
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:26
GaudiTesting.BaseTest.ReferenceFileValidator.__call__
def __call__(self, stdout, result)
Definition: BaseTest.py:950
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:948

## Member Data Documentation

GaudiTesting.BaseTest.ReferenceFileValidator.cause

Definition at line 946 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.preproc

Definition at line 948 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.reffile

Definition at line 945 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.result_key

Definition at line 947 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py