Skip to content

Commit

Permalink
Add MANIFEST check to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTimbert committed Aug 27, 2024
1 parent 30af6c8 commit 7e55300
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ t/po-files.t

# Development mode aid for File::ShareDir
^lib/auto/share/dist/Zonemaster-CLI

# Avoid MANIFEST test
t/manifest.t
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ requires(
'Zonemaster::Engine' => 6.000000, # v6.0.0
);

test_requires 'Test::NoWarnings' => 0;

# Make all platforms include inc/Module/Install/External.pm
requires_external_bin 'find';
if ($^O eq "freebsd") {
Expand Down
37 changes: 37 additions & 0 deletions t/manifest.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!perl
use v5.14.2;
use strict;
use warnings;
use utf8;
use Test::More tests => 2;
use Test::NoWarnings;

use File::Basename qw( dirname );

chdir dirname( dirname( __FILE__ ) ) or BAIL_OUT( "chdir: $!" );

my $makebin = 'make';

sub make {
my @make_args = @_;

undef $ENV{MAKEFLAGS};

my $command = join( ' ', $makebin, '-s', @make_args );
my $output = `$command 2>&1`;

if ( $? == -1 ) {
BAIL_OUT( "failed to execute: $!" );
}
elsif ( $? & 127 ) {
BAIL_OUT( "child died with signal %d, %s coredump\n", ( $? & 127 ), ( $? & 128 ) ? 'with' : 'without' );
}

return $output, $? >> 8;
}

subtest "distcheck" => sub {
my ( $output, $status ) = make "distcheck";
is $status, 0, $makebin . ' distcheck exits with value 0';
is $output, "", $makebin . ' distcheck gives empty output';
};

0 comments on commit 7e55300

Please sign in to comment.