]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
makefile: add targets for ASan and valgrind
authorEric Wong <e@80x24.org>
Sat, 26 Aug 2023 06:13:15 +0000 (06:13 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Aug 2023 20:47:52 +0000 (20:47 +0000)
I would never consider working on C++ code without at least one
one of these tools present.

Makefile.PL

index 710d705dbecd00c5dee693c19856e7c2084cf48e..5865a2524315acd1f87ca88632a7dfb41422da3c 100644 (file)
@@ -262,5 +262,14 @@ symlink-install : lib/PublicInbox.pm
 pure_all :: lib/PublicInbox.pm
 lib/PublicInbox.pm : FORCE
        VERSION=\$(VERSION) \$(PERL) -w ./version-gen.perl
+
+test-asan : pure_all
+       CXXFLAGS='-O0 -Wall -ggdb3 -fsanitize=address' \
+               prove -bvw t/xap_helper.t
+
+VG_OPT = '-v --trace-children=yes --track-fds=yes'
+VG_OPT += ' --leak-check=yes --track-origins=yes'
+test-valgrind : pure_all
+       VALGRIND="valgrind \$\$(VG_OPT)" prove -bvw t/xap_helper.t
 EOF
 }