From: Thomas Aubry Date: Mon, 29 Oct 2018 09:06:48 +0000 (+0100) Subject: spns #8471 : add Windows case to launch tests with the command 'sat test' X-Git-Tag: 5.2.0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmerge_windows;p=tools%2Fsat.git spns #8471 : add Windows case to launch tests with the command 'sat test' --- diff --git a/src/fork.py b/src/fork.py index 5a6582a..6684fda 100644 --- a/src/fork.py +++ b/src/fork.py @@ -22,6 +22,9 @@ import time import pickle import subprocess +# OP +import src + def show_progress(logger, top, delai, ss=""): """shortcut function to display the progression @@ -51,12 +54,24 @@ def launch_command(cmd, logger, cwd, args=[], log=None): logger.write("launch: %s\n" % cmd, 5, screenOnly=True) for arg in args: cmd += " " + arg - prs = subprocess.Popen(cmd, + + # OP Add Windows case + if src.architecture.is_windows(): + prs = subprocess.Popen(cmd, + shell=True, + stdout=log, + stderr=subprocess.STDOUT, + cwd=cwd) + pass + else: + prs = subprocess.Popen(cmd, shell=True, stdout=log, stderr=subprocess.STDOUT, cwd=cwd, executable='/bin/bash') + pass + # END OP return prs # Launch a batch diff --git a/src/test_module.py b/src/test_module.py index 30336ce..765b1e3 100644 --- a/src/test_module.py +++ b/src/test_module.py @@ -445,13 +445,21 @@ class Test: # stdout=subprocess.PIPE, # shell=True, # executable='/bin/bash').communicate()[0].split()[-1] - subproc_res = subprocess.Popen(cmd, + # OP Add Windows case + if src.architecture.is_windows(): + subproc_res = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + shell=True).communicate() + pass + else: + subproc_res = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, executable='/bin/bash').communicate() + pass #print "TRACES OP - test_module.py/Test.get_tmp_dir() subproc_res = " - for resLine in subproc_res: - print "- '#%s#'" %resLine + #for resLine in subproc_res: + # print "- '#%s#'" %resLine root_dir = subproc_res[0].split()[-1]