]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
Makefile.PL: fix syntax for ASan and valgrind targets
authorEric Wong <e@80x24.org>
Wed, 30 Aug 2023 05:10:40 +0000 (05:10 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Aug 2023 05:27:33 +0000 (05:27 +0000)
Mixing various quoting and escaping rules between shell, make,
and Perl got confusing in Makefile.PL :x  This hopefully sorts
out my confusion.

We'll also fix and use TEST_XH_CXX_ONLY=1 to avoid needlessly
running the tests on the XS||SWIG implementation when we're
checking for memory errors.

Fixes: 2312ca26023fcbe3 (makefile: add targets for ASan and valgrind)
Makefile.PL
t/xap_helper.t

index 5865a2524315acd1f87ca88632a7dfb41422da3c..d23093365fc11309128e7dd6fa1079a39345c8ab 100644 (file)
@@ -264,12 +264,13 @@ lib/PublicInbox.pm : FORCE
        VERSION=\$(VERSION) \$(PERL) -w ./version-gen.perl
 
 test-asan : pure_all
-       CXXFLAGS='-O0 -Wall -ggdb3 -fsanitize=address' \
+       TEST_XH_CXX_ONLY=1 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'
+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
+       TEST_XH_CXX_ONLY=1 VALGRIND="valgrind \$(VG_OPT)" \\
+               prove -bvw t/xap_helper.t
 EOF
 }
index 73c1c849a0817463d33acf653e4bd92d06b2bec9..b68f2773d73c74ec96be127ae903bcc40ef0f604 100644 (file)
@@ -107,13 +107,12 @@ my $test = sub {
 };
 my $ar;
 
-my @NO_CXX;
-if (!$ENV{TEST_XH_CXX_ONLY}) {
+my @NO_CXX = (1);
+unless ($ENV{TEST_XH_CXX_ONLY}) {
        $ar = $test->(qw[-MPublicInbox::XapHelper -e
                        PublicInbox::XapHelper::start('-j0')]);
        $ar = $test->(qw[-MPublicInbox::XapHelper -e
                        PublicInbox::XapHelper::start('-j1')]);
-       push @NO_CXX, 0;
 }
 SKIP: {
        eval {
@@ -121,8 +120,8 @@ SKIP: {
                PublicInbox::XapHelperCxx::check_build();
        };
        skip "XapHelperCxx build: $@", 1 if $@;
-       push @NO_CXX, 1;
 
+       @NO_CXX = $ENV{TEST_XH_CXX_ONLY} ? (0) : (0, 1);
        $ar = $test->(qw[-MPublicInbox::XapHelperCxx -e
                        PublicInbox::XapHelperCxx::start('-j0')]);
        $ar = $test->(qw[-MPublicInbox::XapHelperCxx -e