예제 #1
0
def main(argv):
    options, extras = getopt.getopt(argv,'t:ag',['test:','tracelevel='])
    testlist = [name for (opt,name) in options if opt == '-t']
    compileargs =[]
    runargs=[]
    for (o,a) in options:
        if (o == '-g'):
           compileargs = compileargs +['--cxx-flags=-g'];
        if ('-a' == o):
           compileargs = compileargs + ['-a'];
        if ('--tracelevel' == o):
            runargs=['-t',str(level)]
    exec_noexit(['spl-make-toolkit','-i','source.common'])
    exec_noexit(['spl-make-toolkit','-i','../../com.ibm.streamsx.fastcvs'])
    if (len(extras) == 0):
       runDirectory('source',testlist,compileargs,runargs)
       runDirectory('sink',testlist,compileargs,runargs)
    else:
       runDirectory(extras[0],testlist,compileargs,runargs)
예제 #2
0
def run_test(dirname,extracompile,extrarun): 
   print "Beginning test "+dirname
   topdir = os.getcwd();
   os.chdir(dirname);
   # Cleanup first.  We don't do this at the end because on failures we'll want to look.
   if os.path.isdir('output'):
      print "output directory found, removing"
      shutil.rmtree('output')
   # see if the data generation file exists.
   if os.path.isfile('scenario.py'):
      sys.path.append(os.getcwd())
      tester = __import__('scenario')
   else: 
      tester = sys.modules[__name__]
   try: 
# any pre-compile steps??
      try:
         tester.precompile()
      except AttributeError:
         precompile()
# compile
      (stdout,stderr,code) = exec_noexit(['sc','-T','-t','../../../com.ibm.streamsx.fastcsv','--data-directory=../data.common','-M','Main']+extracompile);
      if code != 0:
         raise TestFailure("compile",stdout,stderr)
# run
      try:
          tester.run(extrarun)
      except AttributeError:
          run(extrarun);
# check results
      try: 
         tester.postrun()
      except AttributeError:
         postrun()
   except TestFailure as tf:
      tf.say(dirname)
      return False
   finally:
     if os.path.isfile('scenario.py'):
        del tester
        del sys.modules['scenario']
        sys.path.remove(os.getcwd())
     os.chdir(topdir)
   return True
예제 #3
0
def run(extrarun):
    (run_stdout,run_stderr,run_code) = exec_noexit(['output/bin/standalone']+extrarun)
    if (run_code != 0):
       raise TestFailure("run",run_stdout,run_stderr);