https://github.com/philsquared/Catch
Revision 87c125ecb89724afb52f05170e44e3995733066a authored by Martin Hořeňovský on 21 November 2017, 14:23:30 UTC, committed by Martin Hořeňovský on 21 November 2017, 17:55:28 UTC
1 parent 3b965aa
Raw File
Tip revision: 87c125ecb89724afb52f05170e44e3995733066a authored by Martin Hořeňovský on 21 November 2017, 14:23:30 UTC
Enable Werror for dev builds
Tip revision: 87c125e
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
back to top