Inherits threading::Thread.
Public Member Functions | |
def | __init__ |
def | run |
Public Attributes | |
commandList | |
dirName | |
nfail | |
npass | |
report | |
status |
Definition at line 15 of file addOnTests.py.
def addOnTests::testit::__init__ | ( | self, | |
dirName, | |||
commandList | |||
) |
Definition at line 16 of file addOnTests.py.
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('../','') 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
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.