Skip to content

Commit

Permalink
Merge 6de29d0 into 4616886
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspf committed Dec 22, 2018
2 parents 4616886 + 6de29d0 commit c848153
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ env:
- LDFLAGS="--coverage"
# default config flags: enable debug asserts
- CONFIGFLAGS="--enable-debug"
- COVERALLS_PARALLEL=true

addons:
apt_packages:
- libgmp-dev
- libreadline-dev
- python
- python-pip

#
# The following test jobs are roughly sorted by duration, from longest to
Expand Down Expand Up @@ -128,6 +131,7 @@ matrix:
script:
- set -e
- etc/travis_fastfail.sh
- pip install --user cpp-coveralls
- bash etc/ci-prepare.sh
- bash etc/ci.sh

Expand All @@ -142,3 +146,5 @@ notifications:
on_pull_requests: false
on_success: change # default: always
on_failure: change # default: always
webhooks: https://coveralls.io/webhook

12 changes: 10 additions & 2 deletions etc/ci-gather-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,16 @@ GAPInput
# generate kernel coverage reports by running gcov
make coverage

coveralls --follow-symlinks --dump c-coveralls.json -n -e pkg/ -e bin/ -e etc/ -e extern/ -e gen/ -e tst/ -e julia*/

cat c-coveralls.json

etc/coveralls-merge.py

# upload to coveralls.io
if [[ -f gap-coveralls.json ]]
# TODO: perhaps fold into python script?
if [[ -f merged-coveralls.json ]]
then
curl -F json_file=@gap-coveralls.json "https://coveralls.io/api/v1/jobs"
curl -F json_file=@merged-coveralls.json "https://coveralls.io/api/v1/jobs"
fi

32 changes: 32 additions & 0 deletions etc/coveralls-merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python

# Hacked up merger for testing

import json
import os
import os.path

print("Merging coveralls json coverage")
merged = { 'service_name': 'travis-ci'
, 'service_job_id': os.environ['TRAVIS_JOB_ID']
, 'source_files': [] }

for fn in ['gap-coveralls.json', 'c-coveralls.json']:
print "file: %s" % (fn,),
if os.path.isfile(fn):
f = open(fn, 'r')
cover = json.load(f)
merged['source_files'].extend(cover['source_files'])
f.close()
print(" done.")
else:
print(" not found.")

if len(merged['source_files']) > 0:
print("Writing merged profiles to merged-coveralls.json")
dump = open('merged-coveralls.json', 'w+')
json.dump(merged, dump)
dump.close()
else:
print("No coverage found.")
print("Done. Bye.")

0 comments on commit c848153

Please sign in to comment.