From dcff4c2036a4d5bf2a8357b8a04ef6f8f7cf39aa Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 23:16:50 +0200 Subject: [PATCH] add coveralls coverage reporting --- .travis.yml | 4 ++++ coveralls | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 coveralls diff --git a/.travis.yml b/.travis.yml index e19ad40a..4b221096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,8 +36,12 @@ install: before_script: - mkdir build - cd build + - if [[ "$CXX" = "g++" && "$CONFIG" = "Debug" ]]; then export CXXFLAGS="--coverage"; fi - cmake .. -DCMAKE_BUILD_TYPE=$CONFIG script: - cmake --build . --config $CONFIG - ctest --output-on-failure + +after_script: + - ../coveralls diff --git a/coveralls b/coveralls new file mode 100755 index 00000000..301d67f7 --- /dev/null +++ b/coveralls @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ 0 -eq $(find -iname *.gcda | wc -l) ] +then + exit 0 +fi + +gcov --source-prefix ${TRAVIS_BUILD_DIR} --preserve-paths --relative-only $(find -iname *.gcda) 1>/dev/null || exit 0 + +cat >coverage.json <>coverage.json <coverage.json <(head -n -1 coverage.json.tmp) <(echo -e " }\n ]\n}") +curl -F json_file=@coverage.json https://coveralls.io/api/v1/jobs