CMS 3D CMS Logo

Public Member Functions | Public Attributes

addOnTests::testit Class Reference

Inherits threading::Thread.

List of all members.

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.

00017                                            :
00018         Thread.__init__(self)
00019         self.dirName = dirName
00020         self.commandList = commandList
00021         self.status=-1
00022         self.report=''
00023         self.nfail=[]
00024         self.npass=[]
00025 
00026         return
    

Member Function Documentation

def addOnTests::testit::run (   self)

Definition at line 27 of file addOnTests.py.

00028                  :
00029 
00030         startime='date %s' %time.asctime()
00031         exitCodes = []
00032 
00033         for command in self.commandList:
00034 
00035             if not os.path.exists(self.dirName):
00036                 os.makedirs(self.dirName)
00037 
00038             commandbase = command.replace(' ','_').replace('/','_')
00039             logfile='%s.log' % commandbase[:150].replace("'",'').replace('"','').replace('../','')
00040             
00041             executable = 'cd '+self.dirName+'; '+command+' > '+logfile+' 2>&1'
00042 
00043             ret = os.system(executable)
00044             exitCodes.append( ret )
00045 
00046         endtime='date %s' %time.asctime()
00047         tottime='%s-%s'%(endtime,startime)
00048     
00049         for i in range(len(self.commandList)):
00050             command = self.commandList[i]
00051             exitcode = exitCodes[i]
00052             if exitcode != 0:
00053                 log='%s : FAILED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
00054                 self.report+='%s\n'%log
00055                 self.nfail.append(1)
00056                 self.npass.append(0)
00057             else:
00058                 log='%s : PASSED - time: %s s - exit: %s\n' %(command,tottime,exitcode)
00059                 self.report+='%s\n'%log
00060                 self.nfail.append(0)
00061                 self.npass.append(1)
00062 
00063         return


Member Data Documentation

Definition at line 16 of file addOnTests.py.

Definition at line 16 of file addOnTests.py.

Definition at line 16 of file addOnTests.py.

Definition at line 16 of file addOnTests.py.

Definition at line 16 of file addOnTests.py.

Definition at line 16 of file addOnTests.py.