def report()

in cbmc_viewer/report.py [0:0]


def report(config, sources, symbols, results, coverage, traces, properties,
           loops, report_dir='.', progress=progress_default):
    """Assemble the full report for cbmc viewer."""

    # The report is assembled from many sources of data
    # pylint: disable=too-many-locals

    # Some code depends on these definitions
    #   * links to traces in summary produced with jinja summary template
    #   * links to sources in traces produced by markup_trace
    #   * links to css and js in traces produced with jinja trace template
    code_dir = report_dir
    trace_dir = os.path.join(report_dir, markup_trace.TRACES)

    os.makedirs(report_dir, exist_ok=True)
    shutil.copy(pkg_resources.resource_filename(PACKAGE, VIEWER_CSS),
                report_dir)
    shutil.copy(pkg_resources.resource_filename(PACKAGE, VIEWER_JS),
                report_dir)

    progress("Preparing report summary")
    markup_summary.Summary(
        coverage, symbols, results, properties, loops, config).dump(
            outdir=report_dir)
    progress("Preparing report summary", True)

    progress("Annotating source tree")
    for path in sources.files:
        markup_code.Code(sources.root, path, symbols, coverage).dump(
            outdir=code_dir)
    progress("Annotating source tree", True)

    progress("Annotating traces")
    snippets = markup_trace.CodeSnippet(sources.root)
    for name, trace in traces.traces.items():
        markup_trace.Trace(name, trace, symbols, properties, loops, snippets).dump(
            outdir=trace_dir)
    progress("Annotating traces", True)