diff options
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | src/valgrind.sh | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6f2cc6b..d082a4a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,3 +64,5 @@ add_my_executable(worker worker_main.c worker.c process.c signal.c) target_link_libraries(worker PRIVATE git2 pthread) + +install(PROGRAMS valgrind.sh DESTINATION bin RENAME "${PROJECT_NAME}-valgrind") diff --git a/src/valgrind.sh b/src/valgrind.sh new file mode 100755 index 0000000..7223092 --- /dev/null +++ b/src/valgrind.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +shopt -s inherit_errexit lastpipe + +if ! command -v valgrind &> /dev/null; then + echo 'Please make sure valgrind is available.' >&2 + exit 1 +fi + +valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose "$@" |