Skip to content

Commit

Permalink
adjust author tests to be handled by dzil test/xtest appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
wchristian committed Jan 18, 2025
1 parent 91b4020 commit 585aaa1
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-dependents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
env:
TEST_DEPENDENTS: 1
PERL_TEST_DM_CPAN_VERBOSE: 1
run: prove -l xt/dependent-modules.t
run: prove -l xt/author/dependent-modules.t
25 changes: 0 additions & 25 deletions xt/author.t

This file was deleted.

17 changes: 9 additions & 8 deletions xt/api.t → xt/author/api.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More;
BEGIN {
my $tests = 2935 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
if ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
plan( tests => $tests );
} else {
plan( skip_all => 'Author tests not required for installation' );
}
}

use Test::ClassAPI;
use PPI;
use PPI::Dumper;
use PPI::Find;
use PPI::Transform;

plan tests => 3033;

# Ignore various imported or special functions
$Test::ClassAPI::IGNORE{'DESTROY'}++;
$Test::ClassAPI::IGNORE{'refaddr'}++;
Expand Down Expand Up @@ -98,6 +92,7 @@ visual_column_number=method
logical_line_number=method
logical_filename=method
class=method
presumed_features=method
[PPI::Node]
PPI::Element=isa
Expand All @@ -116,6 +111,7 @@ find_any=method
find_first=method
remove_child=method
prune=method
replace_child=method
[PPI::Token]
PPI::Element=isa
Expand Down Expand Up @@ -202,6 +198,7 @@ literal=method
PPI::Token=isa
heredoc=method
terminator=method
indentation=method
[PPI::Token::_QuoteEngine]
Expand Down Expand Up @@ -302,6 +299,7 @@ module_version=method
pragma=method
version=method
version_literal=method
feature_mods=method
[PPI::Statement::Include::Perl6]
PPI::Statement::Include=isa
Expand Down Expand Up @@ -406,6 +404,9 @@ errstr=method
filename=method
STORABLE_freeze=method
STORABLE_thaw=method
custom_feature_include_cb=method
custom_feature_includes=method
feature_mods=method
[PPI::Document::Fragment]
PPI::Document=isa
Expand Down
18 changes: 18 additions & 0 deletions xt/author/author.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/perl

use strict;
BEGIN {
$| = 1;
$^W = 1;
}

my $MODULE = 'Test::Pod 1.44';

# Don't run tests for installs
use Test::More;

# Load the testing module
die "Failed to load required release-testing module $MODULE"
if not eval "use $MODULE; 1";

all_pod_files_ok();
4 changes: 2 additions & 2 deletions xt/dependent-modules.t → xt/author/dependent-modules.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use IO::All;

use lib '.';

require( -e "xt" ? "xt/DepReqs.pm" : "DepReqs.pm" );
require( -e "xt" ? "xt/DepReqs.pm" : "../DepReqs.pm" );

skip_all "ENV var TEST_DEPENDENTS not set" if not $ENV{TEST_DEPENDENTS};

Expand All @@ -20,7 +20,7 @@ my $new_log = sub { push @error_log, @_; $old_log->(@_); };

DepReqs::force_big_metacpan_fetch();

my @deps = split /\n/, io( -e "xt" ? "xt/dependents" : "dependents" )->all;
my @deps = split /\n/, io( -e "xt" ? "xt/dependents" : "../dependents" )->all;
test_modules @deps;

my $error_log = join "\n", @error_log;
Expand Down
20 changes: 20 additions & 0 deletions xt/author/meta.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/perl

# Test that our META.yml file matches the current specification.

use strict;
BEGIN {
$| = 1;
$^W = 1;
}

my $MODULE = 'Test::CPAN::Meta 0.17';

# Don't run tests for installs
use Test::More;

# Load the testing module
die "Failed to load required release-testing module $MODULE"
if not eval "use $MODULE; 1";

meta_yaml_ok();
33 changes: 33 additions & 0 deletions xt/author/pmv.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/perl

# Test that our declared minimum Perl version matches our syntax

use strict;
BEGIN {
$| = 1;
$^W = 1;
}

my @MODULES = (
'File::Find::Rule 0.32',
'File::Find::Rule::Perl 1.09',
'Perl::MinimumVersion 1.25',
'Test::MinimumVersion 0.101080',
);

# Don't run tests for installs
use Test::More;

# Load the testing modules
foreach my $MODULE ( @MODULES ) {
die "Failed to load required release-testing module $MODULE"
if not eval "use $MODULE; 1";
}

all_minimum_version_from_metayml_ok( {
paths => [
grep
{ !/14_charsets\.t/ and !/24_v6\// and !/xt\// and !/Token\/Data\.pm/ }
File::Find::Rule->perl_file->in('.')
],
} );
26 changes: 0 additions & 26 deletions xt/meta.t

This file was deleted.

41 changes: 0 additions & 41 deletions xt/pmv.t

This file was deleted.

0 comments on commit 585aaa1

Please sign in to comment.