diff options
| author | Martin Hořeňovský | 2019-12-06 11:53:31 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2019-12-06 11:53:31 +0100 |
| commit | 91ee07e08c5a72536834960ecf2527fa90244046 (patch) | |
| tree | ee7bf0251c746a50e6e871cf00ea52baf9ed44ec /tools/scripts/scriptCommon.py | |
| parent | 6eb04667ad4f571f20b040c5e7a4e0c25e99787c (diff) | |
| download | catch3-91ee07e08c5a72536834960ecf2527fa90244046.tar.gz | |
Moved scripts/ to tools/scripts/
Diffstat (limited to 'tools/scripts/scriptCommon.py')
| -rw-r--r-- | tools/scripts/scriptCommon.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/scripts/scriptCommon.py b/tools/scripts/scriptCommon.py new file mode 100644 index 00000000..a6930063 --- /dev/null +++ b/tools/scripts/scriptCommon.py @@ -0,0 +1,31 @@ +import os +import sys +import subprocess + + +catchPath = os.path.dirname(os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))) + +def getBuildExecutable(): + if os.name == 'nt': + dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest.exe") + return dir + else: + dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest") + return dir + + +def runAndCapture( args ): + child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE) + lines = [] + line = "" + while True: + out = child.stdout.read(1) + if out == '' and child.poll(): + break + if out != '': + if out == '\n': + lines.append( line ) + line = "" + else: + line = line + out + return lines |