1 #!perl -- -*- mode: cperl -*-
6 use CPAN::Testers::ParseReport;
7 use List::Util qw(sum max);
9 binmode Test::More->builder->output, ":utf8";
10 binmode Test::More->builder->failure_output, ":utf8";
14 sub reportedvariableis ($$$$) {
15 my($extract,$id,$var,$value) = @_;
16 is $extract->{$var}, $value, "report $id: $var is $value";
21 open my $fh, "<", qq{t/var/nntp-testers/1581994} or die "could not open: $!";
26 CPAN::Testers::ParseReport::parse_report(1234567, $dump, article => $article, solve => 1, quiet => 1);
27 my $keys = keys %{$dump->{"==DATA=="}[0]};
28 ok($keys >= 39, "found at least 39, actually [$keys] keys");
36 'q' => ["meta:perl", "meta:from", "qr:(Undefined.*)", "prereq:Test::More"],
38 'cachedir' => 't/var',
42 CPAN::Testers::ParseReport::parse_distro
47 my $Y = CPAN::Testers::ParseReport::_yaml_loadfile("ctgetreports.out");
48 my $count = sum map {values %{$Y->{"meta:from"}{$_}}} keys %{$Y->{"meta:from"}};
49 is($count, 130, "found $count==130 reports via meta:from");
50 is($Y->{"meta:ok"}{PASS}{PASS}, 79, "found 79 PASS");
51 is($Y->{"prereq:Test::More"}{0}{PASS}, 70, "found 70 PASS on prereq Test::More==0");
52 ok(!$Y->{"env:alignbytes"}, "there is no such thing as an environment alignbytes");
53 my $undefined = $Y->{'qr:(Undefined.*)'};
54 my($the_warning) = grep {length} keys %$undefined;
55 ok($undefined,"found warning: '$the_warning'");
56 like($the_warning, qr/&main::/, "the ampersand is escaped");
65 'q' => ["meta:perl", "meta:from", "prereq:Test::More"],
67 'cachedir' => 't/var',
70 'sample' => $sample_0,
72 CPAN::Testers::ParseReport::parse_distro
77 my $Y = CPAN::Testers::ParseReport::_yaml_loadfile("ctgetreports.out");
78 unlink "ctgetreports.out" or die "Could not unlink ctgetreports.out: $!";
79 my $count_all = sum map {values %{$Y->{"meta:from"}{$_}}} keys %{$Y->{"meta:from"}};
80 is($count_all, $sample_0, "found $count_all==$sample_0 reports via meta:from");
81 my $count_fail_1 = $Y->{"meta:ok"}{"FAIL"}{"FAIL"};
83 # if the first pass brings much, we still want one more, if it
84 # brings just a few, we want at least 22 since we know we have
86 $Opt{minfail} = max(22,$count_fail_1+1);
87 CPAN::Testers::ParseReport::parse_distro
92 $Y = CPAN::Testers::ParseReport::_yaml_loadfile("ctgetreports.out");
93 my $count_fail_2 = $Y->{"meta:ok"}{"FAIL"}{"FAIL"};
94 cmp_ok($count_fail_2, '>', $count_fail_1, "found $count_fail_2 > $count_fail_1: that is more fails with minfail than without");
103 'q' => ["meta:perl", "meta:from", 'conf:libpth', 'conf:libs', 'conf:perllibs'],
105 'cachedir' => 't/var',
111 my $extract = CPAN::Testers::ParseReport::parse_report
113 "t/var/nntp-testers/$id",
117 reportedvariableis $extract, $id, 'prereq:Text::Ligature', '0.02';
118 reportedvariableis $extract, $id, 'prereq:parent', '0';
119 # ld='cc', ldflags ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib'
120 # libpth=/usr/lib /usr/local/lib
121 # libs=-lgdbm -lm -lcrypt
122 # perllibs=-lm -lcrypt
123 # libc=, so=so, useshrplib=false, libperl=libperl.a
125 reportedvariableis $extract, $id, 'conf:libpth', '/usr/lib /usr/local/lib';
126 reportedvariableis $extract, $id, 'conf:libs', '-lgdbm -lm -lcrypt';
127 reportedvariableis $extract, $id, 'conf:perllibs', '-lm -lcrypt';
135 'q' => ["meta:perl", "meta:from", "prereq:Test::More"],
137 'cachedir' => 't/var',
142 CPAN::Testers::ParseReport::parse_distro
147 my $Y = CPAN::Testers::ParseReport::_yaml_loadfile("ctgetreports.out");
148 my $count = sum map {values %{$Y->{"meta:from"}{$_}}} keys %{$Y->{"meta:from"}};
149 is($count, 130, "found $count==130 reports via meta:from");
158 'q' => ["meta:perl", "meta:from", "conf:git_commit_id", "env:PERL5_MINISMOKEBOX"],
160 'cachedir' => 't/var',
166 my $extract = CPAN::Testers::ParseReport::parse_report
168 "t/var/nntp-testers/$id",
172 reportedvariableis $extract, $id, 'conf:git_commit_id', '245490700bb744b58c708516d2d3c08f18583dc3';
173 reportedvariableis $extract, $id, 'env:AUTOMATED_TESTING', '1';
174 reportedvariableis $extract, $id, 'meta:date', '2009-03-20T03:29:23';
183 'q' => ["meta:perl", "meta:from", "mod:Storable", "env:AUTOMATED_TESTING"],
185 'cachedir' => 't/var',
191 my $extract = CPAN::Testers::ParseReport::parse_report
193 "t/var/nntp-testers/3851138",
197 like $extract->{'conf:archname'}, qr/64int/, "found 64int on archname";
198 reportedvariableis $extract, $id, 'env:AUTOMATED_TESTING', '1';
199 reportedvariableis $extract, $id, 'mod:Storable', '2.18';
200 reportedvariableis $extract, $id, 'meta:date', '2009-05-10T01:39:11';
209 'q' => ["conf:nvsize", "conf:uselongdouble"],
211 'cachedir' => 't/var',
217 my $extract = CPAN::Testers::ParseReport::parse_report
219 "t/var/nntp-testers/5698506",
223 reportedvariableis $extract, $id, 'conf:nvsize', 16;
224 reportedvariableis $extract, $id, 'conf:uselongdouble', 'define';
225 reportedvariableis $extract, $id, 'mod:ExtUtils::MakeMaker', '6.55_02';
226 reportedvariableis $extract, $id, 'meta:date', '2009-10-21T17:30:27';
235 'q' => ["conf:nvsize", "conf:uselongdouble"],
237 'cachedir' => 't/var',
243 my $extract = CPAN::Testers::ParseReport::parse_report
245 "t/var/nntp-testers/$id",
249 reportedvariableis $extract, $id, 'conf:nvsize', 8;
250 reportedvariableis $extract, $id, 'conf:uselongdouble', 'undef';
251 reportedvariableis $extract, $id, 'mod:ExtUtils::MakeMaker', '6.54';
252 reportedvariableis $extract, $id, 'meta:date', '2009-08-14T20:18:57';
257 open my $fh, "-|", qq{"$^X" "-Ilib" "bin/ctgetreports" "--local" "--cachedir" "t/var" "--solve" "--quiet" "Scriptalicious" 2>&1} or die "could not fork: $!";
261 push @reg, $1 if /^Regression '(.+)'/;
264 close $fh or diag join "", @full;
265 is "@reg", "fail:t/04-fork meta:osname+perl meta:writer", "found the top 3 candidates";
269 # State after regression testing: 68 results, showing top 3
272 # ****************************************************************
273 # Regression 'mod:Test::Harness'
274 # ****************************************************************
275 # Name Theta StdErr T-stat
276 # [0='const'] 1.0000 0.1021 9.80
277 # [1='eq_2.64'] -0.3846 0.1328 -2.90
278 # [2='eq_3.09'] 0.0000 0.3228 0.00
279 # [3='eq_3.10'] -0.0200 0.1109 -0.18
280 # [4='eq_3.11'] -0.0000 0.2042 -0.00
281 # [5='eq_3.12'] -0.7143 0.1309 -5.46
282 # [6='eq_3.13'] -0.8696 0.1204 -7.22
283 # [7='eq_3.14'] -0.8667 0.1291 -6.71
285 # R^2= 0.628, N= 128, K= 8
286 # ****************************************************************
288 # ****************************************************************
290 # ****************************************************************
291 # Name Theta StdErr T-stat
292 # [0='const'] 2.4992 0.1514 16.51
293 # [1='n_id'] -0.0000 0.0000 -12.66
295 # R^2= 0.560, N= 128, K= 2
296 # ****************************************************************
298 # ****************************************************************
299 # Regression 'meta:date'
300 # ****************************************************************
301 # Name Theta StdErr T-stat
302 # [0='const'] 93.9116 7.3952 12.70
303 # [1='n_meta:date'] -0.0000 0.0000 -12.62
305 # R^2= 0.558, N= 128, K= 2
306 # ****************************************************************
310 # State after regression testing: 110 results, showing top 3
313 # ****************************************************************
314 # Regression 'meta:writer'
315 # ****************************************************************
316 # Name Theta StdErr T-stat
317 # [0='const'] 0.8929 0.0509 17.54
318 # [1='eq_CPAN-Reporter-1.1404'] 0.1071 0.0992 1.08
319 # [2='eq_CPAN-Reporter-1.15'] 0.1071 0.0720 1.49
320 # [3='eq_CPAN-Reporter-1.1556'] -0.8929 0.1440 -6.20
321 # [4='eq_CPAN-Reporter-1.16'] -0.8929 0.2741 -3.26
322 # [5='eq_CPAN-Reporter-1.1601'] -0.6929 0.1308 -5.30
323 # [6='eq_CPAN-Reporter-1.1651'] -0.7679 0.0844 -9.10
324 # [7='eq_CPAN-Reporter-1.17'] -0.6706 0.1032 -6.50
325 # [8='eq_CPAN-Reporter-1.1702'] -0.7817 0.0814 -9.61
326 # [9='eq_CPAN::YACSmoke 0.0307'] 0.1071 0.1032 1.04
328 # R^2= 0.717, N= 128, K= 10
329 # ****************************************************************
331 # ****************************************************************
332 # Regression 'mod:Test::Harness'
333 # ****************************************************************
334 # Name Theta StdErr T-stat
335 # [0='const'] 1.0000 0.1021 9.80
336 # [1='eq_2.64'] -0.3846 0.1328 -2.90
337 # [2='eq_3.09'] 0.0000 0.3228 0.00
338 # [3='eq_3.10'] -0.0200 0.1109 -0.18
339 # [4='eq_3.11'] -0.0000 0.2042 -0.00
340 # [5='eq_3.12'] -0.7143 0.1309 -5.46
341 # [6='eq_3.13'] -0.8696 0.1204 -7.22
342 # [7='eq_3.14'] -0.8667 0.1291 -6.71
344 # R^2= 0.628, N= 128, K= 8
345 # ****************************************************************
347 # ****************************************************************
349 # ****************************************************************
350 # Name Theta StdErr T-stat
351 # [0='const'] 2.4992 0.1514 16.51
352 # [1='n_id'] -0.0000 0.0000 -12.66
354 # R^2= 0.560, N= 128, K= 2
355 # ****************************************************************
366 'q' => ["conf:nvsize", "conf:uselongdouble"],
368 'cachedir' => 't/var',
374 my $extract = CPAN::Testers::ParseReport::parse_report
376 "t/var/nntp-testers/$id",
380 is $extract->{'meta:date'}, '2009-11-01T14:07:11', "report $id: date";
381 is $extract->{'conf:nvsize'}, 8, "report $id: found 8 on nvsize";
382 is $extract->{'conf:uselongdouble'}, 'undef', "report $id: found uselongdouble";
383 is $extract->{'mod:CPANPLUS'}, '0.89_06', "report $id: CPANPLUS version";
384 is $extract->{'mod:Cwd'}, '3.2501', "report $id: Cwd version";
385 is $extract->{'mod:File::Spec'}, '3.2501', "report $id: File::Spec version";
386 is $extract->{'mod:version'}, '0.7701', "report $id: version version";
387 is $extract->{'mod:ExtUtils::MakeMaker'}, '6.54', "report $id: ExtUtils::MakeMaker version";
388 is $extract->{'mod:l module toolchain versions in'}, undef, "report $id: C:T:PR 0.1.6 had a bug against cpanplus 0.89_06";
398 'cachedir' => 't/var',
404 my $extract = CPAN::Testers::ParseReport::parse_report
406 "t/var/nntp-testers/$id",
410 is $extract->{'mod:Catalyst::Plugin::Session::State::Cookie'}, "0.17", "report $id: C:P:S:S:C version";
411 is $extract->{'mod:Catalyst::Controller::ActionRole'}, "0.12", "report $id: C:C:AR mod version";
412 is $extract->{'prereq:Catalyst::Controller::ActionRole'}, "0.12", "report $id: C:C:AR prereq version";
413 is $extract->{'mod:Moose::Autobox'}, "0.10", "report $id: M:A mod version";
414 is $extract->{'prereq:Moose::Autobox'}, "0.09", "report $id: M:A prereq version";
415 is $extract->{'mod:CPANPLUS'}, '0.89_07', "report $id: CPANPLUS version";
416 is $extract->{'mod:Cwd'}, '3.30', "report $id: Cwd version";
417 is $extract->{'meta:date'}, '2009-11-08T14:48:26', "report $id: date";
427 'cachedir' => 't/var',
433 my $extract = CPAN::Testers::ParseReport::parse_report
435 "t/var/nntp-testers/$id",
439 is $extract->{'meta:date'}, '2008-09-02T18:05:00', "report $id: date";
449 'cachedir' => 't/var',
455 my $extract = CPAN::Testers::ParseReport::parse_report
457 "t/var/nntp-testers/$id",
461 is $extract->{'fail:t/20-content-types.t'}, 1;
471 'cachedir' => 't/var',
475 'q' => ['qr:(Failed test\s+\S+.*)'],
478 my $extract = CPAN::Testers::ParseReport::parse_report
480 "t/var/nntp-testers/$id",
484 is $extract->{'qr:(Failed test\s+\S+.*)'}, q{Failed test 'Pod coverage on App::Pm2Port'}, "report $id: qr...Failed test...";
485 is $extract->{'fail:t/pod-coverage.t'}, 1;
495 'cachedir' => 't/var',
501 my $extract = CPAN::Testers::ParseReport::parse_report
503 "t/var/nntp-testers/$id",
507 is $extract->{'meta:perl'}, q{5.11.2}, "report $id: meta:perl";
517 'cachedir' => 't/var',
523 my $extract = CPAN::Testers::ParseReport::parse_report
525 "t/var/nntp-testers/$id",
529 is $extract->{'mod:Image::Imlib2'}, q{0}, "report $id: mod:Image::Imlib2";
539 'cachedir' => 't/var',
545 my $extract = CPAN::Testers::ParseReport::parse_report
547 "t/var/nntp-testers/$id",
551 is $extract->{'prereq:Module::Build'}, q{0.36}, "report $id: prereq:Module::Build";
552 is $extract->{'mod:Module::Build'}, q{0.36_13}, "report $id: mod:Module::Build";
562 'cachedir' => 't/var',
568 my $extract = CPAN::Testers::ParseReport::parse_report
570 "t/var/nntp-testers/$id",
574 is $extract->{'env:$UID'}, q{1005}, "report $id: UID=1005";
575 is $extract->{'env:$GID∋1005'}, q{true}, "report $id: GID∋1005";
585 'cachedir' => 't/var',
591 my $extract = CPAN::Testers::ParseReport::parse_report
593 "t/var/nntp-testers/$id",
597 is $extract->{'env:$UID'}, q{1002}, "report $id: UID=1002";
598 is $extract->{'env:$GID∋100'}, q{true}, "report $id: GID∋100";
608 'cachedir' => 't/var',
614 my $extract = CPAN::Testers::ParseReport::parse_report
616 "t/var/nntp-testers/$id",
620 is $extract->{'env:$UID'}, q{502}, "report $id: UID=502";
621 is $extract->{'env:$GID∋502'}, q{true}, "report $id: GID∋502";
631 'cachedir' => 't/var',
637 my $extract = CPAN::Testers::ParseReport::parse_report
639 "t/var/nntp-testers/$id",
643 is $extract->{'env:$UID'}, q{1001}, "report $id: UID=1001";
644 is $extract->{'env:$GID∋1001'}, q{true}, "report $id: GID∋1001";
645 is $extract->{'env:$^X'}, q{/usr/home/cpan/pit/bare/perl-5.10.0/bin/perl}, "report $id: \$^X=/usr/home/cpan/pit/bare/perl-5.10.0/bin/perl";
655 'cachedir' => 't/var',
661 my $extract = CPAN::Testers::ParseReport::parse_report
663 "t/var/nntp-testers/$id",
667 is $extract->{'meta:perl'}, q{5.12.4}, "report $id: meta:perl";
668 is $extract->{'mod:CPANPLUS'}, q{0.9111}, "report $id: mod:CPANPLUS";
678 'cachedir' => 't/var',
685 my $extract = CPAN::Testers::ParseReport::parse_report
687 "t/var/nntp-testers/$id",
691 reportedvariableis $extract, $id, 'conf:usesocks', 'undef';
692 reportedvariableis $extract, $id, 'conf:use64bitall', 'define';
693 reportedvariableis $extract, $id, 'conf:use64bitint', 'define';
694 reportedvariableis $extract, $id, 'conf:useposix', 'true';
695 reportedvariableis $extract, $id, 'conf:usemymalloc', 'n';
696 reportedvariableis $extract, $id, 'conf:d_sfio', 'undef';
697 reportedvariableis $extract, $id, 'conf:bincompat5005', 'undef';
700 unlink "ctgetreports.out";
710 # cperl-indent-level: 4