Beispiel #1
0
def _runtest(infile):
    global g_tmpfile
    assert (g_tmpfile)
    parser = DDSMTParser()
    smtformula = parser.parse(infile)

    _log(1, "parser: done")
    _log(
        2, "parser: maxrss: {} MiB".format(
            resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1000))

    _dump(smtformula, g_tmpfile)
    _log(1, "dumper: done")
    _log(1)

    if not _cmp(infile, g_tmpfile):
        bugfile = "bug-ddsmtparsertest-" + os.path.basename(infile)
        shutil.copyfile(g_tmpfile, bugfile)
        nbugs += 1
        _log(1, "bug: " + bugfile)
Beispiel #2
0
            _log(1, "input  file:           '{}'".format(g_args.infile))
            _log(1, "output file:           '{}'".format(g_args.outfile))
            _log(
                1, "command:               '{}'".format(" ".join(
                    [str(c) for c in g_args.cmd])))
            _log(1, "command (cross check): '{}'".format(g_args.cmd_cc))
        else:
            _log(1, "input  file: '{}'".format(g_args.infile))
            _log(1, "output file: '{}'".format(g_args.outfile))
            _log(
                1, "command:     '{}'".format(" ".join(
                    [str(c) for c in g_args.cmd])))

        ifilesize = os.path.getsize(g_args.infile)

        parser = DDSMTParser()
        g_smtformula = parser.parse(g_args.infile)

        #### debug
        #to_visit = [g_smtformula.scopes]
        #while to_visit:
        #    scope = to_visit.pop()
        #    print ("level: {}\ncommands: {}\nsorts: {}\nfuns:{}".format(
        #        scope.level,
        #        " ".join([str(c) for c in scope.cmds]),
        #        " ".join([str(s) for s in scope.sorts]),
        #        " ".join([str(f) for f in scope.funs])))
        #    to_visit.extend(scope.scopes)
        #######

        _log(2)