Skip to content

Instantly share code, notes, and snippets.

@thewtex
Created May 9, 2017 18:34
Show Gist options
  • Save thewtex/cc7ade395c7aa309f38b137b8934e075 to your computer and use it in GitHub Desktop.
Save thewtex/cc7ade395c7aa309f38b137b8934e075 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -x
ctest -S KWDashboardScripts/metroplex_itk_codecov.cmake -V
cp KWDashboardScripts/itk_codecov.yml Tests/ITKCodeCov-build/codecov.yml
cd Tests/ITKCodeCov-build
# Capture coverage info
lcov --directory . --capture --output-file coverage.info
# Filter out system, third party files
lcov --remove coverage.info '/usr/*' '*KWStyle*' '*test*' '*ThirdParty*' '/usr/*' --output-file coverage.info
# Debug information
lcov --list coverage.info
# run gcov w/out `-b` which removes branches
find . -type f -name '*.gcno' -exec gcov -ip {} +
# Uploading report to CodeCov
export CODECOV_TOKEN="abc123-codecov-token
pushd ../ITK
sha=$(git rev-parse HEAD)
popd
bash <(curl -s https://codecov.io/bash) -X gcov -B master -C $sha || echo "Codecov did not collect coverage reports"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment