unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/7] Makefile.PL: fix syntax for ASan and valgrind targets
Date: Wed, 30 Aug 2023 05:10:40 +0000	[thread overview]
Message-ID: <20230830051045.330641-3-e@80x24.org> (raw)
In-Reply-To: <20230830051045.330641-1-e@80x24.org>

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    | 9 +++++----
 t/xap_helper.t | 7 +++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 5865a252..d2309336 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -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
 }
diff --git a/t/xap_helper.t b/t/xap_helper.t
index 73c1c849..b68f2773 100644
--- a/t/xap_helper.t
+++ b/t/xap_helper.t
@@ -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

  parent reply	other threads:[~2023-08-30  5:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  5:10 [PATCH 0/7] various build fixes + OpenBSD compat Eric Wong
2023-08-30  5:10 ` [PATCH 1/7] treewide: drop MSG_EOR with AF_UNIX+SOCK_SEQPACKET Eric Wong
2023-08-30  5:10 ` Eric Wong [this message]
2023-08-30  5:10 ` [PATCH 3/7] Makefile.PL: depend on autodie, at least for tests Eric Wong
2023-08-30  5:10 ` [PATCH 4/7] t/kqnotify: improve test reliability on OpenBSD Eric Wong
2023-08-30  5:10 ` [PATCH 5/7] xap_helper.h: don't compress debug sections " Eric Wong
2023-08-30  5:10 ` [PATCH 6/7] xap_helper.h: limit stderr assignment to glibc+FreeBSD Eric Wong
2023-08-30  5:10 ` [PATCH 7/7] xap_helper.h: fix double-free on OpenBSD hdestroy Eric Wong
2023-08-30 12:34 ` [PATCH 0/7] various build fixes + OpenBSD compat, " Štěpán Němec
2023-08-30 21:18   ` Eric Wong
2023-08-31  9:11     ` Štěpán Němec
2023-08-31 17:26       ` Štěpán Němec
2023-09-01 11:09         ` Eric Wong
2023-09-02 10:54           ` Štěpán Němec
2023-09-02 11:07             ` [PATCH v2] Clarify Inline::C dependency (optional on Linux, required elsewhere) Štěpán Němec
2023-09-02 18:50               ` Eric Wong
2023-09-02 19:08                 ` Štěpán Němec
2023-09-02 19:44                   ` Eric Wong
2023-09-02 20:45                     ` Štěpán Němec
2023-09-02 20:56                       ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230830051045.330641-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).