This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=5901ade0dca337dbca81a5171589d05d86b1739b commit 5901ade0dca337dbca81a5171589d05d86b1739b Author: Guillem Jover <[email protected]> AuthorDate: Sat Sep 20 14:11:02 2025 +0200 test: Move test plan to Test::More import This makes the plan known at compile time. --- lib/dpkg/t/t-tarextract.t | 6 ++---- scripts/t/Dpkg_Control.t | 4 +--- scripts/t/Dpkg_Control_Fields.t | 4 +--- scripts/t/Dpkg_Shlibs.t | 6 ++---- scripts/t/Dpkg_Shlibs_Cppfilt.t | 6 ++---- scripts/t/Dpkg_Source_Package.t | 4 +--- scripts/t/dpkg_buildpackage.t | 4 +--- scripts/t/dpkg_buildtree.t | 4 +--- scripts/t/dpkg_source.t | 4 +--- t/codespell.t | 4 +--- t/cppcheck.t | 4 +--- 11 files changed, 14 insertions(+), 36 deletions(-) diff --git a/lib/dpkg/t/t-tarextract.t b/lib/dpkg/t/t-tarextract.t index 563d3b222..a7513896a 100755 --- a/lib/dpkg/t/t-tarextract.t +++ b/lib/dpkg/t/t-tarextract.t @@ -18,7 +18,7 @@ use v5.36; use version; -use Test::More; +use Test::More tests => 12; use Cwd; use File::Path qw(make_path remove_tree); use File::Spec; @@ -36,10 +36,8 @@ my $tmpdir = 't.tmp/t-tarextract'; # We require GNU tar >= 1.27 for --owner=NAME:ID and --group=NAME:ID. my $tar_version = qx($Dpkg::PROGTAR --version 2>/dev/null); if ($tar_version and $tar_version =~ m/^tar \(GNU tar\) (\d+\.\d+)/ and - qv("v$1") >= qv('v1.27')) + qv("v$1") < qv('v1.27')) { - plan tests => 12; -} else { plan skip_all => 'needs GNU tar >= 1.27'; } diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t index e7ac1ae17..5e7f6a38b 100644 --- a/scripts/t/Dpkg_Control.t +++ b/scripts/t/Dpkg_Control.t @@ -15,12 +15,10 @@ use v5.36; -use Test::More; +use Test::More tests => 24; use Test::Dpkg qw(:needs :paths); BEGIN { - plan tests => 24; - use_ok('Dpkg::Control'); use_ok('Dpkg::Control::Info'); } diff --git a/scripts/t/Dpkg_Control_Fields.t b/scripts/t/Dpkg_Control_Fields.t index 734583704..dd1a22edc 100644 --- a/scripts/t/Dpkg_Control_Fields.t +++ b/scripts/t/Dpkg_Control_Fields.t @@ -15,12 +15,10 @@ use v5.36; -use Test::More; +use Test::More tests => 2606; use Test::Dpkg qw(:paths); BEGIN { - plan tests => 2606; - use_ok('Dpkg::Control::Types'); use_ok('Dpkg::Control::FieldsCore'); use_ok('Dpkg::Control'); diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index 273478fee..325868e5c 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -15,16 +15,14 @@ use v5.36; -use Test::More; +use Test::More tests => 150; use Test::Dpkg qw(:needs :paths); use Config; use Cwd; use IPC::Cmd qw(can_run); -if (defined $Config{bin_ELF} && $Config{bin_ELF} eq 'define') { - plan tests => 150; -} else { +if (! defined $Config{bin_ELF} || $Config{bin_ELF} ne 'define') { plan skip_all => 'only ELF is currently supported'; } diff --git a/scripts/t/Dpkg_Shlibs_Cppfilt.t b/scripts/t/Dpkg_Shlibs_Cppfilt.t index 17142934a..0fd4f3101 100644 --- a/scripts/t/Dpkg_Shlibs_Cppfilt.t +++ b/scripts/t/Dpkg_Shlibs_Cppfilt.t @@ -15,16 +15,14 @@ use v5.36; -use Test::More; +use Test::More tests => 154; use Test::Dpkg qw(:needs); use Config; test_needs_command('c++filt'); -if (defined $Config{bin_ELF} && $Config{bin_ELF} eq 'define') { - plan tests => 154; -} else { +if (! defined $Config{bin_ELF} || $Config{bin_ELF} ne 'define') { plan skip_all => 'only ELF is currently supported'; } diff --git a/scripts/t/Dpkg_Source_Package.t b/scripts/t/Dpkg_Source_Package.t index 710915208..7f9c9e068 100644 --- a/scripts/t/Dpkg_Source_Package.t +++ b/scripts/t/Dpkg_Source_Package.t @@ -15,7 +15,7 @@ use v5.36; -use Test::More; +use Test::More tests => 6; use Test::Dpkg qw(:paths :needs); use File::Compare; @@ -25,8 +25,6 @@ use Dpkg::OpenPGP::ErrorCodes; test_needs_openpgp_backend(); -plan tests => 6; - use_ok('Dpkg::Source::Package'); report_options(quiet_warnings => 1); diff --git a/scripts/t/dpkg_buildpackage.t b/scripts/t/dpkg_buildpackage.t index aa35a06d7..168c0edf2 100644 --- a/scripts/t/dpkg_buildpackage.t +++ b/scripts/t/dpkg_buildpackage.t @@ -15,7 +15,7 @@ use v5.36; -use Test::More; +use Test::More tests => 17; use Test::Dpkg qw(:needs :paths test_neutralize_checksums); use File::Spec::Functions qw(rel2abs); @@ -30,8 +30,6 @@ use Dpkg::Substvars; test_needs_command('fakeroot'); -plan tests => 17; - my $srcdir = rel2abs($ENV{srcdir} || '.'); my $datadir = "$srcdir/t/dpkg_buildpackage"; my $tmpdir = test_get_temp_path(); diff --git a/scripts/t/dpkg_buildtree.t b/scripts/t/dpkg_buildtree.t index ad9f6c867..9f140144a 100644 --- a/scripts/t/dpkg_buildtree.t +++ b/scripts/t/dpkg_buildtree.t @@ -15,7 +15,7 @@ use v5.36; -use Test::More; +use Test::More tests => 10; use Test::Dpkg qw(:paths); use POSIX; @@ -24,8 +24,6 @@ use File::Spec::Functions qw(rel2abs); use Dpkg::IPC; use Dpkg::BuildTree; -plan tests => 10; - my $srcdir = rel2abs($ENV{srcdir} || '.'); my $datadir = "$srcdir/t/dpkg_buildtree"; diff --git a/scripts/t/dpkg_source.t b/scripts/t/dpkg_source.t index ecc79bd0f..30257cf06 100644 --- a/scripts/t/dpkg_source.t +++ b/scripts/t/dpkg_source.t @@ -15,7 +15,7 @@ use v5.36; -use Test::More; +use Test::More tests => 8; use Test::Dpkg qw(:needs :paths test_neutralize_checksums); use File::Spec::Functions qw(rel2abs); @@ -28,8 +28,6 @@ use Dpkg::Substvars; test_needs_command('xz'); -plan tests => 8; - my $srcdir = rel2abs($ENV{srcdir} || '.'); my $datadir = "$srcdir/t/dpkg_source"; my $tmpdir = test_get_temp_path(); diff --git a/t/codespell.t b/t/codespell.t index 7d011b2ba..f5a69b3bb 100644 --- a/t/codespell.t +++ b/t/codespell.t @@ -15,15 +15,13 @@ use v5.36; -use Test::More; +use Test::More tests => 1; use Test::Dpkg qw(:needs); test_needs_author(); test_needs_command('codespell'); test_needs_srcdir_switch(); -plan tests => 1; - my @codespell_skip = qw( .git *.po diff --git a/t/cppcheck.t b/t/cppcheck.t index 0af36f129..69598e738 100644 --- a/t/cppcheck.t +++ b/t/cppcheck.t @@ -15,7 +15,7 @@ use v5.36; -use Test::More; +use Test::More tests => 1; use Test::Dpkg qw(:needs); test_needs_author(); @@ -24,8 +24,6 @@ test_needs_srcdir_switch(); plan skip_all => 'expensive test in short mode' if $ENV{SHORT_TESTING}; -plan tests => 1; - my $builddir = $ENV{abs_top_builddir} || '.'; my @cppcheck_opts = (qw( -- Dpkg.Org's dpkg

