X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=bin%2FrunTests.py;h=d1d5656c3df90844c9b657558b6164df83d48672;hb=refs%2Fheads%2Fagy%2F29576;hp=34a543f43d50b4671746a8af28193476cf358ccd;hpb=a9e2ea94058d1f5a0478fd068d72e41feb052ba7;p=modules%2Fkernel.git diff --git a/bin/runTests.py b/bin/runTests.py index 34a543f43..d1d5656c3 100644 --- a/bin/runTests.py +++ b/bin/runTests.py @@ -1,4 +1,4 @@ -# 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 @@ -65,7 +65,7 @@ For complete description of available options, pleaser refer to ctest documentat return [] if args[0] in ["-h", "--help"]: - print usage + epilog + print(usage + epilog) sys.exit(0) return args @@ -74,25 +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" -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) @@ -103,7 +84,7 @@ def runTests(args, exe=None): 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 #