From 0c0cc95455427ccd3484d9460a878418a63bb6c5 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Mon, 13 Apr 2015 14:42:36 +0200 Subject: [PATCH 1/2] Do not use MEMORYCHECK_SUPPRESSIONS_FILE The pull request #88 was reverted as it broke travis build. ctest uses a cache variable MEMCHECK_SUPPRESSION_FILE. It sets it during the `include(ctest)` evaluation. Cache variable are set on creation, they can not be modify after by a CMakeList.mk (except with set's FORCE option). ef5736eb5 sets MEMCHECK_SUPPRESSION_FILE as a normal variable. This does not set the cache variable as expected but rather create a second local variable (not part of the cache) with the same name. If cmake was run once (as during travis build since patch 4e41ff7, until its revert d17b931), the local variable has no effect thus the suppression file was never saved in the cache. If cmake was run twice, during the second time, as the cache version is not recreated (cache variables are persistent), the call to set MEMCHECK_SUPPRESSION_FILE changes the cache version as it was first expected. As a result the build worked if cmake was invoked twice but failed if only called once. For more information, see the *** Variable types in CMake *** section at: http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command%3aset This patch fixes all that by not using MEMCHECK_SUPPRESSION_FILE. but rather setting directly the option in valgrind. It is a clean fix as the MEMCHECK_SUPPRESSION_FILE is an option for the user to add a valgrind suppression file, it is not intended to be used by the project direcly. Signed-off-by: Kevin Rocard --- ctest/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctest/CMakeLists.txt b/ctest/CMakeLists.txt index c8cdbbb59..bc74a93d4 100644 --- a/ctest/CMakeLists.txt +++ b/ctest/CMakeLists.txt @@ -37,8 +37,8 @@ set(MEMORYCHECK_COMMAND_OPTIONS set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --error-exitcode=255 --log-fd=2") -# Ignore errors from third-partie libraries -set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_LIST_DIR}/valgrind.supp") +set(MEMORYCHECK_COMMAND_OPTIONS + "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_LIST_DIR}/valgrind.supp") # Enable tests, coverage, memcheck, ... # See http://www.cmake.org/Wiki/CMake/Testing_With_CTest#Dashboard_Preparation From 37c6d2e526e417f0e862faf70aad45c190c65a4a Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Mon, 13 Apr 2015 15:05:06 +0200 Subject: [PATCH 2/2] Revert "Revert "Merge pull request #88 from krocard/improve_travis_debug_build"" The pull request #88 was reverted as it broke travis build. In fact it only reveled a bug that was introduced in #80 (1b071fadd). The previous commit 0c0cc95 fixes the problem (cmake variable shadow). Revert the revert (d17b931a3dcc70cf9e) to restore the pull request #88. --- .travis.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 449dcad57..82ea908ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ install: # how to build script: + - ( mkdir build_debug && cd build_debug && + cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. && + make -j && + CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck ) - ( mkdir build && cd build && cmake .. && make -j && @@ -32,19 +36,14 @@ script: make && sudo make install && sudo ldconfig ) - - ( cd build && - cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. && - make -j && - sudo make install && - sudo ldconfig && - CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalCoverage ExperimentalMemCheck ) after_success: # Push coverage info on coveralls.io. # Ignore generated files, samples and tests - coveralls - --exclude "build/bindings/python" - --exclude "build/CMakeFiles" + --exclude "build_debug/bindings/python" + --exclude "build_debug/CMakeFiles" + --exclude "build" --exclude "skeleton-subsystem" --exclude "test/test-subsystem" --exclude "bindings/c/Test.cpp"