2323import subprocess
2424
2525
26- def run (suffix , args , guiTests = False , chrouter = True ):
26+ def run (suffix , args , guiTests = False , chrouter = True , apps = None ):
2727 if type (args ) is list :
2828 args = " " .join (args )
2929 if os .name != "posix" :
@@ -50,18 +50,19 @@ def run(suffix, args, guiTests=False, chrouter=True):
5050 "dfrouter" , "duarouter" , "jtrrouter" , "marouter" ,
5151 "netconvert" , "netedit" , "netgenerate" ,
5252 "od2trips" , "polyconvert" , "sumo" ):
53- env [binary .upper () + "_BINARY" ] = os .path .join (root , ".." , "bin" , binary + suffix )
54- env ["GUISIM_BINARY" ] = os .path .join (root , ".." , "bin" , "sumo-gui" + suffix )
55- apps = ("sumo.extra,sumo.extra.gcf,sumo.extra.sf,sumo.meso,"
56- "sumo.agg.ballistic,sumo.agg.idm,sumo.agg.sublanes,"
57- "sumo.astar,sumo.parallel,duarouter.astar,netconvert.gdal,polyconvert.gdal,"
58- "complex.meso,complex.libsumo,complex.libtraci,tools.extra" )
59- if chrouter :
60- apps += ",duarouter.chrouter,duarouter.chwrapper"
61- if guiTests :
62- apps += ",sumo.meso.gui,sumo.gui.osg"
63- if os .name == "posix" :
64- apps += ",complex.libsumo.gui"
53+ env [binary .upper () + "_BINARY" ] = os .path .join (env ["SUMO_HOME" ], "bin" , binary + suffix )
54+ env ["GUISIM_BINARY" ] = os .path .join (env ["SUMO_HOME" ], "bin" , "sumo-gui" + suffix )
55+ if not apps :
56+ apps = ("sumo.extra,sumo.extra.gcf,sumo.extra.sf,sumo.meso,"
57+ "sumo.agg.ballistic,sumo.agg.idm,sumo.agg.sublanes,"
58+ "sumo.astar,sumo.parallel,duarouter.astar,netconvert.gdal,polyconvert.gdal,"
59+ "complex.meso,complex.libsumo,complex.libtraci,tools.extra" )
60+ if chrouter :
61+ apps += ",duarouter.chrouter,duarouter.chwrapper"
62+ if guiTests :
63+ apps += ",sumo.meso.gui,sumo.gui.osg"
64+ if os .name == "posix" :
65+ apps += ",complex.libsumo.gui"
6566 process = subprocess .Popen ("%s %s -a %s" % ("texttest" , args , apps ), env = env ,
6667 stdout = subprocess .PIPE , stderr = subprocess .STDOUT , shell = True )
6768 with process .stdout :
@@ -74,5 +75,6 @@ def run(suffix, args, guiTests=False, chrouter=True):
7475 optParser = argparse .ArgumentParser ()
7576 optParser .add_argument ("-s" , "--suffix" , default = "" , help = "suffix to the fileprefix" )
7677 optParser .add_argument ("-g" , "--gui" , default = False , action = "store_true" , help = "run gui tests" )
78+ optParser .add_argument ("-a" , "--apps" , help = "run the given apps" )
7779 options , args = optParser .parse_known_args ()
78- run (options .suffix , ["-" + a for a in args ], options .gui )
80+ run (options .suffix , ["-" + a for a in args ], options .gui , True , options . apps )
0 commit comments