https://github.com/philsquared/Catch
Tip revision: 9e1bdca4667295fcb16265eae00efa8423f07007 authored by Martin Hořeňovský on 28 September 2018, 13:52:51 UTC
v2.4.1
v2.4.1
Tip revision: 9e1bdca
scriptCommon.py
import os
import sys
import subprocess
catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
def getBuildExecutable():
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