| The Gaudi Framework v30r0 (c919700c)

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

## Constructor & Destructor Documentation

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

Definition at line 964 of file BaseTest.py.

964 def __init__(self, reffile, cause, result_key, preproc=normalizeExamples):
965 self.reffile = os.path.expandvars(reffile)
966 self.cause = cause
967 self.result_key = result_key
968 self.preproc = preproc
969
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:967
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:965
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:966
GaudiTesting.BaseTest.ReferenceFileValidator.__init__
def __init__(self, reffile, cause, result_key, preproc=normalizeExamples)
Definition: BaseTest.py:964
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:968

## Member Function Documentation

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

Definition at line 970 of file BaseTest.py.

970 def __call__(self, stdout, result):
971 causes = []
972 if os.path.isfile(self.reffile):
973 orig = open(self.reffile).xreadlines()
974 if self.preproc:
975 orig = self.preproc(orig)
976 result[self.result_key + '.preproc.orig'] = \
977 result.Quote('\n'.join(map(str.strip, orig)))
978 else:
979 orig = []
980 new = stdout.splitlines()
981 if self.preproc:
982 new = self.preproc(new)
983
984 diffs = difflib.ndiff(orig, new, charjunk=difflib.IS_CHARACTER_JUNK)
985 filterdiffs = map(lambda x: x.strip(), filter(
986 lambda x: x[0] != " ", diffs))
987 if filterdiffs:
988 result[self.result_key] = result.Quote("\n".join(filterdiffs))
989 result[self.result_key] += result.Quote("""
990 Legend:
991 -) reference file
992 +) standard output of the test""")
993 result[self.result_key + '.preproc.new'] = \
994 result.Quote('\n'.join(map(str.strip, new)))
995 causes.append(self.cause)
996 return causes
997
998
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:967
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:965
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:966
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:970
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:968

## Member Data Documentation

GaudiTesting.BaseTest.ReferenceFileValidator.cause

Definition at line 966 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.preproc

Definition at line 968 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.reffile

Definition at line 965 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.result_key

Definition at line 967 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py