Giter Site home page Giter Site logo

localcoverage.jl's Introduction

LocalCoverage.jl

lifecycle build codecov.io

This is a collection of trivial functions to facilitate generating and exploring test coverage information for Julia packages locally, without using any remote/cloud services.

Installation

Pkg.add("LocalCoverage")

or ]add LocalCoverage from the Julia REPL.

Optional Dependencies

The package has several optional features which require additional dependencies. lcov is required for generating HTML output. You can install it via

  • Debian/Ubuntu: sudo apt install lcov
  • Arch/Manjaro: yay -S lcov

Note that the code in this package assumes a reasonably recent lcov version when calling genhtml, ideally 1.13, but 1.12 should work too. This does not prevent installation, only emits a warning.

LocalCoverage also provides an option to generate a Cobertura XML, which is used by JVM-related test suites such as Jenkins. Using this requires the Python module lcov_cobertura (>= v2.0.1). With Python installed, you can install this module via pip install lcov_cobertura.

Usage

When generating test coverage, Julia places annotated *.cov source code files in the same directory as the source code itself. In addition, summary files will be placed in the coverage subdirectory of the package directory. We recommend using this package with packages added with the Pkg.dev installation option (which allows for easy manipulation of the package directory).

To generate test coverage files do

using LocalCoverage
# pkg is the package name as a string, e.g. "LocalCoverage"
generate_coverage(pkg, genhtml=true, show_summary=true, genxml=false) # defaults shown

You can then navigate to the coverage subdirectory of the package directory (e.g. ~/.julia/dev/PackageName/coverage) and see the generated coverage summaries.

To open the coverage report HTML in a browser do

open_coverage(pkg)

To delete all coverage files do

clean_coverage(pkg, rm_directory=true) # defaults shown

localcoverage.jl's People

Contributors

tpapp avatar expandingman avatar helgee avatar dilumaluthge avatar ffevotte avatar juliatagbot avatar marcom avatar twavv avatar femtocleaner[bot] avatar github-actions[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.