How to use the gcovr.configuration.OutputOrDefault.choose function in gcovr

To help you get started, we’ve selected a few gcovr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gcovr / gcovr / gcovr / __main__.py View on Github external
lambda: options.sonarqube,
        [options.sonarqube],
        print_sonarqube_report,
        lambda: logger.warn(
            "Sonarqube output skipped - "
            "consider providing output file with `--sonarqube=OUTPUT`.")))

    generators.append((
        lambda: not reports_were_written,
        [],
        print_text_report,
        lambda: None))

    for should_run, output_choices, generator, on_no_output in generators:
        if should_run():
            output = OutputOrDefault.choose(output_choices,
                                            default=default_output)
            if output is default_output:
                default_output = None
            if output is not None:
                generator(covdata, output.value, options)
                reports_were_written = True
            else:
                on_no_output()

    if default_output is not None and default_output.value is not None:
        logger.warn("--output={!r} option was provided but not used.",
                    default_output.value)

    if options.print_summary:
        print_summary(covdata)