pathname=os.environ.get('CASAPATH').split()[0]
libIndex=pathname.find('lib')
scriptpath=pathname+'/lib/python2.6/regressions'
scriptpath=pathname+'/gcwrap/python/scripts/regressions'
command='cp '+scriptpath+'/*_regression.py .'
datestring=datetime.datetime.isoformat(datetime.datetime.today())
outfile='REGRESSION.'+datestring+'.log'
regfile=open(outfile,'w')
print >>regfile,'******** Report '
print >>regfile,' ------'
print >>regfile,'%9s %6s %9s %9s %39s'%('SOURCE','PASSED','TIME','RATE','LOGFILE')
scriptlist=['G192','H121','L02D','NGC5921','NGC7538','NGC1333','NGC4826','NGC4826C','ORION','B0319', 'COORDSYSTEST', 'IMAGEPOLTEST', 'IMAGETEST', 'IC2233', 'POINTING']
ratedict={'G192': 634.9,'H121': 500.,'L02D': 500.,'NGC5921': 35.1,'NGC7538': 240.3,'NGC1333': 500.,'NGC4826': 662.,'NGC4826C': 760., 'ORION': 500., 'B0319': 5.0, 'COORDSYSTEST':44., 'IMAGEPOLTEST':41., 'IMAGETEST':32., 'IC2233':8051, 'POINTING':1080}
for mysource in scriptlist:
execute_script='DO_'+mysource
if (eval(execute_script)):
execfile(str.lower(mysource)+'_regression.py')
scripttime=(endTime-startTime)
scriptrate=ratedict[mysource]/(endTime-startTime)
print >>regfile,'%9s %6s %9s %9s %39s'%(mysource,scriptpass,scripttime,scriptrate,scriptlog)
print 'Test failed:', sys.exc_info()[0]