CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 17 of file addOnTests.py.

Constructor & Destructor Documentation

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

Definition at line 18 of file addOnTests.py.

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

Member Function Documentation

def addOnTests.testit.run (   self)

Definition at line 29 of file addOnTests.py.

References addOnTests.testit.commandList, addOnTests.testit.dirName, analyzer.Analyzer.dirName, MuonIsolationDQM.dirName, VariablePlotter::SubDirectory.dirName, VariablePlotter::Directory.dirName, sistrip::SpyUtilities.range(), python.rootplot.root2matplotlib.replace(), runall.testit.report, WorkFlowRunner.WorkFlowRunner.report, addOnTests.testit.report, ALIUtils.report, dataset.BaseDataset.report, and dataset.Dataset.report.

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

Member Data Documentation

addOnTests.testit.commandList

Definition at line 21 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.dirName

Definition at line 20 of file addOnTests.py.

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

addOnTests.testit.nfail

Definition at line 24 of file addOnTests.py.

addOnTests.testit.npass

Definition at line 25 of file addOnTests.py.

addOnTests.testit.report

Definition at line 23 of file addOnTests.py.

Referenced by addOnTests.testit.run().

addOnTests.testit.status

Definition at line 22 of file addOnTests.py.

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