diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-06 16:16:36 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-06 16:24:23 +0200 |
commit | c4a7f0970b6f43e2e89d81e9917de023032641cc (patch) | |
tree | 9eba34b5e803b01f89444e4f2c971c5d0ed551a6 | |
parent | add a TODO note (diff) | |
download | cimple-c4a7f0970b6f43e2e89d81e9917de023032641cc.tar.gz cimple-c4a7f0970b6f43e2e89d81e9917de023032641cc.zip |
add a cimple-valgrind executable
-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 "$@" |