[perl #42362] [TODO]: Unit tests for modules used during configuration

Skip to first unread message

James Keenan

Apr 8, 2007, 10:22:16 PM4/8/07
to bugs-bi...@rt.perl.org
# New Ticket Created by James Keenan
# Please include the string: [perl #42362]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42362 >

Suppose that I run the tests in t/configure/*.t with Devel::Cover:

$> cover -delete coverage/configure/
$> PERL5OPT=-MDevel::Cover=-db,coverage/configure prove t/configure/
*.t "$@"
$> cover coverage/configure/ -ignore_re '^(t\/configure|\/usr|lib\/(?!
$> cover coverage/configure/ -ignore_re '^(t\/configure|\/usr|lib\/(?!
Parrot))' -report=text > coverage/analysis.configure.txt

The resulting coverage analysis suggests that considerable code in
the config/*/*.pm tree is not reached by these tests. Here's an
excerpt; see attachment for more.

---------------------------- ------ ------ ------ ------ ------
------ ------
File stmt bran cond sub pod
time total
---------------------------- ------ ------ ------ ------ ------
------ ------
config/auto/aio.pm 45.5 0.0 n/a 83.3 n/a
0.1 42.6
config/auto/alignptrs.pm 42.9 0.0 0.0 85.7 n/a
0.0 35.8
config/auto/byteorder.pm 53.6 0.0 n/a 83.3 n/a
0.0 50.0
config/auto/cgoto.pm 41.7 0.0 0.0 83.3 n/a
0.0 37.0
config/auto/cpu.pm 58.1 0.0 n/a 85.7 n/a
0.0 52.2

In every case I've examined, the runsteps() method is untested by the
test suite in question. Writing a test for that method would usually
boost subroutine coverage to 100% and would go along way toward
getting decent statement coverage.

Are these modules touched by tests in some other location? Ack-ing a
sample of them from the top level in my sandbox suggests not.

##### START ACK #####
[parrot] 517 $ ack --nohtml --nophp 'auto(\/|::)python'
6:config/auto/python - Check whether python is there
18:package auto::python;

345: auto::python
##### END ACK #####


Write unit tests for each module found under config/.

Such tests should be run in a 'pre-Configure.pl' state, i.e., they
should be executable at the point after checking out a Parrot
repository branch and before you have invoked Configure.pl.

Any files or directories created while running such tests should be
created in temporary directories that are automatically cleaned up at
the end of a single test script's execution.


James Keenan via RT

Jul 8, 2007, 10:41:59 PM7/8/07
to perl6-i...@perl.org
This ticket has been superseded by the RT tickets I created two weeks
ago for each of the current 56 configuration steps.
Reply all
Reply to author
0 new messages