| 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.QMTTest.QMTTest Class Reference
Inheritance diagram for GaudiTesting.QMTTest.QMTTest:
[legend]
Collaboration diagram for GaudiTesting.QMTTest.QMTTest:
[legend]

## Public Member Functions
def | __init__ (self, path=None)
def | XMLParser (self, path)
def | ValidateOutput (self, stdout, stderr, result)
Public Member Functions inherited from GaudiTesting.BaseTest.BaseTest
def | __init__ (self)
def | run (self)
def | ValidateOutput (self, stdout, stderr, result)
def | findReferenceBlock (self, reference=None, stdout=None, result=None, causes=None, signature_offset=0, signature=None, id=None)
def | countErrorLines
def | CheckTTreesSummaries (self, stdout=None, result=None, causes=None, trees_dict=None, ignore=r"Basket|.*size|Compression")
def | CheckHistosSummaries (self, stdout=None, result=None, causes=None, dict=None, ignore=None)
def | validateWithReference (self, stdout=None, stderr=None, result=None, causes=None, preproc=None)

## Public Attributes
| validator
| name
| callable
| extra_args
| args_order
Public Attributes inherited from GaudiTesting.BaseTest.BaseTest
| program
| args
| reference
| error_reference
| options
| stderr
| timeout
| exit_code
| environment
| unsupported_platforms
| signal
| workdir
| use_temp_dir
| status
| name
| causes
| result
| returnedCode
| out
| err
| proc
| stack_trace
| basedir

## Detailed Description

Definition at line 8 of file QMTTest.py.

## Constructor & Destructor Documentation

def GaudiTesting.QMTTest.QMTTest.__init__ | ( |  | self,
|  |  | path = `None`
| ) |  |

Definition at line 10 of file QMTTest.py.

10 def __init__(self, path=None):
11 BaseTest.__init__(self)
12 self.validator = ''
13 if path:
14 self.XMLParser(path)
15
GaudiTesting.QMTTest.QMTTest.XMLParser
def XMLParser(self, path)
Definition: QMTTest.py:16
GaudiTesting.QMTTest.QMTTest.validator
validator
Definition: QMTTest.py:12
GaudiTesting.QMTTest.QMTTest.__init__
def __init__(self, path=None)
Definition: QMTTest.py:10

## Member Function Documentation

def GaudiTesting.QMTTest.QMTTest.ValidateOutput | ( |  | self,
|  |  | stdout,
|  |  | stderr,
|  |  | result
| ) |  |

Definition at line 46 of file QMTTest.py.

