https://github.com/philsquared/Catch
Tip revision: d08cee288f6f1940b1c6125e48499c8736acbde3 authored by Phil Nash on 13 February 2017, 16:15:42 UTC
v1.7.2 build
v1.7.2 build
Tip revision: d08cee2
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/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() != None:
break
if out != '':
if out == '\n':
lines.append( line )
line = ""
else:
line = line + out
return lines