# if os.path.exists(rootdatapath+msdata): datapath=rootdatapath+msdata else: datapath='./'+msdata if os.path.exists(rootdatapath+msk): maskpath=rootdatapath+msk else: maskpath='./'+msk #test working directory testdir = '3c391polim_regression' # clean up previous run tstutl.cleanup(testdir) # copying the data to testdir tstutl.maketestdir(testdir) print "Test working directory: ", testdir try: print "copying data from "+datapath shutil.copytree(datapath,testdir+'/'+msdata) print "copying mask image from "+maskpath shutil.copyfile(maskpath,testdir+'/'+msk) except Exception,e: tstutl.note("Failed with:"+str(e)) raise e ################## # reference data #
for k in range(len(cmplist)): pplot=testplot+'/'+cmplist[k] nplot=prevplot+'/'+cmplist[k] if (filecmp.cmp(nplot,pplot)): tstutl.note(cmplist[k]+' is same','INFO',this) else: tstutl.note(cmplist[k]+' differs ','WARN',this) ############################################################################## # 13. save png files # ############################################################################## #everything should be good if it reaches here if (savebase and os.path.exists(testplot)): if (os.path.exists(prevplot)): tstutl.cleanup(prevplot) shutil.copytree(testplot, prevplot) tstutl.note("save plot files to prev as a new baseline",'INFO',this) ############################################################################## #done with all the test if bench: endTime = time.time() endProc = time.clock() tstutl.note('Total wall clock time %.2f sec.' % (endTime - startTime),'INFO',this) tstutl.note('Total CPU time %.2f sec.' % (endProc - startProc),'INFO',this) tstutl.note('******plotxy regression test finish******','INFO',this) tstutl.note('*****************************************','INFO',this) # Restore stdout and stderr
for k in range(len(cmplist)): pplot = testplot + '/' + cmplist[k] nplot = prevplot + '/' + cmplist[k] if (filecmp.cmp(nplot, pplot)): tstutl.note(cmplist[k] + ' is same', 'INFO', this) else: tstutl.note(cmplist[k] + ' differs ', 'WARN', this) ############################################################################## # 13. save png files # ############################################################################## #everything should be good if it reaches here if (savebase and os.path.exists(testplot)): if (os.path.exists(prevplot)): tstutl.cleanup(prevplot) shutil.copytree(testplot, prevplot) tstutl.note("save plot files to prev as a new baseline", 'INFO', this) ############################################################################## #done with all the test if bench: endTime = time.time() endProc = time.clock() tstutl.note('Total wall clock time %.2f sec.' % (endTime - startTime), 'INFO', this) tstutl.note('Total CPU time %.2f sec.' % (endProc - startProc), 'INFO', this) tstutl.note('******plotxy regression test finish******', 'INFO', this) tstutl.note('*****************************************', 'INFO', this)
msk = '3c391qu.rgn' # if os.path.exists(rootdatapath + msdata): datapath = rootdatapath + msdata else: datapath = './' + msdata if os.path.exists(rootdatapath + msk): maskpath = rootdatapath + msk else: maskpath = './' + msk #test working directory testdir = '3c391polim_regression' # clean up previous run tstutl.cleanup(testdir) # copying the data to testdir tstutl.maketestdir(testdir) print "Test working directory: ", testdir try: print "copying data from " + datapath shutil.copytree(datapath, testdir + '/' + msdata) print "copying mask image from " + maskpath shutil.copyfile(maskpath, testdir + '/' + msk) except Exception, e: tstutl.note("Failed with:" + str(e)) raise e ################## # reference data #