src/tests/imageTestsReportNew.py
def run(filterString):
    "Run every version listed above outputting xml files in tmp/"
    exitCode=0
    if not os.path.exists("tmp"): os.mkdir("tmp")
    fpLog=open("tmp/data.log","w")

    testCount=0

    with os.popen(versions["v2-llvm"]+" --gtest_list_tests --gtest_filter=%s"%filterString) as pipe:
        testCount=len([line for line in pipe if not line.endswith(".")])
    print("tests to run %d"%testCount)
    for version in versions.keys():
        print(" ")
        count=0
        exe=versions[version]
        cmd=[exe,"--gtest_output=xml:tmp/%s"%(version+".xml"),"--gtest_filter=%s"%filterString]
        cmd=" ".join(cmd)
        print(cmd)
        process=subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,shell=True)
        pipe=iter(process.stdout.readline,b"")
        print(" ")
        for line in pipe:
            fpLog.write(line)
            line=line.strip()
            if re.search('OK', line):
                (prefix, time) = re.split('\(', line)
                count+=1
                if count%10==0: 
                    percent=100*count/testCount
                    print ("\r%30s %10d/%10d -- %d%% "%(version,count,testCount,percent)),
        errorCode=process.wait()
        if errorCode != 0:
            print("\n%s ERROR CODE %d\n"%(exe,errorCode))
            exitCode=1
    return exitCode
Run every version listed above outputting xml files in tmp/
Run every version listed above outputting xml files in tmp
Run every version listed above outputting xml files in tmp
def run(filterString):
    exitCode=0
    if not os.path.exists("tmp"): os.mkdir("tmp")
    fpLog=open("tmp/data.log","w")
    testCount=0
    with os.popen(versions["v2-llvm"]+" --gtest_list_tests --gtest_filter=%s"%filterString) as pipe:
        testCount=len([line for line in pipe if not line.endswith(".")])
    print("tests to run %d"%testCount)
    for version in versions.keys():
        print(" ")
        count=0
        exe=versions[version]
        cmd=[exe,"--gtest_output=xml:tmp/%s"%(version+".xml"),"--gtest_filter=%s"%filterString]
        cmd=" ".join(cmd)
        print(cmd)
        process=subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,shell=True)
        pipe=iter(process.stdout.readline,b"")
        print(" ")
        for line in pipe:
            fpLog.write(line)
            line=line.strip()
            if re.search('OK', line):
                (prefix, time) = re.split('\(', line)
                count+=1
                if count%10==0: 
                    percent=100*count/testCount
                    print ("\r%30s %10d/%10d -- %d%% "%(version,count,testCount,percent)),
        errorCode=process.wait()
        if errorCode != 0:
            print("\n%s ERROR CODE %d\n"%(exe,errorCode))
            exitCode=1
    return exitCode
def run ( filterString ) : exitCode = 0 if not os . path . exists ( "tmp" ) : os . mkdir ( "tmp" ) fpLog = open ( "tmp/data.log" , "w" ) testCount = 0 with os . popen ( versions [ "v2-llvm" ] + " --gtest_list_tests --gtest_filter=%s" % filterString ) as pipe : testCount = len ( [ line for line in pipe if not line . endswith ( "." ) ] ) print ( "tests to run %d" % testCount ) for version in versions . keys ( ) : print ( " " ) count = 0 exe = versions [ version ] cmd = [ exe , "--gtest_output=xml:tmp/%s" % ( version + ".xml" ) , "--gtest_filter=%s" % filterString ] cmd = " " . join ( cmd ) print ( cmd ) process = subprocess . Popen ( cmd , stdout = subprocess . PIPE , stderr = subprocess . STDOUT , shell = True ) pipe = iter ( process . stdout . readline , b"" ) print ( " " ) for line in pipe : fpLog . write ( line ) line = line . strip ( ) if re . search ( 'OK' , line ) : ( prefix , time ) = re . split ( '\(' , line ) count += 1 if count % 10 == 0 : percent = 100 * count / testCount print ( "\r%30s %10d/%10d -- %d%% " % ( version , count , testCount , percent ) ) , errorCode = process . wait ( ) if errorCode != 0 : print ( "\n%s ERROR CODE %d\n" % ( exe , errorCode ) ) exitCode = 1 return exitCode
Run every version listed above outputting xml files in tmp
Run every version listed above outputting xml files in tmp
"Run every version listed above outputting xml files in tmp/"
filterString