diff options
author | James E Keenan <jkeenan@cpan.org> | 2020-02-03 15:44:50 -0500 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2020-02-04 08:04:02 -0500 |
commit | 070720ff0f9b7ca6e49d9f9d2780d90b05aa31c4 (patch) | |
tree | 509a5b96c50899e6d41d35ea387a6774260d2492 /pod/perlhack.pod | |
parent | d5a02d973b44832f918778202d68f066c8af3963 (diff) | |
download | perl-070720ff0f9b7ca6e49d9f9d2780d90b05aa31c4.tar.gz |
Clarify guidance for usage of Test::More in tests
As reported by Smylers in RT 119619 (now GH 13231), the guidance
provided in 'perlhack' for usage of Test::More is misleading. In
practice, we do not use Test::More in test files in the
subdirectories underneath 't/'. In these directories we test
Perl 5's "pre-modular" functionality -- functionality which does not
depend on our having demonstrated that we can load code via 'use
MODULE'. Usage of 'use MODULE' in 't/*/*.t' files has been largely
prohibited by a unit test in t/porting/bootstrap.t.
This patch clarifies that guidance.
POD correction per Tony Cook
For: https://github.com/Perl/perl5/issues/13231
Diffstat (limited to 'pod/perlhack.pod')
-rw-r--r-- | pod/perlhack.pod | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pod/perlhack.pod b/pod/perlhack.pod index d2227b129d..8d5fa003ee 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -763,18 +763,22 @@ tested. Tests in F<t/opbasic>, for instance, have been placed there rather than in F<t/op> because they test functionality which F<t/test.pl> presumes has already been demonstrated to work. -=item * F<t/cmd>, F<t/run>, F<t/io> and F<t/op> +=item * All other subdirectories of F<t/> Now that basic require() and subroutines are tested, you can use the F<t/test.pl> library. -You can also use certain libraries like Config conditionally, but be +You can also use certain libraries like L<Config> conditionally, but be sure to skip the test gracefully if it's not there. -=item * Everything else +=item * Test files not found under F<t/> -Now that the core of Perl is tested, L<Test::More> can and should be -used. You can also use the full suite of core modules in the tests. +This category includes F<.t> files underneath directories such as F<dist>, +F<ext> and F<lib>. Since the core of Perl has now been tested, L<Test::More> +can and now should be used. You can also use the full suite of core modules +in the tests. (As noted in L<"Patching a core module"> above, changes to +F<.t> files found under F<cpan/> should be submitted to the upstream +maintainers of those modules.) =back |