Skip to content

Commit

Permalink
Remove valgrind warning on windows (#768)
Browse files Browse the repository at this point in the history
Valgrind can't be use on windows.
  • Loading branch information
Montel authored Jan 4, 2024
1 parent 2a181f3 commit 0c5c473
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ enable_testing()
# Create helper method which adds a valgrind test with the given binary
function(add_valgrind_test NAME_WITH_PREFIX BINARY WORKING_DIRECTORY)
if("${MEMORYCHECK_COMMAND}" STREQUAL "MEMORYCHECK_COMMAND-NOTFOUND")
MESSAGE(STATUS "valgrind not found. Please install it")
if (NOT WIN32)
MESSAGE(STATUS "valgrind not found. Please install it")
endif()
else()
add_test(NAME ${NAME_WITH_PREFIX}_valgrind
COMMAND ${MEMORYCHECK_COMMAND} ${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${MEMORYCHECK_SUPPRESSIONS_FILE} --gen-suppressions=all ${BINARY}
Expand Down
12 changes: 7 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ function(add_acceptance_tests TEST_NAME)
${CPP_TEST_NAME} PROPERTIES ENVIRONMENT_MODIFICATION "${RUNTIME_ENV}"
)

# Add valgrind test
add_valgrind_test(
${NAME_WITH_PREFIX} $<TARGET_FILE:${TARGET_NAME}>
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}
)
if (NOT WIN32)
# Add valgrind test
add_valgrind_test(
${NAME_WITH_PREFIX} $<TARGET_FILE:${TARGET_NAME}>
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}
)
endif()
endfunction()

# Add tests for all the acceptance tests
Expand Down

0 comments on commit 0c5c473

Please sign in to comment.