From 644c99e7d316e7f88013a4194660b6d48780f9b4 Mon Sep 17 00:00:00 2001 From: Michael Timbert Date: Mon, 19 Aug 2024 15:40:22 +0200 Subject: [PATCH 1/2] Add MANIFEST check to tests --- MANIFEST.SKIP | 4 ++++ Makefile.PL | 1 + t/manifest.t | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 t/manifest.t diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index e32c8947..24749fd0 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -131,4 +131,8 @@ # Avoid MYMETA files ^MYMETA\. + +# Avoid MANIFEST test +t/manifest.t + #!end included /usr/share/perl/5.20/ExtUtils/MANIFEST.SKIP diff --git a/Makefile.PL b/Makefile.PL index e8785602..b2316301 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -127,6 +127,7 @@ test_requires 'MIME::Base32' => 0; test_requires 'Test::Fatal' => 0; test_requires 'Test::Differences' => 0; test_requires 'Test::More' => 1.302015; +test_requires 'Test::NoWarnings' => 0; use_ppport 3.19; cc_include_paths 'include'; diff --git a/t/manifest.t b/t/manifest.t new file mode 100644 index 00000000..cc74820c --- /dev/null +++ b/t/manifest.t @@ -0,0 +1,35 @@ +#!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 = @_; + + 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'; +}; From fb456951c67c69af07be51998d39bac07bc5c0ee Mon Sep 17 00:00:00 2001 From: Michael Timbert Date: Tue, 20 Aug 2024 12:06:29 +0200 Subject: [PATCH 2/2] update t/manifest.t --- t/manifest.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/manifest.t b/t/manifest.t index cc74820c..6ef40011 100644 --- a/t/manifest.t +++ b/t/manifest.t @@ -15,6 +15,8 @@ my $makebin = 'make'; sub make { my @make_args = @_; + undef $ENV{MAKEFLAGS}; + my $command = join( ' ', $makebin, '-s', @make_args ); my $output = `$command 2>&1`;