Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1monQw-0001YJ-VN for pgsql-committers@arkaria.postgresql.org; Sun, 21 Nov 2021 14:03:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1monQu-0005V0-1a for pgsql-committers@arkaria.postgresql.org; Sun, 21 Nov 2021 14:03:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1monQt-0005Uq-QJ for pgsql-committers@lists.postgresql.org; Sun, 21 Nov 2021 14:03:03 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1monQm-0006Qe-Ko for pgsql-committers@lists.postgresql.org; Sun, 21 Nov 2021 14:03:02 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B79D61C0002; Sun, 21 Nov 2021 14:02:51 +0000 (UTC) Message-ID: <57050e42-7717-3131-1704-80ce0ad4a9f2@dunslane.net> Date: Sun, 21 Nov 2021 09:02:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: pgsql: Require version 0.98 of Test::More for TAP tests Content-Language: en-US To: Noah Misch , Tom Lane Cc: pgsql-committers@lists.postgresql.org References: <3369543.1637454364@sss.pgh.pa.us> <3369927.1637454743@sss.pgh.pa.us> <20211121003630.GA1362012@rfd.leadboat.com> <3371085.1637455802@sss.pgh.pa.us> <20211121011026.GB1362012@rfd.leadboat.com> From: Andrew Dunstan In-Reply-To: <20211121011026.GB1362012@rfd.leadboat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/20/21 20:10, Noah Misch wrote: > On Sat, Nov 20, 2021 at 07:50:02PM -0500, Tom Lane wrote: >> Noah Misch writes: >>> Yep. wrasse sets PERL to a manually-installed Perl, but PROVE still uses an >>> old Perl. I'll fix that somehow. >> A quick workaround is to set PROVE in the animal's config_env, but >> I don't think that's ideal, because configure then skips module >> presence tests: >> >> # Check for necessary modules, unless user has specified the "prove" to use; >> # in that case it's her responsibility to have a working configuration. >> # (prove might be part of a different Perl installation than perl, eg on >> # MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.) > The skip would be unnecessary if configure just tested whether $PROVE can run > a test requiring the module. We're testing $PERL, but we're actually > indifferent to $PERL's Test::More. Yeah, we could do something along these lines: andrew@emma:pg_head $ cat moduletest.pl use IPC::Run 0.79; use Test::More 0.98; use Time::HiRes 1.52; diag(""); diag("Test::More::VERSION: $Test::More::VERSION"); diag("IPC::Run::VERSION: $IPC::Run::VERSION"); diag("Tme::HiRes::VERSION: $Time::HiRes::VERSION"); ok(1); done_testing(); andrew@emma:pg_head $ prove moduletest.pl moduletest.pl .. # # Test::More::VERSION: 1.302183 # IPC::Run::VERSION: 20200505.0 # Tme::HiRes::VERSION: 1.9764 moduletest.pl .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.04 usr 0.01 sys + 0.13 cusr 0.02 csys = 0.20 CPU) Result: PASS If I hack up the test to fail I get: andrew@emma:pg_head $ prove moduletest.pl moduletest.pl .. Test::More version 9.98 required--this is only version 1.302183 at moduletest.pl line 2. BEGIN failed--compilation aborted at moduletest.pl line 2. moduletest.pl .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- moduletest.pl (Wstat: 65280 Tests: 0 Failed: 0)  Non-zero exit status: 255   Parse errors: No plan found in TAP output Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.12 cusr  0.02 csys =  0.18 CPU) Result: FAIL which is clear enough. prove is pretty much always a script - if we want to know which perl is invoked we could look at its shebang line. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com