| The Gaudi Framework v28r2-patches (bc4ad17a)

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

## Constructor & Destructor Documentation

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

Definition at line 869 of file BaseTest.py.

869 def __init__(self,reffile, cause, result_key, preproc=normalizeExamples):
870 self.reffile = os.path.expandvars(reffile)
871 self.cause=cause
872 self.result_key = result_key
873 self.preproc = preproc
874
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:872
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:870
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:871
GaudiTesting.BaseTest.ReferenceFileValidator.__init__
def __init__(self, reffile, cause, result_key, preproc=normalizeExamples)
Definition: BaseTest.py:869
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:873

## Member Function Documentation

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

Definition at line 875 of file BaseTest.py.

875 def __call__(self,stdout, result) :
876 causes = []
877 if os.path.isfile(self.reffile):
878 orig = open(self.reffile).xreadlines()
879 if self.preproc:
880 orig = self.preproc(orig)
881 result[self.result_key + '.preproc.orig'] = \
882 result.Quote('\n'.join(map(str.strip, orig)))
883 else:
884 orig = []
885 new = stdout.splitlines()
886 if self.preproc:
887 new = self.preproc(new)
888
889 diffs = difflib.ndiff(orig,new,charjunk=difflib.IS_CHARACTER_JUNK)
890 filterdiffs = map(lambda x: x.strip(),filter(lambda x: x[0] != " ",diffs))
891 if filterdiffs:
892 result[self.result_key] = result.Quote("\n".join(filterdiffs))
893 result[self.result_key] += result.Quote("""
894 Legend:
895 -) reference file
896 +) standard output of the test""")
897 result[self.result_key + '.preproc.new'] = \
898 result.Quote('\n'.join(map(str.strip, new)))
899 causes.append(self.cause)
900 return causes
901
GaudiTesting.BaseTest.ReferenceFileValidator.result_key
result_key
Definition: BaseTest.py:872
GaudiTesting.BaseTest.ReferenceFileValidator.reffile
reffile
Definition: BaseTest.py:870
GaudiTesting.BaseTest.ReferenceFileValidator.cause
cause
Definition: BaseTest.py:871
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:875
GaudiTesting.BaseTest.ReferenceFileValidator.preproc
preproc
Definition: BaseTest.py:873

## Member Data Documentation

GaudiTesting.BaseTest.ReferenceFileValidator.cause

Definition at line 871 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.preproc

Definition at line 873 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.reffile

Definition at line 870 of file BaseTest.py.

GaudiTesting.BaseTest.ReferenceFileValidator.result_key

Definition at line 872 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py