SyFi  0.3
run.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003 Usage:
00004   ./localrun.py --name=mytestmodulename --verbosity=[0|1|...|N] --local=[0|1]
00005 """
00006 
00007 import sys
00008 
00009 # get commandline options
00010 import getopt
00011 longoptions  = ["name=", "verbosity=", "local="]
00012 opt, args = getopt.getopt(sys.argv[1:], "", longoptions)
00013  
00014 # set default options       
00015 name      = "runall"
00016 verbosity = 0
00017 local     = 0
00018 
00019 # override defaults if provided
00020 for o in opt:
00021     oname = o[0].strip("-")
00022     s = "%s = %s.__class__(%s)" % (oname, oname, repr(o[1]))
00023     exec(s)
00024 
00025 # optionally use the local uninstalled SyFi and sfc modules
00026 if local:
00027     import os.path as p
00028     syfipath = p.abspath( p.join(p.curdir, p.pardir) )
00029     sys.path.insert(0, syfipath)
00030 
00031 # import module and run test
00032 m = __import__(name)
00033 m.test(verbosity)
00034 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines