Salome HOME
projects
/
modules
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add pid to port log filename
[modules/kernel.git]
/
bin
/
appliskel
/
salome_tester
/
salome_test_driver.py
diff --git
a/bin/appliskel/salome_tester/salome_test_driver.py
b/bin/appliskel/salome_tester/salome_test_driver.py
index 068bf89a0ec549152ba908a355bf7294f9340902..7b119d1765804d61475874548adc55737d26d484 100644
(file)
--- a/
bin/appliskel/salome_tester/salome_test_driver.py
+++ b/
bin/appliskel/salome_tester/salome_test_driver.py
@@
-1,4
+1,4
@@
-# Copyright (C) 2015-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-201
7
CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-29,26
+29,12
@@
import signal
# Run test
def runTest(command):
print "Running:", " ".join(command)
# Run test
def runTest(command):
print "Running:", " ".join(command)
- p = subprocess.Popen(command
, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
-
out, err =
p.communicate()
+ p = subprocess.Popen(command)
+ p.communicate()
res = p.returncode
# About res value:
# A negative value -N indicates that the child was terminated by signal N (Unix only).
# On Unix, the value 11 generally corresponds to a segmentation fault.
res = p.returncode
# About res value:
# A negative value -N indicates that the child was terminated by signal N (Unix only).
# On Unix, the value 11 generally corresponds to a segmentation fault.
- return res, out, err
-#
-
-# Display output and errors
-def processResult(res, out, err):
- if out:
- print out
- pass
- if err:
- print " ** Detected error **"
- print "Error code: ", res
- print err,
- print " ** end of message **"
- pass
return res
#
return res
#
@@
-68,7
+54,7
@@
if __name__ == "__main__":
# first argument
if not args:
print "Invalid arguments for salome_test_driver.py. No command defined."
# first argument
if not args:
print "Invalid arguments for salome_test_driver.py. No command defined."
- exit(1)
+
sys.
exit(1)
_, ext = os.path.splitext(args[0])
if ext == ".py":
test_and_args = [sys.executable] + args
_, ext = os.path.splitext(args[0])
if ext == ".py":
test_and_args = [sys.executable] + args
@@
-96,18
+82,19
@@
if __name__ == "__main__":
try:
salome_instance = SalomeInstance.start(shutdown_servers=True)
port = salome_instance.get_port()
try:
salome_instance = SalomeInstance.start(shutdown_servers=True)
port = salome_instance.get_port()
- res, out, err = runTest(test_and_args)
- res = processResult(res, out, err)
+ res = runTest(test_and_args)
except TimeoutException:
print "FAILED : timeout(%s) is reached"%timeout_delay
except:
import traceback
traceback.print_exc()
pass
except TimeoutException:
print "FAILED : timeout(%s) is reached"%timeout_delay
except:
import traceback
traceback.print_exc()
pass
-
- salome_instance.stop()
+ try:
+ salome_instance.stop()
+ except:
+ pass
if sys.platform == 'win32':
timer.cancel()
print "Exit test with status code:", res
if sys.platform == 'win32':
timer.cancel()
print "Exit test with status code:", res
- exit(res)
+
sys.
exit(res)
#
#