Salome HOME
sat #18867 : pour les url des bases git : substitution des references par leur valeur...
[tools/sat.git] / commands / test.py
index 2daf44f438ad846ddaff277da55b9c87bbe409b3..62fd7fef5cc6d55e793a4955b2dc6bde2f4ebc72 100644 (file)
@@ -23,6 +23,13 @@ import subprocess
 import datetime
 import gzip
 
+# Compatibility python 2/3 for input function
+# input stays input for python 3 and input = raw_input for python 2
+try:
+    input = raw_input
+except NameError:
+    pass
+
 verbose = False
 
 try:
@@ -122,9 +129,9 @@ def parse_option(args, config):
 def ask_a_path():
     """ 
     """
-    path = raw_input("enter a path where to save the result: ")
+    path = input("enter a path where to save the result: ")
     if path == "":
-        result = raw_input("the result will be not save. Are you sure to "
+        result = input("the result will be not save. Are you sure to "
                            "continue ? [y/n] ")
         if result == "y":
             return path
@@ -132,7 +139,7 @@ def ask_a_path():
             return ask_a_path()
 
     elif os.path.exists(path):
-        result = raw_input("Warning, the content of %s will be deleted. Are you"
+        result = input("Warning, the content of %s will be deleted. Are you"
                            " sure to continue ? [y/n] " % path)
         if result == "y":
             return path
@@ -322,7 +329,7 @@ def create_test_report(config,
 
 
     prod_node.attrib["history_file"] = os.path.basename(xml_history_path)
-    prod_node.attrib["global_res"] = retcode
+    prod_node.attrib["global_res"] = str(retcode)
 
     if withappli:
         if not first_time:
@@ -386,7 +393,7 @@ def create_test_report(config,
             grids = {}
             sessions = {}
             for test in tt[testbase]:
-                if not grids.has_key(test.grid):
+                if not (test.grid in grids):
                     if first_time:
                         mn = add_simple_node(gn, "grid")
                         mn.attrib['name'] = test.grid
@@ -468,7 +475,7 @@ def create_test_report(config,
                     if 'callback' in script:
                         try:
                             cnode = add_simple_node(tn, "callback")
-                            if src.architecture.is_windows():
+                            if True:  # bug xml mal forme colorisation  src.architecture.is_windows():
                                 import string
                                 cnode.text = filter(
                                                 lambda x: x in string.printable,
@@ -629,7 +636,7 @@ def run(args, runner, logger):
     show_desktop = (options.display and options.display.upper() == "NO")
     if options.display and options.display != "NO":
         remote_name = options.display.split(':')[0]
-        if remote_name != "":
+        if remote_name != "" and (not src.architecture.is_windows()):
             check_remote_machine(remote_name, logger)
         # if explicitly set use user choice
         os.environ['DISPLAY'] = options.display