From a1cdbb8e3da850d11692c3cbcfabd3760ad012dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=A4iv=C3=A4rinta?= Date: Mon, 17 May 2021 12:03:42 +0200 Subject: [PATCH 1/2] Make distcheck as a unit test We need to clean up the zonemaster-ldns directory in CI to stay clear of manifest.t. --- .github/workflows/ci.yml | 1 + MANIFEST | 1 + Makefile.PL | 1 + docs/Installation.md | 7 ++++--- t/manifest.t | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 t/manifest.t diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14fb4dba9..6476acf64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,7 @@ jobs: git clone --branch=develop --depth=1 https://github.com/zonemaster/zonemaster-ldns.git perl Makefile.PL # Generate MYMETA.yml to appease cpanm . ( cd zonemaster-ldns ; cpanm --notest . ) + rm -rf zonemaster-ldns - name: Install remaining dependencies run: | diff --git a/MANIFEST b/MANIFEST index d6f349ccd..cdab4e9d8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -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 diff --git a/Makefile.PL b/Makefile.PL index ea1bf84ee..78b477a58 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -40,6 +40,7 @@ test_requires 'Pod::Coverage' => 0; test_requires 'Test::Differences' => 0; test_requires 'Test::Exception' => 0; test_requires 'Test::Fatal' => 0; +test_requires 'Test::NoWarnings' => 0; test_requires 'Test::Pod' => 1.22; # Make all platforms include inc/Module/Install/External.pm diff --git a/docs/Installation.md b/docs/Installation.md index 6984fbb14..a5bcb2a9a 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -39,7 +39,7 @@ This instruction covers the following operating systems: 3) Install binary packages: ```sh - sudo yum --assumeyes install cpanminus gcc libidn-devel openssl-devel perl-Clone perl-core perl-Devel-CheckLib perl-Email-Valid perl-File-ShareDir perl-File-Slurp perl-libintl perl-IO-Socket-INET6 perl-JSON-PP perl-List-MoreUtils perl-Module-Find perl-Moose perl-Net-IP perl-Pod-Coverage perl-Readonly perl-Test-Differences perl-Test-Exception perl-Test-Fatal perl-Test-Pod perl-Text-CSV perl-YAML + sudo yum --assumeyes install cpanminus gcc libidn-devel openssl-devel perl-Clone perl-core perl-Devel-CheckLib perl-Email-Valid perl-File-ShareDir perl-File-Slurp perl-libintl perl-IO-Socket-INET6 perl-JSON-PP perl-List-MoreUtils perl-Module-Find perl-Moose perl-Net-IP perl-Pod-Coverage perl-Readonly perl-Test-Differences perl-Test-Exception perl-Test-Fatal perl-Test-NoWarnings perl-Test-Pod perl-Text-CSV perl-YAML ``` 4) Install packages from CPAN: @@ -77,7 +77,7 @@ This instruction covers the following operating systems: 2) Install dependencies from binary packages: ```sh - sudo apt install autoconf automake build-essential cpanminus libclone-perl libdevel-checklib-perl libemail-valid-perl libfile-sharedir-perl libfile-slurp-perl libidn11-dev libintl-perl libio-socket-inet6-perl libjson-pp-perl liblist-moreutils-perl liblocale-msgfmt-perl libmodule-find-perl libmodule-install-perl libmodule-install-xsutil-perl libmoose-perl libmoosex-singleton-perl libnet-ip-perl libpod-coverage-perl libreadonly-xs-perl libssl-dev libtest-differences-perl libtest-exception-perl libtest-fatal-perl libtest-pod-perl libtext-csv-perl libtool m4 + sudo apt install autoconf automake build-essential cpanminus libclone-perl libdevel-checklib-perl libemail-valid-perl libfile-sharedir-perl libfile-slurp-perl libidn11-dev libintl-perl libio-socket-inet6-perl libjson-pp-perl liblist-moreutils-perl liblocale-msgfmt-perl libmodule-find-perl libmodule-install-perl libmodule-install-xsutil-perl libmoose-perl libmoosex-singleton-perl libnet-ip-perl libpod-coverage-perl libreadonly-xs-perl libssl-dev libtest-differences-perl libtest-exception-perl libtest-fatal-perl libtest-nowarnings-perl libtest-pod-perl libtext-csv-perl libtool m4 ``` 3) Install Zonemaster::LDNS and Zonemaster::Engine. @@ -123,8 +123,9 @@ This instruction covers the following operating systems: 5) Install dependencies from binary packages: ```sh - pkg install devel/gmake libidn p5-App-cpanminus p5-Clone p5-Devel-CheckLib p5-Email-Valid p5-File-ShareDir p5-File-Slurp p5-IO-Socket-INET6 p5-JSON-PP p5-List-MoreUtils p5-Locale-libintl p5-Locale-Msgfmt p5-Module-Find p5-Module-Install p5-Module-Install-XSUtil p5-Moose p5-MooseX-Singleton p5-Net-IP-XS p5-Pod-Coverage p5-Readonly-XS p5-Test-Differences p5-Test-Exception p5-Test-Fatal p5-Test-Pod p5-Text-CSV net-mgmt/p5-Net-IP dns/ldns + pkg install devel/gmake libidn p5-App-cpanminus p5-Clone p5-Devel-CheckLib p5-Email-Valid p5-File-ShareDir p5-File-Slurp p5-IO-Socket-INET6 p5-JSON-PP p5-List-MoreUtils p5-Locale-libintl p5-Locale-Msgfmt p5-Module-Find p5-Module-Install p5-Module-Install-XSUtil p5-Moose p5-MooseX-Singleton p5-Net-IP-XS p5-Pod-Coverage p5-Readonly-XS p5-Test-Differences p5-Test-Exception p5-Test-Fatal p5-Test-NoWarnings p5-Test-Pod p5-Text-CSV net-mgmt/p5-Net-IP dns/ldns ``` + 6) Install Zonemaster::LDNS: ```sh diff --git a/t/manifest.t b/t/manifest.t new file mode 100644 index 000000000..cc74820c3 --- /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 1ffc5fa7015c19cd69a5e2e4c8e06695534e3e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=A4iv=C3=A4rinta?= Date: Tue, 18 May 2021 12:55:20 +0200 Subject: [PATCH 2/2] Clean up MANIFEST/MO file notice With both translator documentation and a unit test for the manifest we shouldn't need the note about including MO files in the manifest anymore. --- share/GNUmakefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/GNUmakefile b/share/GNUmakefile index 74b7e0a4c..4e2012752 100644 --- a/share/GNUmakefile +++ b/share/GNUmakefile @@ -9,10 +9,6 @@ PMFILES := $(shell find ../lib -type f -name '*.pm' | sort) TESTMODULEFILES := $(shell find ../lib/Zonemaster/Engine/Test -type f -name '*.pm' | sort) all: $(MOFILES) modules.txt - @echo - @echo Remember to make sure all of the above names are in the - @echo MANIFEST file, or they will not be installed. - @echo # Tidy the formatting of all PO files tidy-po: