Execute RegTest comparing a log file against a reference
Definition at line 293 of file CheckSteps.py.
◆ __init__()
def python.TrigValSteering.CheckSteps.RegTestStep.__init__ |
( |
|
self, |
|
|
|
name = 'RegTest' |
|
) |
| |
◆ configure()
def python.TrigValSteering.CheckSteps.RegTestStep.configure |
( |
|
self, |
|
|
|
test |
|
) |
| |
◆ prepare_inputs()
def python.TrigValSteering.CheckSteps.RegTestStep.prepare_inputs |
( |
|
self | ) |
|
Definition at line 310 of file CheckSteps.py.
310 def prepare_inputs(self):
311 log_file = self.input_base_name+
'.log'
312 if not os.path.isfile(log_file):
313 self.log.
error(
'%s input file %s is missing', self.name, log_file)
315 with open(log_file, encoding=
'utf-8')
as f_in:
316 matches = re.findall(
'({}.*).*$'.
format(self.regex),
317 f_in.read(), re.MULTILINE)
318 with open(self.input_file,
'w', encoding=
'utf-8')
as f_out:
320 linestr =
str(line[0])
if type(line)
is tuple
else line
321 f_out.write(linestr+
'\n')
◆ rename_ref()
def python.TrigValSteering.CheckSteps.RegTestStep.rename_ref |
( |
|
self | ) |
|
Definition at line 324 of file CheckSteps.py.
324 def rename_ref(self):
327 new_name = os.path.basename(self.reference) +
'.new'
329 new_name = os.path.basename(self.input_file) +
'.new'
330 os.rename(self.input_file, new_name)
331 self.log.
debug(
'Renamed %s to %s', self.input_file, new_name)
333 self.log.warning(
'Failed to rename %s to %s',
334 self.input_file, new_name)
◆ run()
def python.TrigValSteering.CheckSteps.RegTestStep.run |
( |
|
self, |
|
|
|
dry_run = False |
|
) |
| |
Definition at line 336 of file CheckSteps.py.
336 def run(self, dry_run=False):
337 if not dry_run
and not self.prepare_inputs():
338 self.log.
error(
'%s failed in prepare_inputs()', self.name)
340 if self.auto_report_result:
342 return self.result,
'# (internal) {} -> failed'.
format(self.name)
343 if self.reference
is None:
344 self.log.
error(
'Missing reference for %s', self.name)
348 if self.auto_report_result:
350 return self.result,
'# (internal) {} -> failed'.
format(self.name)
351 retcode, cmd = super(RegTestStep, self).
run(dry_run)
◆ auto_report_result
python.TrigValSteering.CheckSteps.RegTestStep.auto_report_result |
◆ executable
python.TrigValSteering.CheckSteps.RegTestStep.executable |
◆ explicit_reference
python.TrigValSteering.CheckSteps.RefComparisonStep.explicit_reference |
|
inherited |
◆ input_base_name
python.TrigValSteering.CheckSteps.RegTestStep.input_base_name |
◆ input_file
python.TrigValSteering.CheckSteps.RegTestStep.input_file |
◆ output_stream
python.TrigValSteering.CheckSteps.RegTestStep.output_stream |
◆ ref_test_name
python.TrigValSteering.CheckSteps.RefComparisonStep.ref_test_name |
|
inherited |
◆ reference
python.TrigValSteering.CheckSteps.RefComparisonStep.reference |
|
inherited |
◆ regex
python.TrigValSteering.CheckSteps.RegTestStep.regex |
◆ result
python.TrigValSteering.CheckSteps.RegTestStep.result |
The documentation for this class was generated from the following file:
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)