Blame scripts/scriptCommon.py

rpm-build a7f80b
import os
rpm-build a7f80b
import sys
rpm-build a7f80b
import subprocess
rpm-build a7f80b
rpm-build a7f80b
rpm-build a7f80b
catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
rpm-build a7f80b
rpm-build a7f80b
def getBuildExecutable():
rpm-build a7f80b
    dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/SelfTest")
rpm-build a7f80b
    return dir
rpm-build a7f80b
rpm-build a7f80b
def runAndCapture( args ):
rpm-build a7f80b
    child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE)
rpm-build a7f80b
    lines = []
rpm-build a7f80b
    line = ""
rpm-build a7f80b
    while True:
rpm-build a7f80b
        out = child.stdout.read(1)
rpm-build a7f80b
        if out == '' and child.poll() != None:
rpm-build a7f80b
            break
rpm-build a7f80b
        if out != '':
rpm-build a7f80b
            if out == '\n':
rpm-build a7f80b
                lines.append( line )
rpm-build a7f80b
                line = ""
rpm-build a7f80b
            else:
rpm-build a7f80b
                line = line + out
rpm-build a7f80b
    return lines