if not os.path.isdir(sempath): print(UP.semantics_not_found_err_msg(cpath)) exit(1) excludefiles = ['io.c', 'main_linux.c', 'std_thread.c'] capp = CApplication(sempath, excludefiles=excludefiles) filterout = ['io', 'main_linux', 'std_thread'] dc = ['deadcode'] def filefilter(f): return (not f in filterout) print( RP.project_proofobligation_stats_tostring(capp, extradsmethods=dc, filefilter=filefilter)) contract_condition_violations = capp.get_contract_condition_violations() if len(contract_condition_violations) > 0: print('=' * 80) print( str(len(contract_condition_violations)) + ' CONTRACT CONDITION FAILURES') print('=' * 80) for (fn, cc) in contract_condition_violations: print(fn + ':') for (name, desc) in cc: print(' ' + name + ':' + desc) print('=' * 80)
args = parse() cpath = UF.get_itc_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) capp = CApplication(sempath) dc = ['deadcode'] print(RP.project_proofobligation_stats_tostring(capp, extradsmethods=dc)) contract_condition_violations = capp.get_contract_condition_violations() if len(contract_condition_violations) > 0: print('=' * 80) print( str(len(contract_condition_violations)) + ' CONTRACT CONDITION FAILURES') print('=' * 80) for (fn, cc) in contract_condition_violations: print(fn + ':') for (name, desc) in cc: print(' ' + name + ':' + desc) print('=' * 80)
def parse(): usage = ( '\nCall with the name of one of the sard/zitser projects, e.g., id1284' ) description = ('Reports the analysis results for a zitser project') parser = argparse.ArgumentParser(usage=usage, description=description) parser.add_argument( 'path', help='name of one of the zitser projects (e.g., id1284)') args = parser.parse_args() return args if __name__ == '__main__': args = parse() cpath = UF.get_zitser_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) capp = CApplication(sempath) print(RP.project_proofobligation_stats_tostring(capp))