From e40cb68ec15cb1b0fde1aff81bdc1ba649c5d0a9 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 18 Sep 2008 11:48:17 +0000 Subject: [PATCH] TestRecorder support. --- bin/launchConfigureParser.py | 36 +++++++++++++++++++++++++++++++++++- bin/runSalome.py | 4 ++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 74b3cd0a1..fc47cbe89 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -51,6 +51,8 @@ except_nam = "noexcepthandler" terminal_nam = "terminal" pinter_nam = "pinter" batch_nam = "batch" +test_nam = "test" +play_nam = "play" # values in XML configuration file giving specific module parameters ( section) # which are stored in opts with key _ (eg SMESH_plugins) @@ -595,6 +597,24 @@ def CreateOptionParser (theAdditionalOptions=[]): dest="ns_port_log_file", help=help_str) + # Write/read test script file with help of TestRecorder. Default: False. + help_str = "Write/read test script file with help of TestRecorder." + o_test = optparse.Option("--test", + metavar="", + type="string", + action="store", + dest="test_script_file", + help=help_str) + + # Reproducing test script with help of TestRecorder. Default: False. + help_str = "Reproducing test script with help of TestRecorder." + o_play = optparse.Option("--play", + metavar="", + type="string", + action="store", + dest="play_script_file", + help=help_str) + # All options opt_list = [o_t,o_g, # GUI/Terminal o_d,o_o, # Desktop @@ -614,7 +634,9 @@ def CreateOptionParser (theAdditionalOptions=[]): o_a, # Print free port and exit o_n, # --nosave-config o_pi, # Interactive python console - o_nspl] + o_nspl, + o_test, # Write/read test script file with help of TestRecorder + o_play] # Reproducing test script with help of TestRecorder #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources", @@ -924,6 +946,18 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"): elif os.path.exists( "%s/%s.xml"%(d2, salomeappname) ): dirs.append( d2 ) + # Test + if cmd_opts.test_script_file is not None: + args[test_nam] = [] + filename = cmd_opts.test_script_file + args[test_nam] += re.split( "[:;,]", filename ) + + # Play + if cmd_opts.play_script_file is not None: + args[play_nam] = [] + filename = cmd_opts.play_script_file + args[play_nam] += re.split( "[:;,]", filename ) + # return arguments os.environ[config_var] = separator.join(dirs) #print "Args: ", args diff --git a/bin/runSalome.py b/bin/runSalome.py index 334f5bafb..b468a468b 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -309,6 +309,10 @@ class SessionServer(Server): self.CMD=self.SCMD1 + ['\"' + string.join(cata_path,'\"::\"') + '\"'] + self.SCMD2 else: self.CMD=self.SCMD1 + self.SCMD2 + if self.args.has_key('test'): + self.CMD+=['-test'] + self.args['test'] + elif self.args.has_key('play'): + self.CMD+=['-play'] + self.args['play'] # --- -- 2.39.2