1
0
mirror of https://gitlab.com/bzip2/bzip2.git synced 2025-07-30 07:23:05 +03:00
Files
bzip2/cmake/FindValgrind.cmake
Micah Snyder 2a22f41879 Tests: Remodel test suite; Add large test suite
Remodel test suite using Python unittests.

Add more thorough test cases for original "quick" test suite.
Add in automatic Valgrind testing for the "quick" test suite on Linux if
Valgrind was detected at build-time.

Add larger suite of assorted .bz2 test files as git submodule.

Updates to the Compiling documentation.

Increased the minimum Meson version to 0.56 because this commit uses the
`fs` module that was introduced in 0.56.

Added Python 3's `pytest` as a required module for running the tests
when using Meson.
2022-07-17 04:40:54 +00:00

37 lines
1.2 KiB
CMake

#
# Find the Valgrind program.
#
# If found, will set: Valgrind_FOUND, Valgrind_VERSION, and Valgrind_EXECUTABLE
#
# If you have a custom install location for Valgrind, you can provide a hint
# by settings -DValgrind_HOME=<directory containing valgrind>
#
find_program(Valgrind_EXECUTABLE valgrind
HINTS "${Valgrind_HOME}"
PATH_SUFFIXES "bin"
)
if(Valgrind_EXECUTABLE)
execute_process(COMMAND "${Valgrind_EXECUTABLE}" --version
OUTPUT_VARIABLE Valgrind_VERSION_OUTPUT
ERROR_VARIABLE Valgrind_VERSION_ERROR
RESULT_VARIABLE Valgrind_VERSION_RESULT
)
if(NOT ${Valgrind_VERSION_RESULT} EQUAL 0)
message(STATUS "Valgrind not found: Failed to determine version.")
unset(Valgrind_EXECUTABLE)
else()
string(REGEX
MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?(-nightly)?"
Valgrind_VERSION "${Valgrind_VERSION_OUTPUT}"
)
set(Valgrind_VERSION "${Valgrind_VERSION}")
set(Valgrind_FOUND 1)
message(STATUS "Valgrind found: ${Valgrind_EXECUTABLE}, ${Valgrind_VERSION}")
endif()
mark_as_advanced(Valgrind_EXECUTABLE Valgrind_VERSION)
else()
message(STATUS "Valgrind not found.")
endif()