Skip to content

Commit

Permalink
Make distcheck as a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattias-p committed May 17, 2021
1 parent 8602426 commit 23a5905
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ t/asn.data
t/asn.t
t/dnsname.t
t/logger.t
t/manifest.t
t/nameserver-axfr.data
t/nameserver-axfr.t
t/nameserver.data
Expand Down
38 changes: 38 additions & 0 deletions t/manifest.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!perl
use v5.14.2;
use strict;
use warnings;
use utf8;
use Test::More tests => 1;

use File::Basename qw( dirname );

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

my $makebin = 'make';
if ($^O eq "freebsd") {
# This unit test requires GNU Make
$makebin = 'gmake';
};

sub make {
my @make_args = @_;

my $command = join( ' ', $makebin, '--silent', '--no-print-directory', @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 "no fuzzy marks" => 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 23a5905

Please sign in to comment.