From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BBE6E1F461 for ; Wed, 30 Aug 2023 05:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1693372245; bh=438QOdvet6uxnA0CY+/H1mtHXWJxYUGKVpvSOXF7rYo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KwAbo46Y/MBgqqSM7hpLpPeanduQEWoX6dyXKR8DUFnlYyHdtscCmGp969cw+dQ3O B9l5R1QtvfYEaw5kiLhnyzJHhKhvwWVpvFoei9tCthjKxhoHsxCfFSPAJSeKnxKCtJ /oZ0qvX7S7YJZxUGoQyRStZ58jwfrVX4HU0E6bnk= From: Eric Wong 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 Message-Id: <20230830051045.330641-3-e@80x24.org> In-Reply-To: <20230830051045.330641-1-e@80x24.org> References: <20230830051045.330641-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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