CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
addOnTests.testit Class Reference
Inheritance diagram for addOnTests.testit:

Public Member Functions

def __init__
 
def run
 

Public Attributes

 commandList
 
 dirName
 
 nfail
 
 npass
 
 report
 
 status
 

Detailed Description

Definition at line 15 of file addOnTests.py.

Constructor & Destructor Documentation

def addOnTests.testit.__init__ (   self,
  dirName,
  commandList 
)

Definition at line 16 of file addOnTests.py.

16 
17  def __init__(self,dirName, commandList):
18  Thread.__init__(self)
19  self.dirName = dirName
20  self.commandList = commandList
21  self.status=-1
22  self.report=''
23  self.nfail=[]
24  self.npass=[]
25 
26  return

Member Function Documentation

def addOnTests.testit.run (   self)

Definition at line 27 of file addOnTests.py.

References addOnTests.testit.commandList, addOnTests.testit.dirName, MuonIsolationDQM.dirName, VariablePlotter::SubDirectory.dirName, VariablePlotter::Directory.dirName, python.rootplot.root2matplotlib.replace(), runall.testit.report, WorkFlowRunner.WorkFlowRunner.report, addOnTests.testit.report, and ALIUtils.report.

27 
28  def run(self):
29 
30  startime='date %s' %time.asctime()
31  exitCodes = []
32 
33  for command in self.commandList:
34 
35  if not os.path.exists(self.dirName):
36  os.makedirs(self.dirName)
37 
38  commandbase = command.replace(' ','_').replace('/','_')
39  logfile='%s.log' % commandbase[:150].replace("'",'').replace('"','').replace('../','')
40 
41  executable = 'cd '+self.dirName+'; '+command+' > '+logfile+' 2>&1'
42 
43  ret = os.system(executable)
44  exitCodes.append( ret )
45 
46  endtime='date %s' %time.asctime()
47  tottime='%s-%s'%(endtime,startime)
48 
49  for i in range(len(self.commandList)):
50  command = self.commandList[i]
51  exitcode = exitCodes[i]
52  if exitcode != 0:
53  log='%s : FAILED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
54  self.report+='%s\n'%log
55  self.nfail.append(1)
56  self.npass.append(0)
57  else:
58  log='%s : PASSED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
59  self.report+='%s\n'%log
60  self.nfail.append(0)
61  self.npass.append(1)
62 
63  return

Member Data Documentation

addOnTests.testit.commandList

Definition at line 19 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.dirName

Definition at line 18 of file addOnTests.py.

Referenced by addOnTests.testit.run(), analyzer.Analyzer.write(), and core.JSONAnalyzer.JSONAnalyzer.write().

addOnTests.testit.nfail

Definition at line 22 of file addOnTests.py.

addOnTests.testit.npass

Definition at line 23 of file addOnTests.py.

addOnTests.testit.report

Definition at line 21 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.status

Definition at line 20 of file addOnTests.py.

Referenced by dirstructure.Comparison.__make_image(), and dirstructure.Comparison.__repr__().