From 6faf505089159bfa5b9201d28cf36fb19b907f78 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 4 Sep 2015 05:11:06 +0200 Subject: [PATCH] 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'