action="store_true") parser.add_argument("--xviolated", help="exclude violated ppo's", action="store_true") parser.add_argument("--predicates", nargs="*", help="predicates of interest (default: all)") args = parser.parse_args() return args if __name__ == "__main__": args = parse() try: cpath = UF.get_juliet_testpath(args.cwe, args.test) UF.check_analysis_results(cpath) except UF.CHError as e: print(str(e.wrap())) exit(1) sempath = os.path.join(cpath, "semantics") excludefiles = ["io.c", "main_linux.c", "std_thread.c"] capp = CApplication(sempath, excludefiles=excludefiles) def pofilter(p): return True if args.predicates:
ppoprojecttotals: Dict[Any, Any] = {} # project -> dm -> dmtotal spoprojecttotals: Dict[Any, Any] = {} ppotagtotals: Dict[Any, Any] = {} # tag -> dm -> dmtotal spotagtotals: Dict[Any, Any] = {} nosummary: List[Any] = [] analysistimes: Dict[Any, Any] = {} dsmethods = RP.get_dsmethods([]) for cwe in testcases: if not (cwerequested == "all" or cwerequested == cwe): continue for test in testcases[cwe]: p = cwe + ":" + test path = UF.get_juliet_testpath(cwe, test) results = UF.read_project_summary_results(path) if results is None: nosummary.append(p) continue pd = results try: ppod = pd["tagresults"]["ppos"] spod = pd["tagresults"]["spos"] ppoprojecttotals[p] = {} spoprojecttotals[p] = {} except BaseException: print("Problem with " + str(p)) continue if "stats" in pd: projectstats[p] = pd["stats"]