46 def ValidateOutput(self, stdout, stderr, result):
47 if self.validator:
48 class CallWrapper(object):
49 """
50 Small wrapper class to dynamically bind some default arguments
51 to a callable.
52 """
53
54 def __init__(self, callable, extra_args={}):
55 self.callable = callable
56 self.extra_args = extra_args
57 # get the list of names of positional arguments
58 from inspect import getargspec
59 self.args_order = getargspec(callable)[0]
60 # Remove "self" from the list of positional arguments
61 # since it is added automatically
62 if self.args_order[0] == "self":
63 del self.args_order[0]
64
65 def __call__(self, *args, **kwargs):
66 # Check which positional arguments are used
67 positional = self.args_order[:len(args)]
68
69 kwargs = dict(kwargs) # copy the arguments dictionary
70 for a in self.extra_args:
71 # use "extra_args" for the arguments not specified as
72 # positional or keyword
73 if a not in positional and a not in kwargs:
74 kwargs[a] = self.extra_args[a]
75 return apply(self.callable, args, kwargs)
76
77 # local names to be exposed in the script
78 stdout_ref = self._expandReferenceFileName(self.reference)
79 stderr_ref = self._expandReferenceFileName(self.error_reference)
80 exported_symbols = {"self": self,
81 "stdout": stdout,
82 "stderr": stderr,
83 "result": result,
84 "causes": self.causes,
85 "reference": stdout_ref,
86 "error_reference": stderr_ref,
87 "findReferenceBlock":
88 CallWrapper(self.findReferenceBlock,
89 {"stdout": stdout,
90 "result": result,
91 "causes": self.causes}),
92 "validateWithReference":
93 CallWrapper(self.validateWithReference,
94 {"stdout": stdout,
95 "stderr": stderr,
96 "result": result,
97 "causes": self.causes}),
98 "countErrorLines":
99 CallWrapper(self.countErrorLines,
100 {"stdout": stdout,
101 "result": result,
102 "causes": self.causes}),
103 "checkTTreesSummaries":
104 CallWrapper(self.CheckTTreesSummaries,
105 {"stdout": stdout,
106 "result": result,
107 "causes": self.causes}),
108 "checkHistosSummaries":
109 CallWrapper(self.CheckHistosSummaries,
110 {"stdout": stdout,
111 "result": result,
112 "causes": self.causes})
113 }
114 # print self.validator
115 exec self.validator in globals(), exported_symbols
116 return result, self.causes
117 else:
118 return super(QMTTest, self).ValidateOutput(stdout, stderr, result)
119
GaudiTesting.QMTTest.QMTTest.args_order
args_order
Definition: QMTTest.py:59
GaudiTesting.BaseTest.BaseTest.validateWithReference
def validateWithReference(self, stdout=None, stderr=None, result=None, causes=None, preproc=None)
Definition: BaseTest.py:443
GaudiTesting.QMTTest.QMTTest.ValidateOutput
def ValidateOutput(self, stdout, stderr, result)
Definition: QMTTest.py:46
GaudiTesting.BaseTest.BaseTest.reference
reference
Definition: BaseTest.py:72
GaudiTesting.QMTTest.QMTTest.validator
validator
Definition: QMTTest.py:12
GaudiTesting.BaseTest.BaseTest.error_reference
error_reference
Definition: BaseTest.py:73
GaudiTesting.QMTTest.QMTTest.extra_args
extra_args
Definition: QMTTest.py:56
GaudiTesting.BaseTest.BaseTest.causes
causes
Definition: BaseTest.py:86
GaudiTesting.QMTTest.QMTTest.__init__
def __init__(self, path=None)
Definition: QMTTest.py:10
GaudiTesting.BaseTest.BaseTest._expandReferenceFileName
def _expandReferenceFileName(self, reffile)
Definition: BaseTest.py:504
GaudiTesting.QMTTest.QMTTest.callable
callable
Definition: QMTTest.py:55
GaudiTesting.BaseTest.BaseTest.findReferenceBlock
def findReferenceBlock(self, reference=None, stdout=None, result=None, causes=None, signature_offset=0, signature=None, id=None)
Definition: BaseTest.py:269
GaudiTesting.BaseTest.BaseTest.CheckHistosSummaries
def CheckHistosSummaries(self, stdout=None, result=None, causes=None, dict=None, ignore=None)
Definition: BaseTest.py:402
GaudiTesting.BaseTest.BaseTest.countErrorLines
def countErrorLines
Definition: BaseTest.py:317
GaudiTesting.BaseTest.BaseTest.CheckTTreesSummaries
def CheckTTreesSummaries(self, stdout=None, result=None, causes=None, trees_dict=None, ignore=r"Basket|.*size|Compression")
Definition: BaseTest.py:360

def GaudiTesting.QMTTest.QMTTest.XMLParser | ( |  | self,
|  |  | path
| ) |  |

    Parse a QMTest XML test description (.qmt file) to initialize the test
    instance.

Definition at line 16 of file QMTTest.py.

16 def XMLParser(self, path):
17 '''
18 Parse a QMTest XML test description (.qmt file) to initialize the test
19 instance.
20 '''
21 log = logging.getLogger('QMTest.XMLParser')
22 import xml.etree.ElementTree as ET
23 log.debug('parsing %s', path)
24
25 self.name = path
26
27 tree = ET.parse(path)
28 for child in tree.getroot():
29 name = child.attrib['name']
30 if hasattr(self, name):
31 log.debug('setting %s', name)
32 value = child[0]
33 if name in ('args', 'unsupported_platforms'):
34 setattr(self, name, [el.text
35 for el in value.findall('text')])
36 elif name == 'environment':
37 setattr(self, name, dict(el.text.split('=', 1)
38 for el in value.findall('text')))
39 else:
40 data = value.text
41 if data is not None:
42 if value.tag == 'integer':
43 data = int(data)
44 setattr(self, name, data)
45
GaudiTesting.QMTTest.QMTTest.XMLParser
def XMLParser(self, path)
Definition: QMTTest.py:16
GaudiTesting.BaseTest.BaseTest.name
name
Definition: BaseTest.py:85

## Member Data Documentation

GaudiTesting.QMTTest.QMTTest.args_order

Definition at line 59 of file QMTTest.py.

GaudiTesting.QMTTest.QMTTest.callable

Definition at line 55 of file QMTTest.py.

GaudiTesting.QMTTest.QMTTest.extra_args

Definition at line 56 of file QMTTest.py.

GaudiTesting.QMTTest.QMTTest.name

Definition at line 25 of file QMTTest.py.

GaudiTesting.QMTTest.QMTTest.validator

Definition at line 12 of file QMTTest.py.

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

- GaudiPolicy/python/GaudiTesting/QMTTest.py