https://github.com/philsquared/Catch
Tip revision: 0a34cc201ef28bf25c88b0062f331369596cb7b7 authored by Martin Hořeňovský on 11 March 2018, 11:04:28 UTC
v2.2.1
v2.2.1
Tip revision: 0a34cc2
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