action='store_true')
    args = parser.parse_args()
    return args


if __name__ == '__main__':

    args = parse()

    cpath = UF.get_svcomp_testpath(args.path)

    if not os.path.isdir(cpath):
        print(UP.cpath_not_found_err_msg(cpath))
        exit(1)

    sempath = os.path.join(cpath, 'semantics')
    if not os.path.isdir(sempath):
        print(UP.semantics_not_found_err_msg(cpath))
        exit(1)

    cfapp = CApplication(sempath, args.cfile)
    cfile = cfapp.getcfile()

    if args.showcode:
        if args.open:
            print(RP.file_code_open_tostring(cfile))
        else:
            print(RP.file_code_tostring(cfile))

    print(RP.file_proofobligation_stats_tostring(cfile))
    if not os.path.isdir(cpath):
        print(UP.cpath_not_found_err_msg(cpath))
        exit(1)

    sempath = os.path.join(cpath, 'semantics')
    if not os.path.isdir(sempath):
        print(UP.semantics_not_found_err_msg(cpath))
        exit(1)

    try:
        cfapp = CApplication(sempath, args.cfile)
        cfile = cfapp.get_cfile()
    except CFileNotFoundException as e:
        print(e)
        exit(0)

    try:
        if args.showcode:
            if args.open:
                print(RP.file_code_open_tostring(cfile,
                                                 showinvs=args.showinvs))
            else:
                print(RP.file_code_tostring(cfile))

        print(RP.file_proofobligation_stats_tostring(cfile))
    except IndexedTableError as e:
        print('\n' + ('*' * 80) + '\nThe analysis results format has changed' +
              '\nYou may have to re-run the analysis first: ' + '\n' + e.msg +
              '\n' + ('*' * 80))
Beispiel #3
0
    args = parse()
    cpath = UF.get_juliet_testpath(args.path)

    if not os.path.isdir(cpath):
        print(UP.cpath_not_found_err_msg(cpath))
        exit(1)

    sempath = os.path.join(cpath, 'semantics')
    if not os.path.isdir(sempath):
        print(UP.semantics_not_found_err_msg(cpath))
        exit(1)

    try:
        cfapp = CApplication(sempath, args.cfile)
        cfile = cfapp.get_cfile()
    except CFileNotFoundException as e:
        print(str(e))
        exit(1)

    dc = ['deadcode']

    if args.showcode:
        if args.open:
            print(
                RP.file_code_open_tostring(cfile,
                                           showinvs=args.showinvariants))
        else:
            print(RP.file_code_tostring(cfile, showinvs=args.showinvariants))

    print(RP.file_proofobligation_stats_tostring(cfile, extradsmethods=dc))