From 41edcfc05116323d32ad7a8b69c437bb3ec5bd5f Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 03:46:54 +0200 Subject: [PATCH 1/7] Trying out codecov.io --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dd3282b..f3e3f6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ script: - make test after_success: - make coveralls +- bash <(curl -s https://codecov.io/bash) after_failure: - cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err} env: From 3aaabf1c83075fe7c81f1a6c68d4a79f6a2fd7b3 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 03:58:47 +0200 Subject: [PATCH 2/7] Restored appveyor support for coverage --- appveyor.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index c277651..0db9e50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,7 @@ os: Visual Studio 2015 init: - git config --global core.autocrlf input + - 'SET PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH%' - 'SET PATH=C:\MinGW\bin;%PATH%;C:\MinGW\msys\1.0\bin;%APPVEYOR_BUILD_FOLDER%\build;%APPVEYOR_BUILD_FOLDER%\build\Debug' environment: @@ -28,6 +29,7 @@ configuration: Release install: - ps: $env:RELEASE_NAME = $env:APPVEYOR_REPO_BRANCH -replace "/", "-" + - pip install codecov # Hack to make git think it is on the tip of the repo branch - 'git checkout -B %APPVEYOR_REPO_BRANCH%' # Configure project @@ -55,6 +57,9 @@ test_script: - cmake --build . --target criterion_tests - ps: try { ctest } catch { type Testing/Temporary/LastTest.log } +after_test: + - 'make coveralls_generate' + - codecov #after_test: # - 'make coveralls' From e704c07341db1e8de0ef41b2a35eff2c83bbb13a Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 04:12:34 +0200 Subject: [PATCH 3/7] Removed dependencies from coverage report --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f3e3f6d..ff1e5f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ script: - make test after_success: - make coveralls -- bash <(curl -s https://codecov.io/bash) +- bash <(curl -s https://codecov.io/bash) -g 'dependencies/*' after_failure: - cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err} env: From d4d29f6023eed76e5caa99c3500d42f8cdad54ad Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 04:52:44 +0200 Subject: [PATCH 4/7] Added manual gcov target --- .travis.yml | 2 +- CMakeLists.txt | 6 ++++++ appveyor.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff1e5f4..609e424 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ script: - make criterion_tests - make test after_success: -- make coveralls +- make gcov VERBOSE=1 - bash <(curl -s https://codecov.io/bash) -g 'dependencies/*' after_failure: - cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err} diff --git a/CMakeLists.txt b/CMakeLists.txt index fb1f647..450932b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,12 @@ install(TARGETS criterion add_custom_target(criterion_tests) +file(GLOB_RECURSE GCNO_FILES "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/*.gcno") + +add_custom_target(gcov + "gcov" "-lcp" ${GCNO_FILES} +) + enable_testing() add_subdirectory(samples) add_subdirectory(test) diff --git a/appveyor.yml b/appveyor.yml index 0db9e50..aff5c8a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -58,7 +58,7 @@ test_script: - ps: try { ctest } catch { type Testing/Temporary/LastTest.log } after_test: - - 'make coveralls_generate' + - 'make gcov' - codecov #after_test: # - 'make coveralls' From 6faf505089159bfa5b9201d28cf36fb19b907f78 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 05:11:06 +0200 Subject: [PATCH 5/7] Specified correct gcov params for codecov script --- .cmake/Modules/Gcov.cmake | 26 ++++++++++++++++++++++++++ .travis.yml | 4 ++-- CMakeLists.txt | 7 ++++--- appveyor.yml | 2 ++ 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .cmake/Modules/Gcov.cmake diff --git a/.cmake/Modules/Gcov.cmake b/.cmake/Modules/Gcov.cmake new file mode 100644 index 0000000..a9e69a9 --- /dev/null +++ b/.cmake/Modules/Gcov.cmake @@ -0,0 +1,26 @@ + +if (NOT DEFINED ENV{GCOV}) + find_program(GCOV_EXECUTABLE gcov) +else() + find_program(GCOV_EXECUTABLE $ENV{GCOV}) +endif() + +#file(GLOB_RECURSE GCNO_FILES "${CMAKE_CURRENT_BINARY_DIR}/*.gcno") +if (WIN32) + file(GLOB_RECURSE GCDA_FILES "${COV_PATH}\\*.gcda") +else () + file(GLOB_RECURSE GCDA_FILES "${COV_PATH}/*.gcda") +endif () + +#execute_process( +# COMMAND ${GCOV_EXECUTABLE} -lcp ${GCNO_FILES} +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +#) + +foreach (GCDA ${GCDA_FILES}) + get_filename_component(DIR ${GCDA} PATH) + execute_process( + COMMAND ${GCOV_EXECUTABLE} -lcp -o ${DIR} ${GCDA} + WORKING_DIRECTORY ${COV_PATH} + ) +endforeach () diff --git a/.travis.yml b/.travis.yml index 609e424..10e19f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,8 @@ script: - make criterion_tests - make test after_success: -- make gcov VERBOSE=1 -- bash <(curl -s https://codecov.io/bash) -g 'dependencies/*' +- make gcov +- bash <(curl -s https://codecov.io/bash) after_failure: - cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err} env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 450932b..8fead66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,10 +170,11 @@ install(TARGETS criterion add_custom_target(criterion_tests) -file(GLOB_RECURSE GCNO_FILES "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/*.gcno") - add_custom_target(gcov - "gcov" "-lcp" ${GCNO_FILES} + "${CMAKE_COMMAND}" + -DSOURCE_FILES="${SOURCE_FILES}" + -DCOV_PATH="${CMAKE_CURRENT_BINARY_DIR}" + -P "${CMAKE_MODULE_PATH}/Gcov.cmake" ) enable_testing() diff --git a/appveyor.yml b/appveyor.yml index aff5c8a..5462660 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,6 +59,8 @@ test_script: after_test: - 'make gcov' + - 'cd ..' + - 'bash -lc "find / -iname \"*.gcda\""' - codecov #after_test: # - 'make coveralls' From 01ead0a87b3266d55a0996b0901fb13cfe6409df Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 14:55:35 +0200 Subject: [PATCH 6/7] Switched readme coverage status to codecov --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 791881c..28f15f5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Unix Build Status](https://travis-ci.org/Snaipe/Criterion.svg?branch=bleeding)](https://travis-ci.org/Snaipe/Criterion) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/Snaipe/Criterion?svg=true&branch=bleeding)](https://ci.appveyor.com/project/Snaipe/Criterion/branch/bleeding) -[![Coverage Status](https://coveralls.io/repos/Snaipe/Criterion/badge.svg?branch=bleeding)](https://coveralls.io/r/Snaipe/Criterion?branch=bleeding) +[![Coverage Status](https://img.shields.io/codecov/c/github/Snaipe/Criterion/bleeding.svg)](https://codecov.io/github/Snaipe/Criterion?branch=bleeding) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Snaipe/Criterion/blob/master/LICENSE) [![Version](https://img.shields.io/github/tag/Snaipe/Criterion.svg?label=version&style=flat)](https://github.com/Snaipe/Criterion/releases) From 45045b3774fc4fe79c612cd79b1ca7e4bef7298e Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 16 Sep 2015 01:21:20 +0200 Subject: [PATCH 7/7] Removed coverage on appveyor builds --- appveyor.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5462660..c277651 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,6 @@ os: Visual Studio 2015 init: - git config --global core.autocrlf input - - 'SET PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH%' - 'SET PATH=C:\MinGW\bin;%PATH%;C:\MinGW\msys\1.0\bin;%APPVEYOR_BUILD_FOLDER%\build;%APPVEYOR_BUILD_FOLDER%\build\Debug' environment: @@ -29,7 +28,6 @@ configuration: Release install: - ps: $env:RELEASE_NAME = $env:APPVEYOR_REPO_BRANCH -replace "/", "-" - - pip install codecov # Hack to make git think it is on the tip of the repo branch - 'git checkout -B %APPVEYOR_REPO_BRANCH%' # Configure project @@ -57,11 +55,6 @@ test_script: - cmake --build . --target criterion_tests - ps: try { ctest } catch { type Testing/Temporary/LastTest.log } -after_test: - - 'make gcov' - - 'cd ..' - - 'bash -lc "find / -iname \"*.gcda\""' - - codecov #after_test: # - 'make coveralls'