Front page | perl.perl5.porters |
Postings from November 2012
[perl #115838] t/op: Move tests not using t/test.pl into a separate directory
Thread Previous
From:
James E Keenan
Date:
November 20, 2012 05:09
Subject:
[perl #115838] t/op: Move tests not using t/test.pl into a separate directory
Message ID:
rt-3.6.HEAD-17500-1353416969-1299.115838-75-0@perl.org
# New Ticket Created by James E Keenan
# Please include the string: [perl #115838]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=115838 >
During the last year, a number of contributors have worked to convert
tests in the Perl 5 core distribution which are hard-coded to using
functions imported from t/test.pl. On at least two occasions those
contributors have gotten burned by being informed, after doing the work
of conversion, that the files being converted were ineligible for that
conversion because they tested Perl features which t/test.pl uses and,
therefore, assumes are already demonstrably functional.
This past weekend, as part of the St Louis Perl Hackathon, I converted
t/op/arith.t to using t/test.pl at the same time that I added
descriptions to 140 of its 167 individual tests
(https://rt.perl.org/rt3/Ticket/Display.html?id=115806). I felt that
conversion would be unproblematic, since t/op is one of the directories
described by 'perlhack' as okay for usage of t/test.pl:
#####
=item * F<t/cmd>, F<t/run>, F<t/io> and F<t/op>
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
sure to skip the test gracefully if it's not there.
#####
Father C. objected, saying that t/op/arith.t tests the infix + operator,
but t/test.pl presumes that that operator is already proven to work.
This situation is clearly unsatisfactory. For the long-term maintenance
of the test suite, we need to be able to state precisely whether a
particular feature of Perl (a) requires hard-coded tests; (b) may use
t/test.pl but not Test::More; or (c) may use Test::More. The directory
structure under t/ should reflect that classification.
I don't think we can solve this problem in one fell swoop, but I do
think we can make some improvements relatively quickly. I therefore
propose the following as a first step:
* Create a new subdirectory called t/opbasic.
* Move any t/op/*.t files which do not already use t/test.pl into
t/opbasic -- i.e., assume that any t/op/t file which already uses
t/test.pl does so properly.
* Adjust 'perlhack' and other documentation as needed.
* Study those files which we have moved to t/opbasic to see whether they
are, in fact, eligible to use t/test.pl. If so, move them back to t/op
and convert them.
And as a corollary, encourage new contributors to add descriptions to
the files under t/op, as we did in St Louis this past weekend.
Thank you very much.
Jim Keenan
Thread Previous