-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
return []
if args[0] in ["-h", "--help"]:
- print usage + epilog
+ print(usage + epilog)
sys.exit(0)
return args
# tests must be in ${ABSOLUTE_APPLI_PATH}/${__testSubDir}/
__testSubDir = "bin/salome/test"
-def __runTest(command, workdir):
- p = subprocess.Popen(command, cwd=workdir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- while True:
- try:
- out = p.stdout.readline()
- sys.stdout.write(out)
- except: # raised IOError or OSError if output is empty
- pass
-
- returncode = p.poll()
- if not returncode is None:
- sys.stdout.flush()
- break
- pass
-
- return p.returncode
-#
-
def runTests(args, exe=None):
args = __configureTests(args, exe)
testPath = os.path.join(appliPath, __testSubDir)
command = ["ctest"] + args
- res = __runTest(command, testPath)
-
- sys.exit(res)
+ p = subprocess.Popen(command, cwd=testPath)
+ p.communicate()
+ return p.returncode
#