Giter Club home page Giter Club logo

lcov_ex's Introduction

lcov_ex

Test coverage module to generate a lcov.info file for an Elixir project.

The docs can be found at https://hexdocs.pm/lcov_ex.

Why

Many test coverage tools use lcov files as an input to generate reports.

You can use it as I do to watch coverage progress in the following editors:

  • VSCode:
    • Using the Coverage Gutters extension.
    • Using the Koverage extension (add "cover" in settings as coverage folder, or output the report to the "coverage" folder, see below).
  • Atom, using the lcov-info extension (it requires you to change the output folder to "coverage", see below).

Please let me know if you made it work in your previously unlisted favorite editor. Or, if you're really nice, just add it to this list yourself ๐Ÿ™‚

Installation

Add to your dependencies:

  def deps do
    [
      {:lcov_ex, "~> 0.2", only: [:dev, :test], runtime: false}
    ]
  end

Usage

mix lcov

File should be created at ./cover/lcov.info by default.

To run silently use the --quiet option:

mix lcov --quiet

To output the file to a differnt folder, use the --output option:

mix lcov --output coverage
...
Coverage file successfully created at coverage/lcov.info

As test coverage tool

Alternatively, you can set up LcovEx as your test coverage tool in your project configuration:

  def project do
    [
      ...
      test_coverage: [tool: LcovEx, output: "cover"],
      ...
    ]

And then, run with:

mix test --cover

The output option indicates the output folder for the generated file.

Optionally, the ignore_paths option can be a list of prefixes to ignore when generating the coverage report.

  def project do
    [
      ...
      test_coverage: [tool: LcovEx, output: "cover", ignore_paths: ["test/"]]
      ...
    ]

TODOs

  • Add missing FN lines, for the sake of completion.

lcov_ex's People

Contributors

dariodf avatar paulswartz 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.