ATLAS Offline Software
Loading...
Searching...
No Matches
CompareJetTestFiles.py
Go to the documentation of this file.
1# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3
4from ExeRunnerBase import ExeRunnerBase
5from TestResult import TestResult
6import os
7import JetValidation
8
9class CompareJetTestFiles(ExeRunnerBase):
10 def __init__(self,argdict={}):
11 testIdentifier = argdict.get('testIdentifierObj')
12 self.refFile = argdict.get('ReferenceFile')
13 self.newFile = argdict.get('NewFile')
14 logFile = argdict.get('LogFile')
15 #cmd = 'CompareJetTestFilesExec.py %s %s' % (self.refFile,self.newFile)
16 #cmd = '/afs/cern.ch/user/s/sschramm/testarea/dev-RTT/InstallArea/python/JetValidation/CompareJetTestFilesExec.py %s %s' % (self.refFile,self.newFile)
17
18 cmd = os.path.join( JetValidation.__path__[0], "CompareJetTestFilesExec.py") + " %s %s" % (self.refFile,self.newFile)
19 ExeRunnerBase.__init__(self,cmd,testIdentifier,logFile)
20
21 def run(self):
22 bad_refFile = not os.path.exists(self.refFile)
23 bad_newFile = not os.path.exists(self.newFile)
24 msg = ''
25 msgTpl = '%s: file does not exist, not running'
26 if bad_refFile:
27 msg += msgTpl % self.refFile
28 if bad_newFile:
29 msg += msgTpl % self.newFile
30
31 # Should we run this test?
32 if msg: # This will turn up on the results web page for this job
33 tr = TestResult(msg)
34 self.testResults.append(tr)
35 return
36
37 # all ok - call the worker script.
38 # You are free to call this as many times as you like.
39 # For example, if your worker script was grepping an input file,
40 # and you had many input file matches, you could loop over each file here
41 # in the master script and for each file call ExeRunnerBase.run().
42 # The advantage of this instead of passing the list of files to your worker
43 # is that you would get on your job web page a test result for each input file.
44 ExeRunnerBase.run(self)
Definition run.py:1