]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
spns #8471 : add Windows case to launch tests with the command 'sat test' merge_windows
authorThomas Aubry <support-salome@cea.fr>
Mon, 29 Oct 2018 09:06:48 +0000 (10:06 +0100)
committerThomas Aubry <support-salome@cea.fr>
Mon, 29 Oct 2018 09:06:48 +0000 (10:06 +0100)
src/fork.py
src/test_module.py

index 5a6582adee8d32023469e1fca905a84ebc144470..6684fdada336262465e74e84beb92cc5062e95c9 100644 (file)
@@ -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
index 30336ce1bcf0c8e9b7e7b752cc0311c0fca83871..765b1e35573d5db07b8aff494f2af5b40588f719 100644 (file)
@@ -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]