Beispiel #1
0
def ParseC1visualizerStream(fileName, stream):
    c1File = C1visualizerFile(fileName)
    state = C1ParserState()
    fnProcessLine = lambda line, lineNo: __parseC1Line(c1File, line, lineNo,
                                                       state, fileName)
    fnLineOutsideChunk = lambda line, lineNo: \
        Logger.fail("C1visualizer line not inside a group", fileName, lineNo)
    for passName, passLines, startLineNo, testArch in \
        SplitStream(stream, fnProcessLine, fnLineOutsideChunk):
        C1visualizerPass(c1File, passName, passLines, startLineNo + 1)
    return c1File
Beispiel #2
0
def ParseCheckerStream(fileName, prefix, stream):
    checkerFile = CheckerFile(fileName)
    fnProcessLine = lambda line, lineNo: __processLine(line, lineNo, prefix,
                                                       fileName)
    fnLineOutsideChunk = lambda line, lineNo: \
        Logger.fail("Checker line not inside a group", fileName, lineNo)
    for caseName, caseLines, startLineNo, testArch in \
        SplitStream(stream, fnProcessLine, fnLineOutsideChunk):
        testCase = TestCase(checkerFile, caseName, startLineNo, testArch)
        for caseLine in caseLines:
            ParseCheckerAssertion(testCase, caseLine[0], caseLine[1],
                                  caseLine[2])
    return checkerFile
Beispiel #3
0
def ParseCheckerStream(fileName, prefix, stream, targetArch=None):
    checkerFile = CheckerFile(fileName)
    fnProcessLine = lambda line, lineNo: __processLine(line, lineNo, prefix,
                                                       fileName, targetArch)
    fnLineOutsideChunk = lambda line, lineNo: \
        Logger.fail("Checker line not inside a group", fileName, lineNo)
    for caseName, caseLines, startLineNo, testData in \
        SplitStream(stream, fnProcessLine, fnLineOutsideChunk):
        testArch = testData[0]
        forDebuggable = testData[1]
        testCase = TestCase(checkerFile, caseName, startLineNo, testArch,
                            forDebuggable)
        for caseLine in caseLines:
            ParseCheckerStatement(testCase, caseLine[0], caseLine[1],
                                  caseLine[2])
    return checkerFile