File tree 2 files changed +15
-5
lines changed 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ if(UNIX AND NOT APPLE)
141
141
endif ()
142
142
143
143
find_program (MEMORYCHECK_COMMAND valgrind)
144
+ if (NOT "${MEMORYCHECK_COMMAND} " STREQUAL "MEMORYCHECK_COMMAND-NOTFOUND" )
145
+ if (NOT WIN32 )
146
+ MESSAGE (STATUS "Valgrind found! Tests based on valgrind must be executed." )
147
+ endif ()
148
+ endif ()
149
+
144
150
# Set our extra command options for valgrind
145
151
# TODO: we need to come up with a better way to suppress "possibly lost" errors.
146
152
# Suppression file doesn't work because there is a ton of mangled names that won't remain stable.
Original file line number Diff line number Diff line change @@ -20,11 +20,15 @@ function(add_acceptance_tests TEST_NAME)
20
20
)
21
21
22
22
if (NOT WIN32 )
23
- # Add valgrind test
24
- add_valgrind_test(
25
- ${NAME_WITH_PREFIX} $<TARGET_FILE:${TARGET_NAME} >
26
- ${CMAKE_CURRENT_BINARY_DIR} /${TEST_NAME}
27
- )
23
+ if (COMMAND add_valgrind_test)
24
+ # Add valgrind test
25
+ add_valgrind_test(
26
+ ${NAME_WITH_PREFIX} $<TARGET_FILE:${TARGET_NAME} >
27
+ ${CMAKE_CURRENT_BINARY_DIR} /${TEST_NAME}
28
+ )
29
+ else ()
30
+ MESSAGE (STATUS "add_valgrind_test is defined in the top level of CXX-Qt. It will not executed" )
31
+ endif ()
28
32
endif ()
29
33
endfunction ()
30
34
You can’t perform that action at this time.
0 commit comments