Salome HOME
Add missing methods to the client interface of SObject.
[modules/kernel.git] / bin / runTests.py
index 23ccb38180eed21d603b61a55c940ea0714a7cd4..2ea2fce2ca93d3c97fed409ed8b4eb9bbdd03b8a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2017  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
@@ -74,36 +74,6 @@ For complete description of available options, pleaser refer to ctest documentat
 # tests must be in ${ABSOLUTE_APPLI_PATH}/${__testSubDir}/
 __testSubDir = "bin/salome/test"
 
-# Both display process stdout&stderr to console and capture them to variables
-def __runTest(command, workdir):
-  p = subprocess.Popen(command, cwd=workdir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=0)
-  stdout = []
-  stderr = []
-
-  while True:
-    reads = [p.stdout.fileno(), p.stderr.fileno()]
-    ret = select.select(reads, [], [])
-
-    for fd in ret[0]:
-      if fd == p.stdout.fileno():
-        read = p.stdout.readline()
-        sys.stdout.write(read)
-        stdout.append(read)
-        pass
-      if fd == p.stderr.fileno():
-        read = p.stderr.readline()
-        sys.stderr.write(read)
-        stderr.append(read)
-        pass
-      pass
-
-    if p.poll() != None:
-      break
-    pass
-
-  return p.returncode, "".join(stdout), "".join(stderr)
-#
-
 def runTests(args, exe=None):
   args = __configureTests(args, exe)
 
@@ -114,7 +84,7 @@ def runTests(args, exe=None):
   testPath = os.path.join(appliPath, __testSubDir)
 
   command = ["ctest"] + args
-  res, out, err = __runTest(command, testPath)
-
-  sys.exit(res)
+  p = subprocess.Popen(command, cwd=testPath)
+  p.communicate()
+  return p.returncode
 #