Reference
Contents
Index
ExtendedLocalCoverage.WrappedPackageCoverageExtendedLocalCoverage.generate_html_reportExtendedLocalCoverage.generate_package_coverage
ExtendedLocalCoverage.WrappedPackageCoverage — TypeWrappedPackageCoverage(summary::PackageCoverage)Structure wrapping the PackageCoverage struct to add a custom show method for fixing PrettyTables issues until https://github.com/JuliaCI/LocalCoverage.jl/pull/68 is merged.
ExtendedLocalCoverage.generate_html_report — Methodgenerate_html_report(cobertura_file, html_file; title = nothing, pkg_dir = nothing)Generate an HTML report from a cobertura XML file using the pycobertura Python package.
The cobertura_file and html_file arguments are the full paths to the cobertura XML file used as input and of the HTML file to be generated, respectively.
Keyword arguments
title = "Package Coverage Report"is the title used at the top of the HTML report.pkg_dir = dirname(cobertura_file)is the directory of the package being covered. It is used to generate the source code links in the HTML report and by default assumes the package directory to be the directory of the cobertura XML file.
ExtendedLocalCoverage.generate_package_coverage — Functiongenerate_package_coverage(pkg = nothing; kwargs...)Generate a summary of coverage results for package pkg.
If no pkg is supplied, the method operates in the currently active package. This acts similary to (and based on) the generate_coverage function from LocalCoverage.jl, but providing two main differences:
- It automatically extracts the list of files included by the package using
Revise.parse_pkg_files. - It allows to generate an HTML report (does so by default) using the
pycoberturaPython package which is installed by default via CondaPkg.- In contrast, the HTML report from
LocalCoverage.jlrelies on lcov being already available on your system and does not work on Windows machines.
- In contrast, the HTML report from
Keyword arguments (and their defaults)
use_existing_lcov = falseif true, the coverage is assumed to be already computed and available incoverage/lcov.infowithin the package directory. If false, the coverage is generated from scratch callingLocalCoverage.generate_coverage.run_test = truethis is forwarded toLocalCoverage.generate_coverageand determines whether tests are executed. Whenfalse, test execution step is skipped allowing an easier use in combination with other test packages.test_args = [""]this is forwarded toLocalCoverage.generate_coverageand is there passed on toPkg.test.exclude = []is used to specify string or regexes that are used to filter out some of the files in the list of package includes. The exclusion is done by removing from the list of files all files for whichoccursin(needle, filename)returnstrue, whereneedleis any element ofexclude.html_name = "index.html"is the name of the HTML file to be generated. If nothing is provided, no HTML report is generated. The report is always generated in thecoveragesubdirectory of the target package directory.cobertura_name = "cobertura-coverage.xml"is the name of the cobertura XML file to be generated. If nothing is provided both to this kwarg and tohtml_name, no cobertura XML file is generated. The file is always generated in thecoveragesubdirectory of the target package directory.print_to_stdout = truedetermines whether the coverage summary is printed to the standard output.force_paths_relative = falsedetermines whether the paths in thelcov.infofile are processed to make sure they are relative to the package directory. This is needed in some corner cases, especially if one wants the html file to correctly show source code for the files in the report.extensions = truewhentrue, also tries to add to the coverage files in theextdirectory that match an extension name specified in theProject.tomlfile.
Return values
The function returns a named tuple with the following fields:
covthe coverage summary as returned byLocalCoverage.generate_coverage.cobertura_filethe full path to the cobertura XML file, if any was generated.html_filethe full path to the HTML file, if any was generated.