casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
async-segfault.py
Go to the documentation of this file.
00001 # wrapper script for the async segfault test
00002 import sys
00003 import os
00004 import string
00005 from locatescript import copydata
00006 from locatescript import locatescript
00007 import inspect
00008 
00009 # Short description
00010 def description():
00011     return "Test of the occurence of a segfault in the fits file handling in tasks with async==false"
00012 
00013 pass_on = { "ms_name" : "test.ms",
00014             "image_name" : "test.clean.image"
00015             }
00016 
00017 a=inspect.stack()
00018 stacklevel=0
00019 for k in range(len(a)):
00020     if (string.find(a[k][1], 'ipython console') > 0):
00021         stacklevel=k
00022         break
00023 gl=sys._getframe(stacklevel).f_globals
00024 
00025 def data():
00026     ### return the data files that are needed by the regression script
00027     myfiles = []
00028     for i in pass_on.keys():
00029         myfiles.append(pass_on[i])
00030     return myfiles
00031 
00032 def doCopy():
00033     ### return a list of the same length as that returned by data()
00034     ###   containing 0 if the corresponding file should be just linked
00035     ###   (i.e. is read-only)
00036     ###   or 1 if the corresponding file should be really copied to
00037     ###   the work directory
00038 
00039     return [1,1]
00040 
00041 def run( fetch=False ):
00042 
00043     #####fetch data
00044     if fetch:
00045         for f in data( ):
00046             copydata( f, os.getcwd( ) )
00047     
00048     #####locate the regression script
00049     try: 
00050         lepath=locatescript('async-segfault_regression.py')
00051         print 'Script used is ',lepath
00052         execfile(lepath, gl, pass_on)
00053     except:
00054         print 'execution failed: ', sys.exc_info()
00055         raise
00056 ###return the images that will be templated and compared in future runs
00057     return []