]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei-mirror: avoid make(1) jobserver warning
authorEric Wong <e@80x24.org>
Fri, 22 Sep 2023 18:37:16 +0000 (18:37 +0000)
committerEric Wong <e@80x24.org>
Fri, 22 Sep 2023 19:15:47 +0000 (19:15 +0000)
We can't control `make test' nor user-defined targets in
config.mak.  There's no need for a jobserver to run `make help',
anyways, so just let things be.

This also fixes the use of `gmake check' et al. on *BSDs where
various make flags confuse BSD make(1)

While we're at it, allow the test to run in the odd case make(1)
isn't available at all...

t/lei-mirror.t

index 9b5d73ec9b73851186dd11d0d99bc02f39a80413..0896149135b977df2a75d73b24f8a3a0482a5a68 100644 (file)
@@ -1,7 +1,7 @@
 #!perl -w
 # Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-use strict; use v5.10.1; use PublicInbox::TestCommon;
+use v5.12; use PublicInbox::TestCommon;
 use PublicInbox::Inbox;
 require_mods(qw(-httpd lei DBD::SQLite));
 require_cmd('curl');
@@ -26,11 +26,14 @@ test_lei({ tmpdir => $tmpdir }, sub {
        is(PublicInbox::Git::try_cat("$t1/description"),
                "mirror of $http/t1/\n", 'description set');
        ok(-f "$t1/Makefile", 'convenience Makefile added (v1)');
-       my $make = which('make');
-       is(xsys([$make, 'help'], undef, { -C => $t1, 1 => \(my $help) }), 0,
-               'make help');
+       SKIP: {
+               my $make = require_cmd('make', 1);
+               delete local @ENV{qw(MFLAGS MAKEFLAGS MAKELEVEL)};
+               is(xsys([$make, 'help'], undef, { -C => $t1, 1 => \(my $help) }),
+                       0, "$make handled Makefile without errors");
+               isnt($help, '', 'make help worked');
+       }
        ok(-f "$t1/inbox.config.example", 'inbox.config.example downloaded');
-       isnt($help, '', 'make help worked');
        is((stat(_))[9], $created{v1},
                'inbox.config.example mtime is ->created_at');
        is((stat(_))[2] & 0222, 0, 'inbox.config.example not writable');