Skip to content

Commit

Permalink
Submit GAP code coverage to coveralls.io
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Dec 21, 2018
1 parent 344ae6f commit 4616886
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Travis build Status](https://travis-ci.org/gap-system/gap.svg?branch=master)](https://travis-ci.org/gap-system/gap)
[![AppVeyor build Status](https://ci.appveyor.com/api/projects/status/github/gap-system/gap?branch=master&svg=true)](https://ci.appveyor.com/project/gap-system/gap)
[![Code Coverage](https://codecov.io/github/gap-system/gap/coverage.svg?branch=master&token=)](https://codecov.io/gh/gap-system/gap)
[![Coverage Status](https://coveralls.io/repos/github/gap-system/gap/badge.svg)](https://coveralls.io/github/gap-system/gap)

# What is GAP?

Expand Down
23 changes: 22 additions & 1 deletion etc/ci-gather-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,23 @@ od;
if Length(covs) > 0 then
Print("Merging ", Length(covs), " coverage files...\n");
r := MergeLineByLineProfiles(covs);;
Print("Outputting JSON\n");
# now remove "weird" entries, and entries for pkg files
prefix := Concatenation(GAPInfo.SystemEnvironment.PWD, "/");
r.line_info := Filtered(r.line_info, file ->
StartsWith(file[1], prefix) and
fail = PositionSublist(file[1], "/pkg/") and
IsReadableFile(file[1]) );
Print("Outputting JSON for Codecov...\n");
OutputJsonCoverage(r, "gap-coverage.json");;
if IsBound(GAPInfo.SystemEnvironment.TRAVIS_JOB_ID) then
Print("Outputting JSON for Coveralls...\n");
OutputCoverallsJsonCoverage(r, "gap-coveralls.json",
GAPInfo.SystemEnvironment.TRAVIS_JOB_ID,
prefix);
fi;
else
# Don't error, because we might want to gather
# gcov coverage, so just inform that we didn't find
Expand All @@ -61,3 +76,9 @@ GAPInput

# generate kernel coverage reports by running gcov
make coverage

# upload to coveralls.io
if [[ -f gap-coveralls.json ]]
then
curl -F json_file=@gap-coveralls.json "https://coveralls.io/api/v1/jobs"
fi

0 comments on commit 4616886

Please sign in to comment.