# New Ticket Created by James Keenan
# Please include the string: [perl #50258]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50258 >
In t/harness we find the following:
## FIXME: ###
# This is a temporary solution until Test::TAP::Model version
# 0.05. At that point, this function should be removed, and the
# verbose line below should be uncommented.
{
no warnings qw/redefine once/;
*Test::TAP::Model::run_tests = sub {
my $self = shift;
$self->_init;
$self->{meat}{start_time} = time;
my %stats;
foreach my $file (@_) {
my $data;
print STDERR "- $file\n";
$data = $self->run_test($file);
$stats{tests} += $data->{results}{max} || 0;
$stats{ok} += $data->{results}{ok} || 0;
}
printf STDERR "%s OK from %s tests (%.2f%% ok)\n\n",
$stats{ok},
$stats{tests},
$stats{ok} / $stats{tests} * 100;
$self->{meat}{end_time} = time;
};
my $start = time();
my $model = Test::TAP::Model::Visual->new();
# $model->set_verbose();
$model->run_tests(@tests);
I happened upon this in the course of my initial work on redesigning
Parrot's smoke testing (http://rt.perl.org/rt3/Ticket/Display.html?
id=49276; http://www.perlfoundation.org/parrot/index.cgi?
rfp_parrot_needs_better_smoke_reports). Since I have
Test::Tap::Model 0.09 installed, I figured I could test the premise
of the comment above, i.e., comment out the re-definition of
*Test::TAP::Model::run_tests and allow $model->set_verbose() to be
executed.
No such luck. If I followed the implicit instructions, 'make smoke'
failed because set_verbose() could not be located:
Compiling with:
xx.c
cc -I./include -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHASATTRIBUTE_CONST -
DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_FORMAT -DHASATTRIBUTE_MALLOC -
DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -
DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-
functions=16 -mno-accumulate-outgoing-args -W -Wall -Waggregate-
return -Wbad-function-cast -Wc++-compat -Wcast-align -Wcast-qual -
Wchar-subscripts -Wcomment -Wdeclaration-after-statement -Wdisabled-
optimization -Wextra -Wformat-nonliteral -Wformat-security -Wformat-
y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -
Wimport -Winit-self -Winline -Winvalid-pch -Wmain -Wmissing-braces -
Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-
dirs -Wmissing-prototypes -Wnested-externs -Wno-endif-labels -Wno-
shadow -Wno-unused -Wnonnull -Wpacked -Wparentheses -Wpointer-arith -
Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -
Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -
Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -g -DHAS_JIT -
DI386 -DHAVE_COMPUTED_GOTO -fPIC -I. -o xx.o -c xx.c
make -C docs
make[1]: Entering directory `/home/jimk/work/parrot/docs'
/usr/local/bin/perl -MExtUtils::Command -e mkpath ops
make[1]: Leaving directory `/home/jimk/work/parrot/docs'
make -C src/dynpmc
make[1]: Entering directory `/home/jimk/work/parrot/src/dynpmc'
make[1]: Leaving directory `/home/jimk/work/parrot/src/dynpmc'
make -C src/dynoplibs
make[1]: Entering directory `/home/jimk/work/parrot/src/dynoplibs'
make[1]: Leaving directory `/home/jimk/work/parrot/src/dynoplibs'
make -C compilers/pge
make[1]: Entering directory `/home/jimk/work/parrot/compilers/pge'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/pge'
make -C compilers/tge
make[1]: Entering directory `/home/jimk/work/parrot/compilers/tge'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/tge'
make -C compilers/past-pm
make[1]: Entering directory `/home/jimk/work/parrot/compilers/past-pm'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/past-pm'
make -C compilers/pct
make[1]: Entering directory `/home/jimk/work/parrot/compilers/pct'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/pct'
make -C compilers/nqp
make[1]: Entering directory `/home/jimk/work/parrot/compilers/nqp'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/nqp'
make -C compilers/json
make[1]: Entering directory `/home/jimk/work/parrot/compilers/json'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jimk/work/parrot/compilers/json'
/usr/local/bin/perl t/harness --html --gc-debug --running-make-test
Can't locate object method "set_verbose" via package
"Test::TAP::Model::Visual" at t/harness line 298.
make: *** [smoke] Error 9
I then re-commented-out the line with set_verbose, leaving the re-
definition of run_tests commented-out. I then reconfigured, rebuilt
and called 'make smoke' anew. This time 'make smoke' simply hung at
the next-to-last line cited above: /usr/local/bin/perl t/harness --
html --gc-debug --running-make-test . I had to Ctrl-C to get out of it.
I therefore conclude that the advice found in the FIXME comment is
bad. Even if you do have 0.09 installed, you have to use the re-
definition currently found in t/harness.
So I therefore propose to delete the comment and to delete the
commented-out set_verbose() call. See attached
t.harness.fixme.patch.txt. I will apply in 24-48 hours if no one
objects.
kid51
Index: t/harness
===================================================================
--- t/harness (revision 25228)
+++ t/harness (working copy)
@@ -262,10 +262,6 @@
die "You must have Test::TAP::HTMLMatrix installed.\n\n$@"
if $@;
- ## FIXME: ###
- # This is a temporary solution until Test::TAP::Model version
- # 0.05. At that point, this function should be removed, and the
- # verbose line below should be uncommented.
{
no warnings qw/redefine once/;
*Test::TAP::Model::run_tests = sub {
@@ -294,7 +290,6 @@
my $start = time();
my $model = Test::TAP::Model::Visual->new();
- # $model->set_verbose();
$model->run_tests(@tests);
my $end = time();