Analyzing coverage reports with go. This project resembles the way coveralls might be analysing coverage reports generated by their client libraries.
import "github.com/flower-pot/coverageanalysis"
You can either directly analyze a json string .
coverageanalysis.AnalyzeJson(`{
"source_files": [{
"name": "test.rb",
"source": "puts 'test'",
"source_digest": "*md5*",
"coverage": [null, 1, null]
}]
}`)
Or a CoverageReport
struct.
Beware: when analyzing a struct directly the values of the struct itself will be changed
report := &coverageanalysis.CoverageReport{FileReports: []FileReport{{LineCoverages: []LineCoverage{{Hits: 1, Ignore: false}, {Hits: 0, Ignore: false}, {Hits: 0, Ignore: false}, {Hits: 0, Ignore: true}}}}}
coverageanalysis.AnalyzeReport(report)
- Fork it ( https://github.com/flower-pot/coverageanalysis/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request