-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Valgrind test are now part of cmake/ctest
This change allow dependency validation and parallel testing.
- Loading branch information
Showing
6 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if (NOT Valgrind_FOUND) | ||
|
||
find_program(Valgrind_EXECUTABLE valgrind) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Valgrind DEFAULT_MSG Valgrind_EXECUTABLE) | ||
|
||
set(Valgrind_FOUND ${Valgrind_FOUND} CACHE BOOL "Flag whether Valgrind package was found") | ||
mark_as_advanced(Valgrind_FOUND Valgrind_EXECUTABLE) | ||
|
||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# - MACRO_ADD_VALGRIND_TEST(<args>) | ||
# | ||
# Calls add_test() with all the <args> but if on Win32 or Cygwin also adds the | ||
# directory where the Cgreen library is generated to the path so that it will | ||
# be used when running the test | ||
# | ||
# @thoni56/Thomas Nilefalk 2015-09-13 | ||
|
||
macro (macro_add_valgrind_test) | ||
find_package(Valgrind) | ||
if (Valgrind_FOUND) | ||
set( | ||
libname | ||
${CMAKE_FIND_LIBRARY_PREFIXES}${ARGN}${CMAKE_SHARED_LIBRARY_SUFFIX} | ||
) | ||
add_test( | ||
NAME valgrind_${libname} | ||
COMMAND sh -c "LD_LIBRARY_PATH=build/src valgrind --leak-check=full tools/cgreen-runner ${CMAKE_CURRENT_BINARY_DIR}/${libname} 2>1&" | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
) | ||
set_tests_properties( | ||
valgrind_${libname} PROPERTIES | ||
FAIL_REGULAR_EXPRESSION "(definitely|indirectly|possible) lost: [1-9]" | ||
) | ||
if (CYGWIN OR WIN32) | ||
set_tests_properties(${ARGV1} PROPERTIES ENVIRONMENT PATH=${PROJECT_BINARY_DIR}/src:$ENV{PATH}) | ||
endif () | ||
endif () | ||
endmacro(macro_add_valgrind_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters