aboutsummaryrefslogtreecommitdiffstats
path: root/tools/Makefile.am
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-03-24 14:36:01 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-05-23 18:46:29 +0200
commit266a269af97fe60febe979fc02edda9e541c9c0c (patch)
tree06f6278122c582ea8012af0f061afd9f3d1f5935 /tools/Makefile.am
parent6d394a3f9629783772922abfc54e1db731e64361 (diff)
downloadhardware_replicant_libsamsung-ipc-266a269af97fe60febe979fc02edda9e541c9c0c.tar.gz
hardware_replicant_libsamsung-ipc-266a269af97fe60febe979fc02edda9e541c9c0c.tar.bz2
hardware_replicant_libsamsung-ipc-266a269af97fe60febe979fc02edda9e541c9c0c.zip
Autotools: add support for Valgrind for checks
This enables contributors to run Valgrind when running 'make check' for instance before sending patches. The --enable-valgrind option was used instead of using --enable-checking=valgrind like GCC uses as the code for that is much easier to get right. As Valgrind is very slow, I had to increase the timeouts in the ipc-modem tests. For now I settled on 60 seconds to have some margin for machines or setups that are potentially slower than the one I use. For the guix.scm, with Guix 1.3.0, Valgrind needs the ld.so .symtab to work, so as Valgrind doesn't know where to find them, so we had to use --extra-debuginfo-path for that. This is also why we pass '-v' to valgrind as it prints message explaining the issue when it doesn't find the required symbols. And we also needed a trick mentioned in the Guix mailing list[1] to find the right path for the debug information as the glibc being used by packages isn't exported publicly. [1]https://lists.gnu.org/archive/html/help-guix/2022-03/msg00036.html The proper fix will be merged in the next Guix release (merging it now is not possible since it would require to rebuild everything, and that is only possible with new releases). A temporary workaround with 4d1a88312cbebb10d47905d6d023953ac85bcd04 (gnu: valgrind: Allow ld.so symbols to be found.) was also merged in the current Guix so it is possible to get it with guix pull, but here it's probably better to stick with a workaround in the guix.scm for now as this also enables to use older guix revisions for testing. Thanks to the people on #guix on Liberachat for helping me to solve this Valgrind issue. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'tools/Makefile.am')
-rw-r--r--tools/Makefile.am3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 7f51630..c1e8cc3 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -13,6 +13,9 @@ bin_PROGRAMS = \
# TODO: Find a way to make test more modular and represent each run of the
# nv_data-imei in TEST while having it implemented in a single python file
+if WANT_VALGRIND_CHECKING
+AM_TESTS_ENVIRONMENT = VALGRIND='$(VALGRIND)'; export VALGRIND;
+endif
PY_LOG_COMPILER = $(PYTHON)
TEST_EXTENSIONS = .py
TESTS = tests/ipc-modem.py \