From bc561cd37847eebedf440c964441f4f2ee131eb3 Mon Sep 17 00:00:00 2001 From: Michael Timbert Date: Tue, 27 Aug 2024 09:29:50 +0200 Subject: [PATCH] Add MANIFEST check to tests --- MANIFEST.SKIP | 3 +++ t/manifest.t | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 t/manifest.t diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index c1e0a691..e71782f5 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -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 diff --git a/t/manifest.t b/t/manifest.t new file mode 100644 index 00000000..6ef40011 --- /dev/null +++ b/t/manifest.t @@ -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'; +};