| The Gaudi Framework v29r0 (ff2e7097)

- 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 941 of file BaseTest.py.

## Constructor & Destructor Documentation

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

Definition at line 942 of file BaseTest.py.

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

## Member Function Documentation

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

Definition at line 948 of file BaseTest.py.

948 def __call__(self, stdout, result):
949 causes = []
950 if os.path.isfile(self.reffile):
951 orig = open(self.reffile).xreadlines()
952 if self.preproc:
953 orig = self.preproc(orig)
954 result[self.result_key + '.preproc.orig'] = \
955 result.Quote('\n'.join(map(str.strip, orig)))
956 else:
957 orig = []
958 new = stdout.splitlines()
959 if self.preproc:
960 new = self.preproc(new)
961
962 diffs = difflib.ndiff(orig, new, charjunk=difflib.IS_CHARACTER_JUNK)
963 filterdiffs = map(lambda x: x.strip(), filter(
964 lambda x: x[0] != " ", diffs))
965 if filterdiffs:
966 result[self.result_key] = result.Quote("\n".join(filterdiffs))
967 result[self.result_key] += result.Quote("""
968 Legend:
969 -) reference file
970 +) standard output of the test""")
971 result[self.result_key + '.preproc.new'] = \
972 result.Quote('\n'.join(map(str.strip, new)))
973 causes.append(self.cause)
974 return causes
975
976
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:945
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:943
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:944
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:948
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:946

## Member Data Documentation

GaudiTesting.BaseTest.ReferenceFileValidator.cause

Definition at line 944 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.preproc

Definition at line 946 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.reffile

Definition at line 943 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.result_key

Definition at line 945 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py