Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcbi/microcoverage.jl
Code coverage generation for Julia, implemented in pure Julia
https://github.com/bcbi/microcoverage.jl
coverage julia
Last synced: about 1 month ago
JSON representation
Code coverage generation for Julia, implemented in pure Julia
- Host: GitHub
- URL: https://github.com/bcbi/microcoverage.jl
- Owner: bcbi
- License: mit
- Created: 2020-01-08T06:21:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T01:03:43.000Z (over 4 years ago)
- Last Synced: 2024-11-10T09:48:43.893Z (2 months ago)
- Topics: coverage, julia
- Language: Julia
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MicroCoverage
[![Build Status](https://travis-ci.com/bcbi/MicroCoverage.jl.svg?branch=master)](https://travis-ci.com/bcbi/MicroCoverage.jl/branches)
[![Codecov](https://codecov.io/gh/bcbi/MicroCoverage.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/bcbi/MicroCoverage.jl)
[![Coveralls](https://coveralls.io/repos/github/bcbi/MicroCoverage.jl/badge.svg?branch=master)](https://coveralls.io/github/bcbi/MicroCoverage.jl?branch=master)MicroCoverage.jl is a code coverage tool for Julia, implemented in pure Julia.
## Installation
```julia
julia> using Pkg; Pkg.add("MicroCoverage")
```## Example
**Step 1:** Create a file named `foo.jl` with the following contents:
```julia
function foo(x)
if x == 1 || x == 100
return "hello"
else
return "goodbye"
end
end
```**Step 2:** Create a file named `test_foo.jl` with the following contents:
```julia
using Test@test foo(1) == "hello"
```**Step 3:** Open `julia` and run the following commands:
```julia
julia> using MicroCoveragejulia> MicroCoverage.start("foo.jl")
julia> include("foo.jl")
julia> include("test_foo.jl")
julia> MicroCoverage.stop()
```When you run `MicroCoverage.stop()`, MicroCoverage will create
a file named `foo.jl.microcov` with the following contents:
```julia
[1,1,1] function foo(x)
[1,0,1,0,1] if x == 1 || x == 100
[1] return "hello"
- else
[0] return "goodbye"
- end
- end
-
```## Acknowledgements
- This work was supported in part by National Institutes of Health grants U54GM115677, R01LM011963, and R25MH116440. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.
## Related Work
1. [https://github.com/StephenVavasis/microcoverage](https://github.com/StephenVavasis/microcoverage)