-
Notifications
You must be signed in to change notification settings - Fork 42
code coverage
Parent: Developer
On 2016-11-06, I set up oce
to get code-coverage tests. This was quite simple, involving just a few changes to the .travis.yml
file, namely adding covr
to r_packages
and adding a new after_success
item with a single entry that does the code coverage test. So now, when a git push
is done, and after travisCI
verifies that it builds and tests ok, a code-coverage scan is done. The results of that scan are shown in the codecov icon on the main oce webpage.
(Note that some of these tests are done locally, because the codecov setup relies on travisCI working and the latter is unreliable. For example, on Sat Nov 12, travisCI had problems with keyservers, so the builds were failing before getting anywhere close to oce itself.)
- 52.92% Sat Nov 12 15:46:31 2016 -0400 (commit ac8f090)
- 50.72% Sat Nov 12 11:36:33 2016 -0400 (commit a2ba9fa)
- 49.00% Sat Nov 12 11:14:42 2016 -0400 (commit 1da6237)
- 48.11% Sat Nov 12 10:28:56 2016 -0400 (commit 7c6d091)
- 45.25% Fri Nov 11 13:54:40 2016 -0400 (commit cca2300)
The tests may be run locally as follows. This is preferable, because it's faster and more reliable than the travisCI/codecov system. The only advantage of the codecov system is its view of source code, line by line.
library(covr)
options(covr.flags=c(CFLAGS="--coverage", CXXFLAGS="--coverage", LDFLAGS="--coverage"))
cov <- package_coverage(quiet=FALSE,type="all")
cov
to run the tests.