Exemple #1
0
def run(args):
    results, _ = abstract_semantics_helpers.do_analysis(
        check_variants,
        abstract_semantics_helpers.default_merge_predicates,
        args.call_strategy,
        args.typer,
        args.test_subprogram
    )

    if args.output_dir is not None:
        test_helper.ensure_dir(args.output_dir)

    for pred_name, analysis in results.iteritems():
        if args.output_dir is not None:
            analysis.analysis_results.save_cfg_to_file(os.path.join(
                args.output_dir,
                'cfg.dot'
            ))
            analysis.analysis_results.save_results_to_file(os.path.join(
                args.output_dir,
                'sem_{}.dot'.format(pred_name)
            ))
            analysis.save_results_to_file(os.path.join(
                args.output_dir,
                'field_exists_{}.dot'.format(pred_name)
            ))

    print(str(format_analysis_results(results)))
Exemple #2
0
def run(args):
    results, model = abstract_semantics_helpers.do_analysis(
        abstract_semantics.compute_semantics,
        abstract_semantics_helpers.default_merge_predicates,
        args.call_strategy, args.typer, args.test_subprogram)

    if args.output_dir is not None:
        test_helper.ensure_dir(args.output_dir)

        cfg_file = os.path.join(args.output_dir, 'cfg.dot')
        sem_pattern = os.path.join(args.output_dir, 'sem_{}.dot')

    for pred_name, analysis in results.iteritems():
        if args.output_dir is not None:
            analysis.save_cfg_to_file(cfg_file)
            analysis.save_results_to_file(sem_pattern.format(pred_name))

    print(str(format_analysis_results(results, model)))