]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Run tests on Windows platform.
authormkr <mkr@opencascade.com>
Mon, 17 Aug 2015 10:32:32 +0000 (13:32 +0300)
committervsr <vsr@opencascade.com>
Tue, 3 Nov 2015 10:13:29 +0000 (13:13 +0300)
bin/appliskel/salome_tester/salome_test_driver.py

index 6d8a586bdd78c52bee0359542656b47654eb308b..578b16ced6144ba108c94f40ebe0f357eca0cc05 100644 (file)
@@ -80,7 +80,7 @@ def processResult(res, out, err):
 
 # Timeout management
 class TimeoutException(Exception):
-  """Execption raised when test timeout is reached."""
+  """Exception raised when test timeout is reached."""
 #
 def timeoutHandler(signum, frame):
   raise TimeoutException()
@@ -107,8 +107,14 @@ if __name__ == "__main__":
 
   # Set timeout handler
   print "Test timeout explicitely set to: %s seconds"%timeout_delay
-  signal.alarm(abs(int(timeout_delay)-10))
-  signal.signal(signal.SIGALRM, timeoutHandler)
+  timeout_sec = abs(int(timeout_delay)-10)
+  if sys.platform == 'win32':
+    from threading import Timer
+    timer = Timer(timeout_sec, timeoutHandler)
+    timer.start()
+  else:    
+    signal.alarm(timeout_sec)
+    signal.signal(signal.SIGALRM, timeoutHandler)
 
   # Run test in a new SALOME instance
   from salome_instance import SalomeInstance
@@ -127,6 +133,8 @@ if __name__ == "__main__":
     pass
 
   salome_instance.stop()
+  if sys.platform == 'win32':
+    timer.cancel()
   print "Exit test with status code:", res
   exit(res)
 #