mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
tests: execute leak checker via CTest directly
Right now, we have an awful hack in our test CI setup that extracts the test command from CTest's output and then prepends the leak checker. This is dependent on non-machine-parseable output from CMake and also breaks on various ocassions, like for example when we have spaces in the current path or when the path contains backslashes. Both conditions may easily be triggered on Win32 systems, and in fact they do break our Azure Pipelines builds. Remove the awful hack in favour of a new CMake build option "USE_LEAK_CHECKER". If specifying e.g. "-DUSE_LEAK_CHECKER=valgrind", then we will set up all tests to be run under valgrind. Like this, we can again simply execute ctest without needing to rely on evil sourcery.
This commit is contained in:
6
script/leaks.sh
Executable file
6
script/leaks.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
export MallocStackLogging=1
|
||||
export MallocScribble=1
|
||||
export MallocLogFile=/dev/null
|
||||
export CLAR_AT_EXIT="leaks -quiet \$PPID"
|
||||
exec "$@"
|
||||
2
script/valgrind.sh
Executable file
2
script/valgrind.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exec valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions="$(dirname "${BASH_SOURCE[0]}")/valgrind.supp" "$@"
|
||||
114
script/valgrind.supp
Normal file
114
script/valgrind.supp
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
ignore-zlib-errors-cond
|
||||
Memcheck:Cond
|
||||
obj:*libz.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-giterror-set-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:giterror_set
|
||||
}
|
||||
|
||||
{
|
||||
ignore-git-global-state-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:git__global_state
|
||||
}
|
||||
|
||||
{
|
||||
ignore-openssl-ssl-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
obj:*libssl.so*
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
ignore-openssl-crypto-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
obj:*libcrypto.so*
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
ignore-openssl-crypto-cond
|
||||
Memcheck:Cond
|
||||
obj:*libcrypto.so*
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
ignore-glibc-getaddrinfo-cache
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:__check_pf
|
||||
}
|
||||
|
||||
{
|
||||
ignore-curl-global-init
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:curl_global_init
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-control-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_control
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-mpinew-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_mpi_new
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-mpiscan-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_mpi_scan
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-randomize-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_randomize
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-sexpfindtoken-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_sexp_find_token
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-libssh2-gcrypt-pksign-leak
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:gcry_pk_sign
|
||||
obj:*libssh2.so*
|
||||
}
|
||||
|
||||
{
|
||||
ignore-noai6ai_cached-double-free
|
||||
Memcheck:Free
|
||||
fun:free
|
||||
fun:__libc_freeres
|
||||
...
|
||||
fun:exit
|
||||
...
|
||||
}
|
||||
Reference in New Issue
Block a user