https://github.com/pcolby/lcoveralls
Report Gcov / LCOV (ie C, C++, Go, etc) code coverage to coveralls.io
https://github.com/pcolby/lcoveralls
codecoverage coveralls gcov lcov testcoverage
Last synced: 4 months ago
JSON representation
Report Gcov / LCOV (ie C, C++, Go, etc) code coverage to coveralls.io
- Host: GitHub
- URL: https://github.com/pcolby/lcoveralls
- Owner: pcolby
- License: apache-2.0
- Created: 2014-04-16T08:36:13.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-06-26T02:21:45.000Z (almost 6 years ago)
- Last Synced: 2024-09-17T14:03:23.428Z (9 months ago)
- Topics: codecoverage, coveralls, gcov, lcov, testcoverage
- Language: Ruby
- Homepage:
- Size: 98.6 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Lcoveralls
[](https://travis-ci.org/pcolby/lcoveralls)
[](https://rubygems.org/gems/lcoveralls)
[](https://github.com/pcolby/lcoveralls/releases/latest)
[](https://www.apache.org/licenses/LICENSE-2.0.html)Lcoveralls is a simple (Ruby) script for reporting code coverage results from
[LCOV](http://ltp.sourceforge.net/coverage/lcov.php) to [Coveralls](https://coveralls.io/).
Instead of invoking `gcov` directly, as some alternative projects do (quite successfully),
Lcoveralls depends on the tracefiles that LCOV generates from g++ / gcov's output.The benefit of using LCOV's tracefiles (aka *.info files) is two-fold:
1. LCOV's inclusion / exclusion logic is well proven, and time tested - no need
to reinvent that wheel; and
2. If you are already using LCOV to generate HTML output (as I usually do), then
you only need to define inclusions / exclusions once, instead of having to
define that information twice (and in two very different formats).Of course, the disadvantage to depending on LCOV, is the additional dependency -
not an issue for me, but I guess it could be for someone.## Installation
```
gem install lcoveralls
```## Usage
1. Build your project with gcov support.
2. Execute your test(s).
3. Execute `lcov` to generate tracefiles (aka *.info files).
4. Execute `lcoveralls` to submit the coverage report(s) to Coveralls.For example:
```
g++ -fprofile-arcs -ftest-coverage -O0 -o test
./test
lcov --capture ... && lcov --remove ...
lcoveralls [--token ]
```The token is not necessary when using Travis CI. Run `lcoveralls --help` for
more options.### Travis CI
To use Lcoveralls within Travis CI, simply install the gem, and then once all of
your tests have passed (including any necessary `lcov` invocations), invoke
lcoveralls.For example:
```
install:
- sudo apt-get install lcov rubygems
- gem install lcoveralls...
after_success:
- lcoveralls
```Note, if you are using Travis Pro, you should let Lcoveralls know via the
`--service` option, for example:```
after_success:
- lcoverals --service travis-pro
```Some real-word Travis CI examples:
Project | .travis.yml
--------|------------
[libqtaws](https://github.com/pcolby/libqtaws) | [.travis.yml](https://github.com/pcolby/libqtaws/blob/master/.travis.yml)
[pcp-pmda-cpp](https://github.com/pcolby/pcp-pmda-cpp) | [.travis.yml](https://github.com/pcolby/pcp-pmda-cpp/blob/master/.travis.yml)## License
Apache License 2.0