Upgrade to Test-Harness-3.17
[p5sagit/p5-mst-13.2.git] / ext / Test-Harness / t / regression.t
CommitLineData
b965d173 1#!/usr/bin/perl -w
2
3BEGIN {
5e727a3e 4 if ( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = '../lib';
7 }
8 else {
9 push @INC, 't/lib';
10 }
b965d173 11}
12
13use strict;
b965d173 14
15use Test::More 'no_plan';
16
17use File::Spec;
18use Config;
19
20use constant TRUE => "__TRUE__";
21use constant FALSE => "__FALSE__";
22
23# if wait() is non-zero, we cannot reliably predict its value
24use constant NOT_ZERO => "__NOT_ZERO__";
25
26use TAP::Parser;
27
28my $IsVMS = $^O eq 'VMS';
29my $IsWin32 = $^O eq 'MSWin32';
30
5e727a3e 31my $SAMPLE_TESTS = File::Spec->catdir(
32 File::Spec->curdir,
27fc0087 33 ( $ENV{PERL_CORE}
f715bbfb 34 ? ( File::Spec->updir(), 'ext', 'Test-Harness' )
27fc0087 35 : ()
36 ),
37 't',
38 'sample-tests'
5e727a3e 39);
b965d173 40
41my %deprecated = map { $_ => 1 } qw(
42 TAP::Parser::good_plan
43 TAP::Parser::Result::Plan::passed
44 TAP::Parser::Result::Test::passed
45 TAP::Parser::Result::Test::actual_passed
46 TAP::Parser::Result::passed
47);
48$SIG{__WARN__} = sub {
49 if ( $_[0] =~ /is deprecated/ ) {
50 my @caller = caller(1);
51 my $sub = $caller[3];
52 ok exists $deprecated{$sub},
53 "... we should get a deprecated warning for $sub";
54 }
55 else {
56 CORE::warn @_;
57 }
58};
59
60# the %samples keys are the names of test scripts in t/sample-tests
61my %samples = (
62 descriptive => {
63 results => [
64 { is_plan => TRUE,
65 raw => '1..5',
66 tests_planned => 5,
67 passed => TRUE,
68 is_ok => TRUE,
69 },
70 { actual_passed => TRUE,
71 is_actual_ok => TRUE,
72 description => "Interlock activated",
73 passed => TRUE,
74 is_ok => TRUE,
75 is_test => TRUE,
76 has_skip => FALSE,
77 has_todo => FALSE,
78 number => 1,
79 is_unplanned => FALSE,
80 },
81 { actual_passed => TRUE,
82 is_actual_ok => TRUE,
83 passed => TRUE,
84 is_ok => TRUE,
85 is_test => TRUE,
86 has_skip => FALSE,
87 has_todo => FALSE,
88 number => 2,
89 description => "Megathrusters are go",
90 is_unplanned => FALSE,
91 },
92 { actual_passed => TRUE,
93 is_actual_ok => TRUE,
94 passed => TRUE,
95 is_ok => TRUE,
96 is_test => TRUE,
97 has_skip => FALSE,
98 has_todo => FALSE,
99 number => 3,
100 description => "Head formed",
101 is_unplanned => FALSE,
102 },
103 { actual_passed => TRUE,
104 is_actual_ok => TRUE,
105 passed => TRUE,
106 is_ok => TRUE,
107 is_test => TRUE,
108 has_skip => FALSE,
109 has_todo => FALSE,
110 number => 4,
111 description => "Blazing sword formed",
112 is_unplanned => FALSE,
113 },
114 { actual_passed => TRUE,
115 is_actual_ok => TRUE,
116 passed => TRUE,
117 is_ok => TRUE,
118 is_test => TRUE,
119 has_skip => FALSE,
120 has_todo => FALSE,
121 number => 5,
122 description => "Robeast destroyed",
123 is_unplanned => FALSE,
124 }
125 ],
126 plan => '1..5',
127 passed => [ 1 .. 5 ],
128 actual_passed => [ 1 .. 5 ],
129 failed => [],
130 actual_failed => [],
131 todo => [],
132 todo_passed => [],
133 skipped => [],
134 good_plan => TRUE,
135 is_good_plan => TRUE,
136 tests_planned => 5,
137 tests_run => 5,
138 parse_errors => [],
139 'exit' => 0,
140 wait => 0,
141 version => 12,
142 },
143 descriptive_trailing => {
144 results => [
145 { actual_passed => TRUE,
146 is_actual_ok => TRUE,
147 description => "Interlock activated",
148 passed => TRUE,
149 is_ok => TRUE,
150 is_test => TRUE,
151 has_skip => FALSE,
152 has_todo => FALSE,
153 number => 1,
154 is_unplanned => FALSE,
155 },
156 { actual_passed => TRUE,
157 is_actual_ok => TRUE,
158 passed => TRUE,
159 is_ok => TRUE,
160 is_test => TRUE,
161 has_skip => FALSE,
162 has_todo => FALSE,
163 number => 2,
164 description => "Megathrusters are go",
165 is_unplanned => FALSE,
166 },
167 { actual_passed => TRUE,
168 is_actual_ok => TRUE,
169 passed => TRUE,
170 is_ok => TRUE,
171 is_test => TRUE,
172 has_skip => FALSE,
173 has_todo => FALSE,
174 number => 3,
175 description => "Head formed",
176 is_unplanned => FALSE,
177 },
178 { actual_passed => TRUE,
179 is_actual_ok => TRUE,
180 passed => TRUE,
181 is_ok => TRUE,
182 is_test => TRUE,
183 has_skip => FALSE,
184 has_todo => FALSE,
185 number => 4,
186 description => "Blazing sword formed",
187 is_unplanned => FALSE,
188 },
189 { actual_passed => TRUE,
190 is_actual_ok => TRUE,
191 passed => TRUE,
192 is_ok => TRUE,
193 is_test => TRUE,
194 has_skip => FALSE,
195 has_todo => FALSE,
196 number => 5,
197 description => "Robeast destroyed",
198 is_unplanned => FALSE,
199 },
200 { is_plan => TRUE,
201 raw => '1..5',
202 tests_planned => 5,
203 passed => TRUE,
204 is_ok => TRUE,
205 },
206 ],
207 plan => '1..5',
208 passed => [ 1 .. 5 ],
209 actual_passed => [ 1 .. 5 ],
210 failed => [],
211 actual_failed => [],
212 todo => [],
213 todo_passed => [],
214 skipped => [],
215 good_plan => TRUE,
216 is_good_plan => TRUE,
217 tests_planned => 5,
218 tests_run => 5,
219 parse_errors => [],
220 'exit' => 0,
221 wait => 0,
222 version => 12,
223 },
224 empty => {
225 results => [],
226 plan => '',
227 passed => [],
228 actual_passed => [],
229 failed => [],
230 actual_failed => [],
231 todo => [],
232 todo_passed => [],
233 skipped => [],
234 good_plan => FALSE,
235 is_good_plan => FALSE,
236 tests_planned => undef,
237 tests_run => 0,
238 parse_errors => ['No plan found in TAP output'],
239 'exit' => 0,
240 wait => 0,
241 version => 12,
242 },
243 simple => {
244 results => [
245 { is_plan => TRUE,
246 raw => '1..5',
247 tests_planned => 5,
248 passed => TRUE,
249 is_ok => TRUE,
250 },
251 { actual_passed => TRUE,
252 is_actual_ok => TRUE,
253 passed => TRUE,
254 is_ok => TRUE,
255 is_test => TRUE,
256 has_skip => FALSE,
257 has_todo => FALSE,
258 number => 1,
259 description => "",
260 },
261 { actual_passed => TRUE,
262 is_actual_ok => TRUE,
263 passed => TRUE,
264 is_ok => TRUE,
265 is_test => TRUE,
266 has_skip => FALSE,
267 has_todo => FALSE,
268 number => 2,
269 description => "",
270 },
271 { actual_passed => TRUE,
272 is_actual_ok => TRUE,
273 passed => TRUE,
274 is_ok => TRUE,
275 is_test => TRUE,
276 has_skip => FALSE,
277 has_todo => FALSE,
278 number => 3,
279 description => "",
280 },
281 { actual_passed => TRUE,
282 is_actual_ok => TRUE,
283 passed => TRUE,
284 is_ok => TRUE,
285 is_test => TRUE,
286 has_skip => FALSE,
287 has_todo => FALSE,
288 number => 4,
289 description => "",
290 },
291 { actual_passed => TRUE,
292 is_actual_ok => TRUE,
293 passed => TRUE,
294 is_ok => TRUE,
295 is_test => TRUE,
296 has_skip => FALSE,
297 has_todo => FALSE,
298 number => 5,
299 description => "",
300 },
301 ],
302 plan => '1..5',
303 passed => [ 1 .. 5 ],
304 actual_passed => [ 1 .. 5 ],
305 failed => [],
306 actual_failed => [],
307 todo => [],
308 todo_passed => [],
309 skipped => [],
310 good_plan => TRUE,
311 is_good_plan => TRUE,
312 tests_planned => 5,
313 tests_run => 5,
314 parse_errors => [],
315 'exit' => 0,
316 wait => 0,
317 version => 12,
318 },
319 space_after_plan => {
320 results => [
321 { is_plan => TRUE,
322 raw => '1..5 ',
323 tests_planned => 5,
324 passed => TRUE,
325 is_ok => TRUE,
326 },
327 { actual_passed => TRUE,
328 is_actual_ok => TRUE,
329 passed => TRUE,
330 is_ok => TRUE,
331 is_test => TRUE,
332 has_skip => FALSE,
333 has_todo => FALSE,
334 number => 1,
335 description => "",
336 },
337 { actual_passed => TRUE,
338 is_actual_ok => TRUE,
339 passed => TRUE,
340 is_ok => TRUE,
341 is_test => TRUE,
342 has_skip => FALSE,
343 has_todo => FALSE,
344 number => 2,
345 description => "",
346 },
347 { actual_passed => TRUE,
348 is_actual_ok => TRUE,
349 passed => TRUE,
350 is_ok => TRUE,
351 is_test => TRUE,
352 has_skip => FALSE,
353 has_todo => FALSE,
354 number => 3,
355 description => "",
356 },
357 { actual_passed => TRUE,
358 is_actual_ok => TRUE,
359 passed => TRUE,
360 is_ok => TRUE,
361 is_test => TRUE,
362 has_skip => FALSE,
363 has_todo => FALSE,
364 number => 4,
365 description => "",
366 },
367 { actual_passed => TRUE,
368 is_actual_ok => TRUE,
369 passed => TRUE,
370 is_ok => TRUE,
371 is_test => TRUE,
372 has_skip => FALSE,
373 has_todo => FALSE,
374 number => 5,
375 description => "",
376 },
377 ],
378 plan => '1..5',
379 passed => [ 1 .. 5 ],
380 actual_passed => [ 1 .. 5 ],
381 failed => [],
382 actual_failed => [],
383 todo => [],
384 todo_passed => [],
385 skipped => [],
386 good_plan => TRUE,
387 is_good_plan => TRUE,
388 tests_planned => 5,
389 tests_run => 5,
390 parse_errors => [],
391 'exit' => 0,
392 wait => 0,
393 version => 12,
394 },
395 simple_yaml => {
396 results => [
397 { is_version => TRUE,
398 raw => 'TAP version 13',
399 },
400 { is_plan => TRUE,
401 raw => '1..5',
402 tests_planned => 5,
403 passed => TRUE,
404 is_ok => TRUE,
405 },
406 { actual_passed => TRUE,
407 is_actual_ok => TRUE,
408 passed => TRUE,
409 is_ok => TRUE,
410 is_test => TRUE,
411 has_skip => FALSE,
412 has_todo => FALSE,
413 number => 1,
414 description => "",
415 },
416 { actual_passed => TRUE,
417 is_actual_ok => TRUE,
418 passed => TRUE,
419 is_ok => TRUE,
420 is_test => TRUE,
421 has_skip => FALSE,
422 has_todo => FALSE,
423 number => 2,
424 description => "",
425 },
426 { is_yaml => TRUE,
427 data => [
428 { 'fnurk' => 'skib', 'ponk' => 'gleeb' },
429 { 'bar' => 'krup', 'foo' => 'plink' }
430 ],
431 raw =>
432 " ---\n -\n fnurk: skib\n ponk: gleeb\n -\n bar: krup\n foo: plink\n ...",
433 },
434 { actual_passed => TRUE,
435 is_actual_ok => TRUE,
436 passed => TRUE,
437 is_ok => TRUE,
438 is_test => TRUE,
439 has_skip => FALSE,
440 has_todo => FALSE,
441 number => 3,
442 description => "",
443 },
444 { actual_passed => TRUE,
445 is_actual_ok => TRUE,
446 passed => TRUE,
447 is_ok => TRUE,
448 is_test => TRUE,
449 has_skip => FALSE,
450 has_todo => FALSE,
451 number => 4,
452 description => "",
453 },
454 { is_yaml => TRUE,
455 data => {
456 'got' => [ '1', 'pong', '4' ],
457 'expected' => [ '1', '2', '4' ]
458 },
459 raw =>
460 " ---\n expected:\n - 1\n - 2\n - 4\n got:\n - 1\n - pong\n - 4\n ...",
461 },
462 { actual_passed => TRUE,
463 is_actual_ok => TRUE,
464 passed => TRUE,
465 is_ok => TRUE,
466 is_test => TRUE,
467 has_skip => FALSE,
468 has_todo => FALSE,
469 number => 5,
470 description => "",
471 },
472 ],
473 plan => '1..5',
474 passed => [ 1 .. 5 ],
475 actual_passed => [ 1 .. 5 ],
476 failed => [],
477 actual_failed => [],
478 todo => [],
479 todo_passed => [],
480 skipped => [],
481 good_plan => TRUE,
482 is_good_plan => TRUE,
483 tests_planned => 5,
484 tests_run => 5,
485 parse_errors => [],
486 'exit' => 0,
487 wait => 0,
488 version => 13,
489 },
490 simple_fail => {
491 results => [
492 { is_plan => TRUE,
493 raw => '1..5',
494 tests_planned => 5,
495 passed => TRUE,
496 is_ok => TRUE,
497 },
498 { actual_passed => TRUE,
499 is_actual_ok => TRUE,
500 passed => TRUE,
501 is_ok => TRUE,
502 is_test => TRUE,
503 has_skip => FALSE,
504 has_todo => FALSE,
505 number => 1,
506 description => "",
507 },
508 { actual_passed => FALSE,
509 is_actual_ok => FALSE,
510 passed => FALSE,
511 is_ok => FALSE,
512 is_test => TRUE,
513 has_skip => FALSE,
514 has_todo => FALSE,
515 number => 2,
516 description => "",
517 },
518 { actual_passed => TRUE,
519 is_actual_ok => TRUE,
520 passed => TRUE,
521 is_ok => TRUE,
522 is_test => TRUE,
523 has_skip => FALSE,
524 has_todo => FALSE,
525 number => 3,
526 description => "",
527 },
528 { actual_passed => TRUE,
529 is_actual_ok => TRUE,
530 passed => TRUE,
531 is_ok => TRUE,
532 is_test => TRUE,
533 has_skip => FALSE,
534 has_todo => FALSE,
535 number => 4,
536 description => "",
537 },
538 { actual_passed => FALSE,
539 is_actual_ok => FALSE,
540 passed => FALSE,
541 is_ok => FALSE,
542 is_test => TRUE,
543 has_skip => FALSE,
544 has_todo => FALSE,
545 number => 5,
546 description => "",
547 },
548 ],
549 plan => '1..5',
550 passed => [ 1, 3, 4 ],
551 actual_passed => [ 1, 3, 4 ],
552 failed => [ 2, 5 ],
553 actual_failed => [ 2, 5 ],
554 todo => [],
555 todo_passed => [],
556 skipped => [],
557 good_plan => TRUE,
558 is_good_plan => TRUE,
559 tests_planned => 5,
560 tests_run => 5,
561 parse_errors => [],
562 'exit' => 0,
563 wait => 0,
564 version => 12,
565 },
566 skip => {
567 results => [
568 { is_plan => TRUE,
569 raw => '1..5',
570 tests_planned => 5,
571 passed => TRUE,
572 is_ok => TRUE,
573 },
574 { actual_passed => TRUE,
575 is_actual_ok => TRUE,
576 passed => TRUE,
577 is_ok => TRUE,
578 is_test => TRUE,
579 has_skip => FALSE,
580 has_todo => FALSE,
581 number => 1,
582 description => "",
583 },
584 { actual_passed => TRUE,
585 is_actual_ok => TRUE,
586 passed => TRUE,
587 is_ok => TRUE,
588 is_test => TRUE,
589 has_skip => TRUE,
590 has_todo => FALSE,
591 number => 2,
592 description => "",
593 explanation => 'rain delay',
594 },
595 { actual_passed => TRUE,
596 is_actual_ok => TRUE,
597 passed => TRUE,
598 is_ok => TRUE,
599 is_test => TRUE,
600 has_skip => FALSE,
601 has_todo => FALSE,
602 number => 3,
603 description => "",
604 },
605 { actual_passed => TRUE,
606 is_actual_ok => TRUE,
607 passed => TRUE,
608 is_ok => TRUE,
609 is_test => TRUE,
610 has_skip => FALSE,
611 has_todo => FALSE,
612 number => 4,
613 description => "",
614 },
615 { actual_passed => TRUE,
616 is_actual_ok => TRUE,
617 passed => TRUE,
618 is_ok => TRUE,
619 is_test => TRUE,
620 has_skip => FALSE,
621 has_todo => FALSE,
622 number => 5,
623 description => "",
624 },
625 ],
626 plan => '1..5',
627 passed => [ 1 .. 5 ],
628 actual_passed => [ 1 .. 5 ],
629 failed => [],
630 actual_failed => [],
631 todo => [],
632 todo_passed => [],
633 skipped => [2],
634 good_plan => TRUE,
635 is_good_plan => TRUE,
636 tests_planned => 5,
637 tests_run => 5,
638 parse_errors => [],
639 'exit' => 0,
640 wait => 0,
641 version => 12,
642 },
643 skip_nomsg => {
644 results => [
645 { is_plan => TRUE,
646 passed => TRUE,
647 is_ok => TRUE,
648 raw => '1..1',
649 tests_planned => 1,
650 },
651 { actual_passed => TRUE,
652 is_actual_ok => TRUE,
653 passed => TRUE,
654 is_ok => TRUE,
655 is_test => TRUE,
656 has_skip => TRUE,
657 has_todo => FALSE,
658 number => 1,
659 description => "",
660 explanation => '',
661 },
662 ],
663 plan => '1..1',
664 passed => [1],
665 actual_passed => [1],
666 failed => [],
667 actual_failed => [],
668 todo => [],
669 todo_passed => [],
670 skipped => [1],
671 good_plan => TRUE,
672 is_good_plan => TRUE,
673 tests_planned => 1,
674 tests_run => TRUE,
675 parse_errors => [],
676 'exit' => 0,
677 wait => 0,
678 version => 12,
679 },
680 todo_inline => {
681 results => [
682 { is_plan => TRUE,
683 passed => TRUE,
684 is_ok => TRUE,
685 raw => '1..3',
686 tests_planned => 3,
687 },
688 { actual_passed => FALSE,
689 is_actual_ok => FALSE,
690 passed => TRUE,
691 is_ok => TRUE,
692 is_test => TRUE,
693 has_skip => FALSE,
694 has_todo => TRUE,
695 number => 1,
696 description => "- Foo",
697 explanation => 'Just testing the todo interface.',
698 },
699 { actual_passed => TRUE,
700 is_actual_ok => TRUE,
701 passed => TRUE,
702 is_ok => TRUE,
703 is_test => TRUE,
704 has_skip => FALSE,
705 has_todo => TRUE,
706 number => 2,
707 description => "- Unexpected success",
708 explanation => 'Just testing the todo interface.',
709 },
710 { actual_passed => TRUE,
711 is_actual_ok => TRUE,
712 passed => TRUE,
713 is_ok => TRUE,
714 is_test => TRUE,
715 has_skip => FALSE,
716 has_todo => FALSE,
717 number => 3,
718 description => "- This is not todo",
719 explanation => '',
720 },
721 ],
722 plan => '1..3',
723 passed => [ 1, 2, 3 ],
724 actual_passed => [ 2, 3 ],
725 failed => [],
726 actual_failed => [1],
727 todo => [ 1, 2 ],
728 todo_passed => [2],
729 skipped => [],
730 good_plan => TRUE,
731 is_good_plan => TRUE,
732 tests_planned => 3,
733 tests_run => 3,
734 parse_errors => [],
735 'exit' => 0,
736 wait => 0,
737 version => 12,
738 },
739 todo => {
740 results => [
741 { is_plan => TRUE,
742 passed => TRUE,
743 is_ok => TRUE,
744 raw => '1..5 todo 3 2;',
745 tests_planned => 5,
746 todo_list => [ 3, 2 ],
747 },
748 { actual_passed => TRUE,
749 is_actual_ok => TRUE,
750 passed => TRUE,
751 is_ok => TRUE,
752 is_test => TRUE,
753 has_skip => FALSE,
754 has_todo => FALSE,
755 number => 1,
756 description => "",
757 explanation => '',
758 },
759 { actual_passed => TRUE,
760 is_actual_ok => TRUE,
761 passed => TRUE,
762 is_ok => TRUE,
763 is_test => TRUE,
764 has_skip => FALSE,
765 has_todo => TRUE,
766 number => 2,
767 description => "",
768 explanation => '',
769 },
770 { actual_passed => FALSE,
771 is_actual_ok => FALSE,
772 passed => TRUE,
773 is_ok => TRUE,
774 is_test => TRUE,
775 has_skip => FALSE,
776 has_todo => TRUE,
777 number => 3,
778 description => "",
779 explanation => '',
780 },
781 { actual_passed => TRUE,
782 is_actual_ok => TRUE,
783 passed => TRUE,
784 is_ok => TRUE,
785 is_test => TRUE,
786 has_skip => FALSE,
787 has_todo => FALSE,
788 number => 4,
789 description => "",
790 explanation => '',
791 },
792 { actual_passed => TRUE,
793 is_actual_ok => TRUE,
794 passed => TRUE,
795 is_ok => TRUE,
796 is_test => TRUE,
797 has_skip => FALSE,
798 has_todo => FALSE,
799 number => 5,
800 description => "",
801 explanation => '',
802 },
803 ],
804 plan => '1..5',
805 passed => [ 1, 2, 3, 4, 5 ],
806 actual_passed => [ 1, 2, 4, 5 ],
807 failed => [],
808 actual_failed => [3],
809 todo => [ 2, 3 ],
810 todo_passed => [2],
811 skipped => [],
812 good_plan => TRUE,
813 is_good_plan => TRUE,
814 tests_planned => 5,
815 tests_run => 5,
816 parse_errors => [],
817 'exit' => 0,
818 wait => 0,
819 version => 12,
820 },
821 duplicates => {
822 results => [
823 { is_plan => TRUE,
824 passed => TRUE,
825 is_ok => TRUE,
826 raw => '1..10',
827 tests_planned => 10,
828 },
829 { actual_passed => TRUE,
830 is_actual_ok => TRUE,
831 passed => TRUE,
832 is_ok => TRUE,
833 is_test => TRUE,
834 has_skip => FALSE,
835 has_todo => FALSE,
836 number => 1,
837 description => '',
838 explanation => '',
839 is_unplanned => FALSE,
840 },
841 { actual_passed => TRUE,
842 is_actual_ok => TRUE,
843 passed => TRUE,
844 is_ok => TRUE,
845 is_test => TRUE,
846 has_skip => FALSE,
847 has_todo => FALSE,
848 number => 2,
849 description => '',
850 explanation => '',
851 is_unplanned => FALSE,
852 },
853 { actual_passed => TRUE,
854 is_actual_ok => TRUE,
855 passed => TRUE,
856 is_ok => TRUE,
857 is_test => TRUE,
858 has_skip => FALSE,
859 has_todo => FALSE,
860 number => 3,
861 description => '',
862 explanation => '',
863 is_unplanned => FALSE,
864 },
865 { actual_passed => TRUE,
866 is_actual_ok => TRUE,
867 passed => TRUE,
868 is_ok => TRUE,
869 is_test => TRUE,
870 has_skip => FALSE,
871 has_todo => FALSE,
872 number => 4,
873 description => '',
874 explanation => '',
875 is_unplanned => FALSE,
876 },
877 { actual_passed => TRUE,
878 is_actual_ok => TRUE,
879 passed => TRUE,
880 is_ok => TRUE,
881 is_test => TRUE,
882 has_skip => FALSE,
883 has_todo => FALSE,
884 number => 4,
885 description => '',
886 explanation => '',
887 is_unplanned => FALSE,
888 },
889 { actual_passed => TRUE,
890 is_actual_ok => TRUE,
891 passed => TRUE,
892 is_ok => TRUE,
893 is_test => TRUE,
894 has_skip => FALSE,
895 has_todo => FALSE,
896 number => 5,
897 description => '',
898 explanation => '',
899 is_unplanned => FALSE,
900 },
901 { actual_passed => TRUE,
902 is_actual_ok => TRUE,
903 passed => TRUE,
904 is_ok => TRUE,
905 is_test => TRUE,
906 has_skip => FALSE,
907 has_todo => FALSE,
908 number => 6,
909 description => '',
910 explanation => '',
911 is_unplanned => FALSE,
912 },
913 { actual_passed => TRUE,
914 is_actual_ok => TRUE,
915 passed => TRUE,
916 is_ok => TRUE,
917 is_test => TRUE,
918 has_skip => FALSE,
919 has_todo => FALSE,
920 number => 7,
921 description => '',
922 explanation => '',
923 is_unplanned => FALSE,
924 },
925 { actual_passed => TRUE,
926 is_actual_ok => TRUE,
927 passed => TRUE,
928 is_ok => TRUE,
929 is_test => TRUE,
930 has_skip => FALSE,
931 has_todo => FALSE,
932 number => 8,
933 description => '',
934 explanation => '',
935 is_unplanned => FALSE,
936 },
937 { actual_passed => TRUE,
938 is_actual_ok => TRUE,
939 passed => TRUE,
940 is_ok => TRUE,
941 is_test => TRUE,
942 has_skip => FALSE,
943 has_todo => FALSE,
944 number => 9,
945 description => '',
946 explanation => '',
947 is_unplanned => FALSE,
948 },
949 { actual_passed => TRUE,
950 is_actual_ok => TRUE,
951 passed => FALSE,
952 is_ok => FALSE,
953 is_test => TRUE,
954 has_skip => FALSE,
955 has_todo => FALSE,
956 number => 10,
957 description => '',
958 explanation => '',
959 is_unplanned => TRUE,
960 },
961 ],
962 plan => '1..10',
963 passed => [ 1 .. 4, 4 .. 9 ],
964 actual_passed => [ 1 .. 4, 4 .. 10 ],
965 failed => [10],
966 actual_failed => [],
967 todo => [],
968 todo_passed => [],
969 skipped => [],
970 good_plan => FALSE,
971 tests_planned => 10,
972 tests_run => 11,
973 parse_errors => [
974 'Tests out of sequence. Found (4) but expected (5)',
975 'Tests out of sequence. Found (5) but expected (6)',
976 'Tests out of sequence. Found (6) but expected (7)',
977 'Tests out of sequence. Found (7) but expected (8)',
978 'Tests out of sequence. Found (8) but expected (9)',
979 'Tests out of sequence. Found (9) but expected (10)',
980 'Tests out of sequence. Found (10) but expected (11)',
981 'Bad plan. You planned 10 tests but ran 11.',
982 ],
983 'exit' => 0,
984 wait => 0,
985 },
986 no_nums => {
987 results => [
988 { is_plan => TRUE,
989 passed => TRUE,
990 is_ok => TRUE,
991 raw => '1..5',
992 tests_planned => 5,
993 },
994 { actual_passed => TRUE,
995 is_actual_ok => TRUE,
996 description => "",
997 passed => TRUE,
998 is_ok => TRUE,
999 is_test => TRUE,
1000 has_skip => FALSE,
1001 has_todo => FALSE,
1002 number => 1,
1003 },
1004 { actual_passed => TRUE,
1005 is_actual_ok => TRUE,
1006 passed => TRUE,
1007 is_ok => TRUE,
1008 is_test => TRUE,
1009 has_skip => FALSE,
1010 has_todo => FALSE,
1011 number => 2,
1012 description => "",
1013 },
1014 { actual_passed => FALSE,
1015 is_actual_ok => FALSE,
1016 passed => FALSE,
1017 is_ok => FALSE,
1018 is_test => TRUE,
1019 has_skip => FALSE,
1020 has_todo => FALSE,
1021 number => 3,
1022 description => "",
1023 },
1024 { actual_passed => TRUE,
1025 is_actual_ok => TRUE,
1026 passed => TRUE,
1027 is_ok => TRUE,
1028 is_test => TRUE,
1029 has_skip => FALSE,
1030 has_todo => FALSE,
1031 number => 4,
1032 description => "",
1033 },
1034 { actual_passed => TRUE,
1035 is_actual_ok => TRUE,
1036 passed => TRUE,
1037 is_ok => TRUE,
1038 is_test => TRUE,
1039 has_skip => FALSE,
1040 has_todo => FALSE,
1041 number => 5,
1042 description => "",
1043 }
1044 ],
1045 plan => '1..5',
1046 passed => [ 1, 2, 4, 5 ],
1047 actual_passed => [ 1, 2, 4, 5 ],
1048 failed => [3],
1049 actual_failed => [3],
1050 todo => [],
1051 todo_passed => [],
1052 skipped => [],
1053 good_plan => TRUE,
1054 is_good_plan => TRUE,
1055 tests_planned => 5,
1056 tests_run => 5,
1057 parse_errors => [],
1058 'exit' => 0,
1059 wait => 0,
1060 version => 12,
1061 },
1062 bailout => {
1063 results => [
1064 { is_plan => TRUE,
1065 passed => TRUE,
1066 is_ok => TRUE,
1067 raw => '1..5',
1068 tests_planned => 5,
1069 },
1070 { actual_passed => TRUE,
1071 is_actual_ok => TRUE,
1072 description => "",
1073 passed => TRUE,
1074 is_ok => TRUE,
1075 is_test => TRUE,
1076 has_skip => FALSE,
1077 has_todo => FALSE,
1078 number => 1,
1079 },
1080 { actual_passed => TRUE,
1081 is_actual_ok => TRUE,
1082 passed => TRUE,
1083 is_ok => TRUE,
1084 is_test => TRUE,
1085 has_skip => FALSE,
1086 has_todo => FALSE,
1087 number => 2,
1088 description => "",
1089 },
1090 { actual_passed => TRUE,
1091 is_actual_ok => TRUE,
1092 passed => TRUE,
1093 is_ok => TRUE,
1094 is_test => TRUE,
1095 has_skip => FALSE,
1096 has_todo => FALSE,
1097 number => 3,
1098 description => "",
1099 },
1100 { is_bailout => TRUE,
1101 explanation => "GERONIMMMOOOOOO!!!",
1102 },
1103 { actual_passed => TRUE,
1104 is_actual_ok => TRUE,
1105 passed => TRUE,
1106 is_ok => TRUE,
1107 is_test => TRUE,
1108 has_skip => FALSE,
1109 has_todo => FALSE,
1110 number => 4,
1111 description => "",
1112 },
1113 { actual_passed => TRUE,
1114 is_actual_ok => TRUE,
1115 passed => TRUE,
1116 is_ok => TRUE,
1117 is_test => TRUE,
1118 has_skip => FALSE,
1119 has_todo => FALSE,
1120 number => 5,
1121 description => "",
1122 }
1123 ],
1124 plan => '1..5',
1125 passed => [ 1 .. 5 ],
1126 actual_passed => [ 1 .. 5 ],
1127 failed => [],
1128 actual_failed => [],
1129 todo => [],
1130 todo_passed => [],
1131 skipped => [],
1132 good_plan => TRUE,
1133 is_good_plan => TRUE,
1134 tests_planned => 5,
1135 tests_run => 5,
1136 parse_errors => [],
1137 'exit' => 0,
1138 wait => 0,
1139 version => 12,
1140 },
1141 no_output => {
1142 results => [],
1143 plan => '',
1144 passed => [],
1145 actual_passed => [],
1146 failed => [],
1147 actual_failed => [],
1148 todo => [],
1149 todo_passed => [],
1150 skipped => [],
1151 good_plan => FALSE,
1152 tests_planned => undef,
1153 tests_run => 0,
1154 parse_errors => [ 'No plan found in TAP output', ],
1155 'exit' => 0,
1156 wait => 0,
1157 },
1158 too_many => {
1159 results => [
1160 { is_plan => TRUE,
1161 passed => TRUE,
1162 is_ok => TRUE,
1163 raw => '1..3',
1164 tests_planned => 3,
1165 },
1166 { actual_passed => TRUE,
1167 is_actual_ok => TRUE,
1168 description => "",
1169 passed => TRUE,
1170 is_ok => TRUE,
1171 is_test => TRUE,
1172 has_skip => FALSE,
1173 has_todo => FALSE,
1174 number => 1,
1175 is_unplanned => FALSE,
1176 },
1177 { actual_passed => TRUE,
1178 is_actual_ok => TRUE,
1179 passed => TRUE,
1180 is_ok => TRUE,
1181 is_test => TRUE,
1182 has_skip => FALSE,
1183 has_todo => FALSE,
1184 number => 2,
1185 description => "",
1186 is_unplanned => FALSE,
1187 },
1188 { actual_passed => TRUE,
1189 is_actual_ok => TRUE,
1190 passed => TRUE,
1191 is_ok => TRUE,
1192 is_test => TRUE,
1193 has_skip => FALSE,
1194 has_todo => FALSE,
1195 number => 3,
1196 description => "",
1197 is_unplanned => FALSE,
1198 },
1199 { actual_passed => TRUE,
1200 is_actual_ok => TRUE,
1201 passed => FALSE,
1202 is_ok => FALSE,
1203 is_test => TRUE,
1204 has_skip => FALSE,
1205 has_todo => FALSE,
1206 number => 4,
1207 description => "",
1208 is_unplanned => TRUE,
1209 },
1210 { actual_passed => TRUE,
1211 is_actual_ok => TRUE,
1212 passed => FALSE,
1213 is_ok => FALSE,
1214 is_test => TRUE,
1215 has_skip => FALSE,
1216 has_todo => FALSE,
1217 number => 5,
1218 description => "",
1219 is_unplanned => TRUE,
1220 },
1221 { actual_passed => TRUE,
1222 is_actual_ok => TRUE,
1223 passed => FALSE,
1224 is_ok => FALSE,
1225 is_test => TRUE,
1226 has_skip => FALSE,
1227 has_todo => FALSE,
1228 number => 6,
1229 description => "",
1230 is_unplanned => TRUE,
1231 },
1232 { actual_passed => TRUE,
1233 is_actual_ok => TRUE,
1234 passed => FALSE,
1235 is_ok => FALSE,
1236 is_test => TRUE,
1237 has_skip => FALSE,
1238 has_todo => FALSE,
1239 number => 7,
1240 description => "",
1241 is_unplanned => TRUE,
1242 },
1243 ],
1244 plan => '1..3',
1245 passed => [ 1 .. 3 ],
1246 actual_passed => [ 1 .. 7 ],
1247 failed => [ 4 .. 7 ],
1248 actual_failed => [],
1249 todo => [],
1250 todo_passed => [],
1251 skipped => [],
1252 good_plan => FALSE,
1253 tests_planned => 3,
1254 tests_run => 7,
1255 parse_errors => ['Bad plan. You planned 3 tests but ran 7.'],
1256 'exit' => 4,
1257 wait => NOT_ZERO,
1258 skip_if => sub {$IsVMS},
1259 },
1260 taint => {
1261 results => [
1262 { is_plan => TRUE,
1263 passed => TRUE,
1264 is_ok => TRUE,
1265 raw => '1..1',
1266 tests_planned => TRUE,
1267 },
1268 { actual_passed => TRUE,
1269 is_actual_ok => TRUE,
1270 description => "- -T honored",
1271 passed => TRUE,
1272 is_ok => TRUE,
1273 is_test => TRUE,
1274 has_skip => FALSE,
1275 has_todo => FALSE,
1276 number => 1,
1277 },
1278 ],
1279 plan => '1..1',
1280 passed => [ 1 .. 1 ],
1281 actual_passed => [ 1 .. 1 ],
1282 failed => [],
1283 actual_failed => [],
1284 todo => [],
1285 todo_passed => [],
1286 skipped => [],
1287 good_plan => TRUE,
1288 is_good_plan => TRUE,
1289 tests_planned => TRUE,
1290 tests_run => TRUE,
1291 parse_errors => [],
1292 'exit' => 0,
1293 wait => 0,
1294 version => 12,
1295 },
1296 'die' => {
1297 results => [],
1298 plan => '',
1299 passed => [],
1300 actual_passed => [],
1301 failed => [],
1302 actual_failed => [],
1303 todo => [],
1304 todo_passed => [],
1305 skipped => [],
1306 good_plan => FALSE,
1307 tests_planned => undef,
1308 tests_run => 0,
1309 parse_errors => [ 'No plan found in TAP output', ],
1310 'exit' => NOT_ZERO,
1311 wait => NOT_ZERO,
1312 },
1313 die_head_end => {
1314 results => [
1315 { actual_passed => TRUE,
1316 is_actual_ok => TRUE,
1317 passed => TRUE,
1318 is_ok => TRUE,
1319 is_test => TRUE,
1320 has_skip => FALSE,
1321 has_todo => FALSE,
1322 number => 1,
1323 description => '',
1324 explanation => '',
1325 },
1326 { actual_passed => TRUE,
1327 is_actual_ok => TRUE,
1328 passed => TRUE,
1329 is_ok => TRUE,
1330 is_test => TRUE,
1331 has_skip => FALSE,
1332 has_todo => FALSE,
1333 number => 2,
1334 description => '',
1335 explanation => '',
1336 },
1337 { actual_passed => TRUE,
1338 is_actual_ok => TRUE,
1339 passed => TRUE,
1340 is_ok => TRUE,
1341 is_test => TRUE,
1342 has_skip => FALSE,
1343 has_todo => FALSE,
1344 number => 3,
1345 description => '',
1346 explanation => '',
1347 },
1348 { actual_passed => TRUE,
1349 is_actual_ok => TRUE,
1350 passed => TRUE,
1351 is_ok => TRUE,
1352 is_test => TRUE,
1353 has_skip => FALSE,
1354 has_todo => FALSE,
1355 number => 4,
1356 description => '',
1357 explanation => '',
1358 },
1359 ],
1360 plan => '',
1361 passed => [ 1 .. 4 ],
1362 actual_passed => [ 1 .. 4 ],
1363 failed => [],
1364 actual_failed => [],
1365 todo => [],
1366 todo_passed => [],
1367 skipped => [],
1368 good_plan => FALSE,
1369 tests_planned => undef,
1370 tests_run => 4,
1371 parse_errors => [ 'No plan found in TAP output', ],
1372 'exit' => NOT_ZERO,
1373 wait => NOT_ZERO,
1374 },
1375 die_last_minute => {
1376 results => [
1377 { actual_passed => TRUE,
1378 is_actual_ok => TRUE,
1379 passed => TRUE,
1380 is_ok => TRUE,
1381 is_test => TRUE,
1382 has_skip => FALSE,
1383 has_todo => FALSE,
1384 number => 1,
1385 description => '',
1386 explanation => '',
1387 },
1388 { actual_passed => TRUE,
1389 is_actual_ok => TRUE,
1390 passed => TRUE,
1391 is_ok => TRUE,
1392 is_test => TRUE,
1393 has_skip => FALSE,
1394 has_todo => FALSE,
1395 number => 2,
1396 description => '',
1397 explanation => '',
1398 },
1399 { actual_passed => TRUE,
1400 is_actual_ok => TRUE,
1401 passed => TRUE,
1402 is_ok => TRUE,
1403 is_test => TRUE,
1404 has_skip => FALSE,
1405 has_todo => FALSE,
1406 number => 3,
1407 description => '',
1408 explanation => '',
1409 },
1410 { actual_passed => TRUE,
1411 is_actual_ok => TRUE,
1412 passed => TRUE,
1413 is_ok => TRUE,
1414 is_test => TRUE,
1415 has_skip => FALSE,
1416 has_todo => FALSE,
1417 number => 4,
1418 description => '',
1419 explanation => '',
1420 },
1421 { is_plan => TRUE,
1422 passed => TRUE,
1423 is_ok => TRUE,
1424 raw => '1..4',
1425 tests_planned => 4,
1426 },
1427 ],
1428 plan => '1..4',
1429 passed => [ 1 .. 4 ],
1430 actual_passed => [ 1 .. 4 ],
1431 failed => [],
1432 actual_failed => [],
1433 todo => [],
1434 todo_passed => [],
1435 skipped => [],
1436 good_plan => TRUE,
1437 is_good_plan => TRUE,
1438 tests_planned => 4,
1439 tests_run => 4,
1440 parse_errors => [],
1441 'exit' => NOT_ZERO,
1442 wait => NOT_ZERO,
1443 },
1444 bignum => {
1445 results => [
1446 { is_plan => TRUE,
1447 passed => TRUE,
1448 is_ok => TRUE,
1449 raw => '1..2',
1450 tests_planned => 2,
1451 },
1452 { actual_passed => TRUE,
1453 is_actual_ok => TRUE,
1454 passed => TRUE,
1455 is_ok => TRUE,
1456 is_test => TRUE,
1457 has_skip => FALSE,
1458 has_todo => FALSE,
1459 number => 1,
1460 description => '',
1461 explanation => '',
1462 },
1463 { actual_passed => TRUE,
1464 is_actual_ok => TRUE,
1465 passed => TRUE,
1466 is_ok => TRUE,
1467 is_test => TRUE,
1468 has_skip => FALSE,
1469 has_todo => FALSE,
1470 number => 2,
1471 description => '',
1472 explanation => '',
1473 },
1474 { actual_passed => TRUE,
1475 is_actual_ok => TRUE,
1476 passed => FALSE,
1477 is_ok => FALSE,
1478 is_test => TRUE,
1479 has_skip => FALSE,
1480 has_todo => FALSE,
1481 number => 136211425,
1482 description => '',
1483 explanation => '',
1484 },
1485 { actual_passed => TRUE,
1486 is_actual_ok => TRUE,
1487 passed => FALSE,
1488 is_ok => FALSE,
1489 is_test => TRUE,
1490 has_skip => FALSE,
1491 has_todo => FALSE,
1492 number => 136211426,
1493 description => '',
1494 explanation => '',
1495 },
1496 ],
1497 plan => '1..2',
1498 passed => [ 1, 2 ],
1499 actual_passed => [ 1, 2, 136211425, 136211426 ],
1500 failed => [ 136211425, 136211426 ],
1501 actual_failed => [],
1502 todo => [],
1503 todo_passed => [],
1504 skipped => [],
1505 good_plan => FALSE,
1506 tests_planned => 2,
1507 tests_run => 4,
1508 parse_errors => [
1509 'Tests out of sequence. Found (136211425) but expected (3)',
1510 'Tests out of sequence. Found (136211426) but expected (4)',
1511 'Bad plan. You planned 2 tests but ran 4.'
1512 ],
1513 'exit' => 0,
1514 wait => 0,
1515 },
1516 bignum_many => {
1517 results => [
1518 { is_plan => TRUE,
1519 passed => TRUE,
1520 is_ok => TRUE,
1521 raw => '1..2',
1522 tests_planned => 2,
1523 },
1524 { actual_passed => TRUE,
1525 is_actual_ok => TRUE,
1526 passed => TRUE,
1527 is_ok => TRUE,
1528 is_test => TRUE,
1529 has_skip => FALSE,
1530 has_todo => FALSE,
1531 number => 1,
1532 description => '',
1533 explanation => '',
1534 },
1535 { actual_passed => TRUE,
1536 is_actual_ok => TRUE,
1537 passed => TRUE,
1538 is_ok => TRUE,
1539 is_test => TRUE,
1540 has_skip => FALSE,
1541 has_todo => FALSE,
1542 number => 2,
1543 description => '',
1544 explanation => '',
1545 },
1546 { actual_passed => TRUE,
1547 is_actual_ok => TRUE,
1548 passed => FALSE,
1549 is_ok => FALSE,
1550 is_test => TRUE,
1551 has_skip => FALSE,
1552 has_todo => FALSE,
1553 number => 99997,
1554 description => '',
1555 explanation => '',
1556 },
1557 { actual_passed => TRUE,
1558 is_actual_ok => TRUE,
1559 passed => FALSE,
1560 is_ok => FALSE,
1561 is_test => TRUE,
1562 has_skip => FALSE,
1563 has_todo => FALSE,
1564 number => 99998,
1565 description => '',
1566 explanation => '',
1567 },
1568 { actual_passed => TRUE,
1569 is_actual_ok => TRUE,
1570 passed => FALSE,
1571 is_ok => FALSE,
1572 is_test => TRUE,
1573 has_skip => FALSE,
1574 has_todo => FALSE,
1575 number => 99999,
1576 description => '',
1577 explanation => '',
1578 },
1579 { actual_passed => TRUE,
1580 is_actual_ok => TRUE,
1581 passed => FALSE,
1582 is_ok => FALSE,
1583 is_test => TRUE,
1584 has_skip => FALSE,
1585 has_todo => FALSE,
1586 number => 100000,
1587 description => '',
1588 explanation => '',
1589 },
1590 { actual_passed => TRUE,
1591 is_actual_ok => TRUE,
1592 passed => FALSE,
1593 is_ok => FALSE,
1594 is_test => TRUE,
1595 has_skip => FALSE,
1596 has_todo => FALSE,
1597 number => 100001,
1598 description => '',
1599 explanation => '',
1600 },
1601 { actual_passed => TRUE,
1602 is_actual_ok => TRUE,
1603 passed => FALSE,
1604 is_ok => FALSE,
1605 is_test => TRUE,
1606 has_skip => FALSE,
1607 has_todo => FALSE,
1608 number => 100002,
1609 description => '',
1610 explanation => '',
1611 },
1612 { actual_passed => TRUE,
1613 is_actual_ok => TRUE,
1614 passed => FALSE,
1615 is_ok => FALSE,
1616 is_test => TRUE,
1617 has_skip => FALSE,
1618 has_todo => FALSE,
1619 number => 100003,
1620 description => '',
1621 explanation => '',
1622 },
1623 { actual_passed => TRUE,
1624 is_actual_ok => TRUE,
1625 passed => FALSE,
1626 is_ok => FALSE,
1627 is_test => TRUE,
1628 has_skip => FALSE,
1629 has_todo => FALSE,
1630 number => 100004,
1631 description => '',
1632 explanation => '',
1633 },
1634 { actual_passed => TRUE,
1635 is_actual_ok => TRUE,
1636 passed => FALSE,
1637 is_ok => FALSE,
1638 is_test => TRUE,
1639 has_skip => FALSE,
1640 has_todo => FALSE,
1641 number => 100005,
1642 description => '',
1643 explanation => '',
1644 },
1645 ],
1646 plan => '1..2',
1647 passed => [ 1, 2 ],
1648 actual_passed => [ 1, 2, 99997 .. 100005 ],
1649 failed => [ 99997 .. 100005 ],
1650 actual_failed => [],
1651 todo => [],
1652 todo_passed => [],
1653 skipped => [],
1654 good_plan => FALSE,
1655 tests_planned => 2,
1656 tests_run => 11,
1657 parse_errors => [
1658 'Tests out of sequence. Found (99997) but expected (3)',
1659 'Tests out of sequence. Found (99998) but expected (4)',
1660 'Tests out of sequence. Found (99999) but expected (5)',
1661 'Tests out of sequence. Found (100000) but expected (6)',
1662 'Tests out of sequence. Found (100001) but expected (7)',
1663 'Tests out of sequence. Found (100002) but expected (8)',
1664 'Tests out of sequence. Found (100003) but expected (9)',
1665 'Tests out of sequence. Found (100004) but expected (10)',
1666 'Tests out of sequence. Found (100005) but expected (11)',
1667 'Bad plan. You planned 2 tests but ran 11.'
1668 ],
1669 'exit' => 0,
1670 wait => 0,
1671 },
1672 combined => {
1673 results => [
1674 { is_plan => TRUE,
1675 passed => TRUE,
1676 is_ok => TRUE,
1677 raw => '1..10',
1678 tests_planned => 10,
1679 },
1680 { actual_passed => TRUE,
1681 is_actual_ok => TRUE,
1682 passed => TRUE,
1683 is_ok => TRUE,
1684 is_test => TRUE,
1685 has_skip => FALSE,
1686 has_todo => FALSE,
1687 number => 1,
1688 description => '',
1689 explanation => '',
1690 },
1691 { actual_passed => TRUE,
1692 is_actual_ok => TRUE,
1693 passed => TRUE,
1694 is_ok => TRUE,
1695 is_test => TRUE,
1696 has_skip => FALSE,
1697 has_todo => FALSE,
1698 number => 2,
1699 description => 'basset hounds got long ears',
1700 explanation => '',
1701 },
1702 { actual_passed => FALSE,
1703 is_actual_ok => FALSE,
1704 passed => FALSE,
1705 is_ok => FALSE,
1706 is_test => TRUE,
1707 has_skip => FALSE,
1708 has_todo => FALSE,
1709 number => 3,
1710 description => 'all hell broke loose',
1711 explanation => '',
1712 },
1713 { actual_passed => FALSE,
1714 is_actual_ok => FALSE,
1715 passed => TRUE,
1716 is_ok => TRUE,
1717 is_test => TRUE,
1718 has_skip => FALSE,
1719 has_todo => TRUE,
1720 number => 4,
1721 description => '',
1722 explanation => 'if I heard a voice from heaven ...',
1723 },
1724 { actual_passed => TRUE,
1725 is_actual_ok => TRUE,
1726 passed => TRUE,
1727 is_ok => TRUE,
1728 is_test => TRUE,
1729 has_skip => FALSE,
1730 has_todo => FALSE,
1731 number => 5,
1732 description => 'say "live without loving",',
1733 explanation => '',
1734 },
1735 { actual_passed => TRUE,
1736 is_actual_ok => TRUE,
1737 passed => TRUE,
1738 is_ok => TRUE,
1739 is_test => TRUE,
1740 has_skip => FALSE,
1741 has_todo => FALSE,
1742 number => 6,
1743 description => "I'd beg off.",
1744 explanation => '',
1745 },
1746 { actual_passed => TRUE,
1747 is_actual_ok => TRUE,
1748 passed => TRUE,
1749 is_ok => TRUE,
1750 is_test => TRUE,
1751 has_skip => '1',
1752 has_todo => FALSE,
1753 number => 7,
1754 description => '',
1755 explanation => 'contract negotiations',
1756 },
1757 { actual_passed => TRUE,
1758 is_actual_ok => TRUE,
1759 passed => TRUE,
1760 is_ok => TRUE,
1761 is_test => TRUE,
1762 has_skip => FALSE,
1763 has_todo => FALSE,
1764 number => 8,
1765 description => 'Girls are such exquisite hell',
1766 explanation => '',
1767 },
1768 { actual_passed => TRUE,
1769 is_actual_ok => TRUE,
1770 passed => TRUE,
1771 is_ok => TRUE,
1772 is_test => TRUE,
1773 has_skip => FALSE,
1774 has_todo => TRUE,
1775 number => 9,
1776 description => 'Elegy 9B',
1777 explanation => '',
1778 },
1779 { actual_passed => FALSE,
1780 is_actual_ok => FALSE,
1781 passed => FALSE,
1782 is_ok => FALSE,
1783 is_test => TRUE,
1784 has_skip => FALSE,
1785 has_todo => FALSE,
1786 number => 10,
1787 description => '',
1788 explanation => '',
1789 },
1790 ],
1791 plan => '1..10',
1792 passed => [ 1 .. 2, 4 .. 9 ],
1793 actual_passed => [ 1 .. 2, 5 .. 9 ],
1794 failed => [ 3, 10 ],
1795 actual_failed => [ 3, 4, 10 ],
1796 todo => [ 4, 9 ],
1797 todo_passed => [9],
1798 skipped => [7],
1799 good_plan => TRUE,
1800 is_good_plan => TRUE,
1801 tests_planned => 10,
1802 tests_run => 10,
1803 parse_errors => [],
1804 'exit' => 0,
1805 wait => 0,
1806 version => 12,
1807 },
1808 head_end => {
1809 results => [
1810 { is_comment => TRUE,
1811 passed => TRUE,
1812 is_ok => TRUE,
1813 comment => 'comments',
1814 },
1815 { actual_passed => TRUE,
1816 is_actual_ok => TRUE,
1817 passed => TRUE,
1818 is_ok => TRUE,
1819 is_test => TRUE,
1820 has_skip => FALSE,
1821 has_todo => FALSE,
1822 number => 1,
1823 description => '',
1824 explanation => '',
1825 },
1826 { actual_passed => TRUE,
1827 is_actual_ok => TRUE,
1828 passed => TRUE,
1829 is_ok => TRUE,
1830 is_test => TRUE,
1831 has_skip => FALSE,
1832 has_todo => FALSE,
1833 number => 2,
1834 description => '',
1835 explanation => '',
1836 },
1837 { actual_passed => TRUE,
1838 is_actual_ok => TRUE,
1839 passed => TRUE,
1840 is_ok => TRUE,
1841 is_test => TRUE,
1842 has_skip => FALSE,
1843 has_todo => FALSE,
1844 number => 3,
1845 description => '',
1846 explanation => '',
1847 },
1848 { actual_passed => TRUE,
1849 is_actual_ok => TRUE,
1850 passed => TRUE,
1851 is_ok => TRUE,
1852 is_test => TRUE,
1853 has_skip => FALSE,
1854 has_todo => FALSE,
1855 number => 4,
1856 description => '',
1857 explanation => '',
1858 },
1859 { is_comment => TRUE,
1860 passed => TRUE,
1861 is_ok => TRUE,
1862 comment => 'comment',
1863 },
1864 { is_plan => TRUE,
1865 passed => TRUE,
1866 is_ok => TRUE,
1867 raw => '1..4',
1868 tests_planned => 4,
1869 },
1870 { is_comment => TRUE,
1871 passed => TRUE,
1872 is_ok => TRUE,
1873 comment => 'more ignored stuff',
1874 },
1875 { is_comment => TRUE,
1876 passed => TRUE,
1877 is_ok => TRUE,
1878 comment => 'and yet more',
1879 },
1880 ],
1881 plan => '1..4',
1882 passed => [ 1 .. 4 ],
1883 actual_passed => [ 1 .. 4 ],
1884 failed => [],
1885 actual_failed => [],
1886 todo => [],
1887 todo_passed => [],
1888 skipped => [],
1889 good_plan => TRUE,
1890 is_good_plan => TRUE,
1891 tests_planned => 4,
1892 tests_run => 4,
1893 parse_errors => [],
1894 'exit' => 0,
1895 wait => 0,
1896 version => 12,
1897 },
1898 head_fail => {
1899 results => [
1900 { is_comment => TRUE,
1901 passed => TRUE,
1902 is_ok => TRUE,
1903 comment => 'comments',
1904 },
1905 { actual_passed => TRUE,
1906 is_actual_ok => TRUE,
1907 passed => TRUE,
1908 is_ok => TRUE,
1909 is_test => TRUE,
1910 has_skip => FALSE,
1911 has_todo => FALSE,
1912 number => 1,
1913 description => '',
1914 explanation => '',
1915 },
1916 { actual_passed => FALSE,
1917 is_actual_ok => FALSE,
1918 passed => FALSE,
1919 is_ok => FALSE,
1920 is_test => TRUE,
1921 has_skip => FALSE,
1922 has_todo => FALSE,
1923 number => 2,
1924 description => '',
1925 explanation => '',
1926 },
1927 { actual_passed => TRUE,
1928 is_actual_ok => TRUE,
1929 passed => TRUE,
1930 is_ok => TRUE,
1931 is_test => TRUE,
1932 has_skip => FALSE,
1933 has_todo => FALSE,
1934 number => 3,
1935 description => '',
1936 explanation => '',
1937 },
1938 { actual_passed => TRUE,
1939 is_actual_ok => TRUE,
1940 passed => TRUE,
1941 is_ok => TRUE,
1942 is_test => TRUE,
1943 has_skip => FALSE,
1944 has_todo => FALSE,
1945 number => 4,
1946 description => '',
1947 explanation => '',
1948 },
1949 { is_comment => TRUE,
1950 passed => TRUE,
1951 is_ok => TRUE,
1952 comment => 'comment',
1953 },
1954 { is_plan => TRUE,
1955 passed => TRUE,
1956 is_ok => TRUE,
1957 raw => '1..4',
1958 tests_planned => 4,
1959 },
1960 { is_comment => TRUE,
1961 passed => TRUE,
1962 is_ok => TRUE,
1963 comment => 'more ignored stuff',
1964 },
1965 { is_comment => TRUE,
1966 passed => TRUE,
1967 is_ok => TRUE,
1968 comment => 'and yet more',
1969 },
1970 ],
1971 plan => '1..4',
1972 passed => [ 1, 3, 4 ],
1973 actual_passed => [ 1, 3, 4 ],
1974 failed => [2],
1975 actual_failed => [2],
1976 todo => [],
1977 todo_passed => [],
1978 skipped => [],
1979 good_plan => TRUE,
1980 is_good_plan => TRUE,
1981 tests_planned => 4,
1982 tests_run => 4,
1983 parse_errors => [],
1984 'exit' => 0,
1985 wait => 0,
1986 version => 12,
1987 },
1988 out_of_order => {
1989 results => [
1990 { actual_passed => TRUE,
1991 is_actual_ok => TRUE,
1992 passed => TRUE,
1993 is_ok => TRUE,
1994 is_test => TRUE,
1995 has_skip => FALSE,
1996 has_todo => FALSE,
1997 number => 2,
1998 description => '- Test that argument passing works',
1999 explanation => '',
2000 },
2001 { actual_passed => TRUE,
2002 is_actual_ok => TRUE,
2003 passed => TRUE,
2004 is_ok => TRUE,
2005 is_test => TRUE,
2006 has_skip => FALSE,
2007 has_todo => FALSE,
2008 number => 3,
2009 description =>
2010 '- Test that passing arguments as references work',
2011 explanation => '',
2012 },
2013 { actual_passed => TRUE,
2014 is_actual_ok => TRUE,
2015 passed => TRUE,
2016 is_ok => TRUE,
2017 is_test => TRUE,
2018 has_skip => FALSE,
2019 has_todo => FALSE,
2020 number => 4,
2021 description => '- Test a normal sub',
2022 explanation => '',
2023 },
2024 { actual_passed => TRUE,
2025 is_actual_ok => TRUE,
2026 passed => TRUE,
2027 is_ok => TRUE,
2028 is_test => TRUE,
2029 has_skip => FALSE,
2030 has_todo => FALSE,
2031 number => 6,
2032 description => '- Detach test',
2033 explanation => '',
2034 },
2035 { actual_passed => TRUE,
2036 is_actual_ok => TRUE,
2037 passed => TRUE,
2038 is_ok => TRUE,
2039 is_test => TRUE,
2040 has_skip => FALSE,
2041 has_todo => FALSE,
2042 number => 8,
2043 description => '- Nested thread test',
2044 explanation => '',
2045 },
2046 { actual_passed => TRUE,
2047 is_actual_ok => TRUE,
2048 passed => TRUE,
2049 is_ok => TRUE,
2050 is_test => TRUE,
2051 has_skip => FALSE,
2052 has_todo => FALSE,
2053 number => 9,
2054 description => '- Nested thread test',
2055 explanation => '',
2056 },
2057 { actual_passed => TRUE,
2058 is_actual_ok => TRUE,
2059 passed => TRUE,
2060 is_ok => TRUE,
2061 is_test => TRUE,
2062 has_skip => FALSE,
2063 has_todo => FALSE,
2064 number => 10,
2065 description => '- Wanted 7, got 7',
2066 explanation => '',
2067 },
2068 { actual_passed => TRUE,
2069 is_actual_ok => TRUE,
2070 passed => TRUE,
2071 is_ok => TRUE,
2072 is_test => TRUE,
2073 has_skip => FALSE,
2074 has_todo => FALSE,
2075 number => 11,
2076 description => '- Wanted 7, got 7',
2077 explanation => '',
2078 },
2079 { actual_passed => TRUE,
2080 is_actual_ok => TRUE,
2081 passed => TRUE,
2082 is_ok => TRUE,
2083 is_test => TRUE,
2084 has_skip => FALSE,
2085 has_todo => FALSE,
2086 number => 12,
2087 description => '- Wanted 8, got 8',
2088 explanation => '',
2089 },
2090 { actual_passed => TRUE,
2091 is_actual_ok => TRUE,
2092 passed => TRUE,
2093 is_ok => TRUE,
2094 is_test => TRUE,
2095 has_skip => FALSE,
2096 has_todo => FALSE,
2097 number => 13,
2098 description => '- Wanted 8, got 8',
2099 explanation => '',
2100 },
2101 { is_plan => TRUE,
2102 passed => TRUE,
2103 is_ok => TRUE,
2104 raw => '1..15',
2105 tests_planned => 15,
2106 },
2107 { actual_passed => TRUE,
2108 is_actual_ok => TRUE,
2109 passed => TRUE,
2110 is_ok => TRUE,
2111 is_test => TRUE,
2112 has_skip => FALSE,
2113 has_todo => FALSE,
2114 number => 1,
2115 description => '',
2116 explanation => '',
2117 },
2118 { actual_passed => TRUE,
2119 is_actual_ok => TRUE,
2120 passed => TRUE,
2121 is_ok => TRUE,
2122 is_test => TRUE,
2123 has_skip => FALSE,
2124 has_todo => FALSE,
2125 number => 5,
2126 description => '- Check that Config::threads is true',
2127 explanation => '',
2128 },
2129 { actual_passed => TRUE,
2130 is_actual_ok => TRUE,
2131 passed => TRUE,
2132 is_ok => TRUE,
2133 is_test => TRUE,
2134 has_skip => FALSE,
2135 has_todo => FALSE,
2136 number => 7,
2137 description => '- Detach test',
2138 explanation => '',
2139 },
2140 { actual_passed => TRUE,
2141 is_actual_ok => TRUE,
2142 passed => TRUE,
2143 is_ok => TRUE,
2144 is_test => TRUE,
2145 has_skip => FALSE,
2146 has_todo => FALSE,
2147 number => 14,
2148 description =>
2149 '- Check so that tid for threads work for main thread',
2150 explanation => '',
2151 },
2152 { actual_passed => TRUE,
2153 is_actual_ok => TRUE,
2154 passed => TRUE,
2155 is_ok => TRUE,
2156 is_test => TRUE,
2157 has_skip => FALSE,
2158 has_todo => FALSE,
2159 number => 15,
2160 description =>
2161 '- Check so that tid for threads work for main thread',
2162 explanation => '',
2163 },
2164 ],
2165 plan => '1..15',
2166 passed => [ 2 .. 4, 6, 8 .. 13, 1, 5, 7, 14, 15 ],
2167 actual_passed => [ 2 .. 4, 6, 8 .. 13, 1, 5, 7, 14, 15 ],
2168 failed => [],
2169 actual_failed => [],
2170 todo => [],
2171 todo_passed => [],
2172 skipped => [],
2173 is_good_plan => FALSE,
2174 tests_planned => 15,
2175 tests_run => 15,
2176
2177 # Note that tests 14 and 15 *are* in the correct sequence.
2178 parse_errors => [
2179 'Tests out of sequence. Found (2) but expected (1)',
2180 'Tests out of sequence. Found (3) but expected (2)',
2181 'Tests out of sequence. Found (4) but expected (3)',
2182 'Tests out of sequence. Found (6) but expected (4)',
2183 'Tests out of sequence. Found (8) but expected (5)',
2184 'Tests out of sequence. Found (9) but expected (6)',
2185 'Tests out of sequence. Found (10) but expected (7)',
2186 'Tests out of sequence. Found (11) but expected (8)',
2187 'Tests out of sequence. Found (12) but expected (9)',
2188 'Tests out of sequence. Found (13) but expected (10)',
2189 'Plan (1..15) must be at the beginning or end of the TAP output',
2190 'Tests out of sequence. Found (1) but expected (11)',
2191 'Tests out of sequence. Found (5) but expected (12)',
2192 'Tests out of sequence. Found (7) but expected (13)',
2193 ],
2194 'exit' => 0,
2195 wait => 0,
2196 },
2197 skipall => {
2198 results => [
2199 { is_plan => TRUE,
2200 raw => '1..0 # skipping: rope',
2201 tests_planned => 0,
2202 passed => TRUE,
2203 is_ok => TRUE,
2204 directive => 'SKIP',
a39e16d8 2205 explanation => 'rope'
b965d173 2206 },
2207 ],
2208 plan => '1..0',
2209 passed => [],
2210 actual_passed => [],
2211 failed => [],
2212 actual_failed => [],
2213 todo => [],
2214 todo_passed => [],
2215 skipped => [],
2216 good_plan => TRUE,
2217 is_good_plan => TRUE,
2218 tests_planned => 0,
2219 tests_run => 0,
2220 parse_errors => [],
2221 'exit' => 0,
2222 wait => 0,
2223 version => 12,
a39e16d8 2224 skip_all => 'rope',
b965d173 2225 },
2226 skipall_v13 => {
2227 results => [
2228 { is_version => TRUE,
2229 raw => 'TAP version 13',
2230 },
2231 { is_unknown => TRUE,
2232 raw => '1..0 # skipping: rope',
2233 },
2234 ],
2235 plan => '',
2236 passed => [],
2237 actual_passed => [],
2238 failed => [],
2239 actual_failed => [],
2240 todo => [],
2241 todo_passed => [],
2242 skipped => [],
2243 good_plan => FALSE,
2244 is_good_plan => FALSE,
2245 tests_planned => FALSE,
2246 tests_run => 0,
2247 parse_errors => ['No plan found in TAP output'],
2248 'exit' => 0,
2249 wait => 0,
2250 version => 13,
2251 },
2a7f4b9b 2252 strict => {
2253 results => [
2254 { is_version => TRUE,
2255 raw => 'TAP version 13',
2256 },
2257 { is_plan => TRUE,
2258 raw => '1..1',
2259 },
2260 { is_pragma => TRUE,
2261 raw => 'pragma +strict',
2262 pragmas => ['+strict'],
2263 },
2264 { is_unknown => TRUE, raw => 'Nonsense!',
2265 },
2266 { is_pragma => TRUE,
2267 raw => 'pragma -strict',
2268 pragmas => ['-strict'],
2269 },
2270 { is_unknown => TRUE,
2271 raw => "Doesn't matter.",
2272 },
2273 { is_test => TRUE,
2274 raw => 'ok 1 All OK',
2275 }
2276 ],
2277 plan => '1..1',
2278 passed => [1],
2279 actual_passed => [1],
2280 failed => [],
2281 actual_failed => [],
2282 todo => [],
2283 todo_passed => [],
2284 skipped => [],
2285 good_plan => TRUE,
2286 is_good_plan => TRUE,
2287 tests_planned => 1,
2288 tests_run => 1,
2289 parse_errors => ['Unknown TAP token: "Nonsense!"'],
2290 'exit' => 0, # TODO: Is this right???
2291 wait => 0,
2292 version => 13,
2293 },
b965d173 2294 skipall_nomsg => {
2295 results => [
2296 { is_plan => TRUE,
2297 raw => '1..0',
2298 tests_planned => 0,
2299 passed => TRUE,
2300 is_ok => TRUE,
2301 directive => 'SKIP',
2302 explanation => ''
2303 },
2304 ],
2305 plan => '1..0',
2306 passed => [],
2307 actual_passed => [],
2308 failed => [],
2309 actual_failed => [],
2310 todo => [],
2311 todo_passed => [],
2312 skipped => [],
2313 good_plan => TRUE,
2314 is_good_plan => TRUE,
2315 tests_planned => 0,
2316 tests_run => 0,
2317 parse_errors => [],
2318 'exit' => 0,
2319 wait => 0,
2320 version => 12,
2321 skip_all => '(no reason given)',
2322 },
2323 todo_misparse => {
2324 results => [
2325 { is_plan => TRUE,
2326 raw => '1..1',
2327 tests_planned => TRUE,
2328 passed => TRUE,
2329 is_ok => TRUE,
2330 },
2331 { actual_passed => FALSE,
2332 is_actual_ok => FALSE,
2333 passed => FALSE,
2334 is_ok => FALSE,
2335 is_test => TRUE,
2336 has_skip => FALSE,
2337 has_todo => FALSE,
2338 number => 1,
2339 description => 'Hamlette # TODOORNOTTODO',
2340 explanation => '',
2341 },
2342 ],
2343 plan => '1..1',
2344 passed => [],
2345 actual_passed => [],
2346 failed => [1],
2347 actual_failed => [1],
2348 todo => [],
2349 todo_passed => [],
2350 skipped => [],
2351 good_plan => TRUE,
2352 is_good_plan => TRUE,
2353 tests_planned => TRUE,
2354 tests_run => 1,
2355 parse_errors => [],
2356 'exit' => 0,
2357 wait => 0,
2358 version => 12,
2359 },
2360 shbang_misparse => {
2361 results => [
2362 { is_plan => TRUE,
2363 raw => '1..2',
2364 tests_planned => 2,
2365 passed => TRUE,
2366 is_ok => TRUE,
2367 },
2368 { actual_passed => TRUE,
2369 is_actual_ok => TRUE,
2370 description => "",
2371 passed => TRUE,
2372 is_ok => TRUE,
2373 is_test => TRUE,
2374 has_skip => FALSE,
2375 has_todo => FALSE,
2376 number => 1,
2377 },
2378 { actual_passed => TRUE,
2379 is_actual_ok => TRUE,
2380 passed => TRUE,
2381 is_ok => TRUE,
2382 is_test => TRUE,
2383 has_skip => FALSE,
2384 has_todo => FALSE,
2385 number => 2,
2386 description => "",
2387 },
2388 ],
2389 plan => '1..2',
2390 passed => [ 1 .. 2 ],
2391 actual_passed => [ 1 .. 2 ],
2392 failed => [],
2393 actual_failed => [],
2394 todo => [],
2395 todo_passed => [],
2396 skipped => [],
2397 good_plan => TRUE,
2398 is_good_plan => TRUE,
2399 tests_planned => 2,
2400 tests_run => 2,
2401 parse_errors => [],
2402 'exit' => 0,
2403 wait => 0,
2404 version => 12,
2405 },
69f36734 2406 switches => {
2407 results => [
2408 { is_plan => TRUE,
2409 passed => TRUE,
2410 is_ok => TRUE,
2411 raw => '1..1',
2412 tests_planned => 1,
2413 },
2414 { actual_passed => TRUE,
2415 is_actual_ok => TRUE,
2416 passed => TRUE,
2417 is_ok => TRUE,
2418 is_test => TRUE,
2419 has_skip => FALSE,
2420 has_todo => FALSE,
2421 number => 1,
2422 description => "",
2423 explanation => '',
2424 },
2425 ],
2426 __ARGS__ => { switches => ['-Mstrict'] },
2427 plan => '1..1',
2428 passed => [1],
2429 actual_passed => [1],
2430 failed => [],
2431 actual_failed => [],
2432 todo => [],
2433 todo_passed => [],
2434 skipped => [],
2435 good_plan => TRUE,
2436 is_good_plan => TRUE,
2437 tests_planned => 1,
2438 tests_run => TRUE,
2439 parse_errors => [],
2440 'exit' => 0,
2441 wait => 0,
2442 version => 12,
2443 },
b965d173 2444 inc_taint => {
2445 results => [
2446 { is_plan => TRUE,
2447 passed => TRUE,
2448 is_ok => TRUE,
2449 raw => '1..1',
2450 tests_planned => 1,
2451 },
2452 { actual_passed => TRUE,
2453 is_actual_ok => TRUE,
2454 passed => TRUE,
2455 is_ok => TRUE,
2456 is_test => TRUE,
2457 has_skip => FALSE,
2458 has_todo => FALSE,
2459 number => 1,
2460 description => "",
2461 explanation => '',
2462 },
2463 ],
2464 __ARGS__ => { switches => ['-Iexamples'] },
2465 plan => '1..1',
2466 passed => [1],
2467 actual_passed => [1],
2468 failed => [],
2469 actual_failed => [],
2470 todo => [],
2471 todo_passed => [],
2472 skipped => [],
2473 good_plan => TRUE,
2474 is_good_plan => TRUE,
2475 tests_planned => 1,
2476 tests_run => TRUE,
2477 parse_errors => [],
2478 'exit' => 0,
2479 wait => 0,
2480 version => 12,
2481 },
2482 sequence_misparse => {
2483 results => [
2484 { is_plan => TRUE,
2485 raw => '1..5',
2486 tests_planned => 5,
2487 passed => TRUE,
2488 is_ok => TRUE,
2489 },
2490 { actual_passed => TRUE,
2491 is_actual_ok => TRUE,
2492 passed => TRUE,
2493 is_ok => TRUE,
2494 is_test => TRUE,
2495 has_skip => FALSE,
2496 has_todo => FALSE,
2497 number => 1,
2498 description => "",
2499 },
2500 { actual_passed => TRUE,
2501 is_actual_ok => TRUE,
2502 passed => TRUE,
2503 is_ok => TRUE,
2504 is_test => TRUE,
2505 has_skip => FALSE,
2506 has_todo => FALSE,
2507 number => 2,
2508 description => "",
2509 },
2510 { actual_passed => TRUE,
2511 is_actual_ok => TRUE,
2512 passed => TRUE,
2513 is_ok => TRUE,
2514 is_test => TRUE,
2515 has_skip => FALSE,
2516 has_todo => FALSE,
2517 number => 3,
2518 description => "\# skipped on foobar system",
2519 },
2520 { is_comment => TRUE,
2521 comment => '1234567890123456789012345678901234567890',
2522 },
2523 { actual_passed => TRUE,
2524 is_actual_ok => TRUE,
2525 passed => TRUE,
2526 is_ok => TRUE,
2527 is_test => TRUE,
2528 has_skip => FALSE,
2529 has_todo => FALSE,
2530 number => 4,
2531 description => "",
2532 },
2533 { is_comment => TRUE,
2534 comment => '1234567890123456789012345678901234567890',
2535 },
2536 { actual_passed => TRUE,
2537 is_actual_ok => TRUE,
2538 passed => TRUE,
2539 is_ok => TRUE,
2540 is_test => TRUE,
2541 has_skip => FALSE,
2542 has_todo => FALSE,
2543 number => 5,
2544 description => "",
2545 },
2546 ],
2547 plan => '1..5',
2548 passed => [ 1 .. 5 ],
2549 actual_passed => [ 1 .. 5 ],
2550 failed => [],
2551 actual_failed => [],
2552 todo => [],
2553 todo_passed => [],
2554 skipped => [],
2555 good_plan => TRUE,
2556 is_good_plan => TRUE,
2557 tests_planned => 5,
2558 tests_run => 5,
2559 parse_errors => [],
2560 'exit' => 0,
2561 wait => 0,
2562 version => 12,
2563 },
2564
bdaf8c65 2565 # For some reason mixing stdout with stderr is unreliable on Windows
2566 ( $IsWin32
2567 ? ()
2568 : ( stdout_stderr => {
2569 results => [
2570 { is_comment => TRUE,
2571 passed => TRUE,
2572 is_ok => TRUE,
2573 comment => 'comments',
2574 },
2575 { actual_passed => TRUE,
2576 is_actual_ok => TRUE,
2577 passed => TRUE,
2578 is_ok => TRUE,
2579 is_test => TRUE,
2580 has_skip => FALSE,
2581 has_todo => FALSE,
2582 number => 1,
2583 description => '',
2584 explanation => '',
2585 },
2586 { actual_passed => TRUE,
2587 is_actual_ok => TRUE,
2588 passed => TRUE,
2589 is_ok => TRUE,
2590 is_test => TRUE,
2591 has_skip => FALSE,
2592 has_todo => FALSE,
2593 number => 2,
2594 description => '',
2595 explanation => '',
2596 },
2597 { actual_passed => TRUE,
2598 is_actual_ok => TRUE,
2599 passed => TRUE,
2600 is_ok => TRUE,
2601 is_test => TRUE,
2602 has_skip => FALSE,
2603 has_todo => FALSE,
2604 number => 3,
2605 description => '',
2606 explanation => '',
2607 },
2608 { is_comment => TRUE,
2609 passed => TRUE,
2610 is_ok => TRUE,
2611 comment => 'comment',
2612 },
2613 { actual_passed => TRUE,
2614 is_actual_ok => TRUE,
2615 passed => TRUE,
2616 is_ok => TRUE,
2617 is_test => TRUE,
2618 has_skip => FALSE,
2619 has_todo => FALSE,
2620 number => 4,
2621 description => '',
2622 explanation => '',
2623 },
2624 { is_comment => TRUE,
2625 passed => TRUE,
2626 is_ok => TRUE,
2627 comment => 'more ignored stuff',
2628 },
2629 { is_comment => TRUE,
2630 passed => TRUE,
2631 is_ok => TRUE,
2632 comment => 'and yet more',
2633 },
2634 { is_plan => TRUE,
2635 passed => TRUE,
2636 is_ok => TRUE,
2637 raw => '1..4',
2638 tests_planned => 4,
2639 },
2640 ],
2641 plan => '1..4',
2642 passed => [ 1 .. 4 ],
2643 actual_passed => [ 1 .. 4 ],
2644 failed => [],
2645 actual_failed => [],
2646 todo => [],
2647 todo_passed => [],
2648 skipped => [],
2649 good_plan => TRUE,
2650 is_good_plan => TRUE,
b965d173 2651 tests_planned => 4,
bdaf8c65 2652 tests_run => 4,
2653 parse_errors => [],
2654 'exit' => 0,
2655 wait => 0,
2656 version => 12,
2657 need_open3 => 1,
2658 }
2659 )
2660 ),
b965d173 2661
2662 junk_before_plan => {
2663 results => [
2664 { is_unknown => TRUE,
2665 raw => 'this is junk',
2666 },
2667 { is_comment => TRUE,
2668 comment => "this is a comment",
2669 },
2670 { is_plan => TRUE,
2671 passed => TRUE,
2672 is_ok => TRUE,
2673 raw => '1..1',
2674 tests_planned => 1,
2675 },
2676 { actual_passed => TRUE,
2677 is_actual_ok => TRUE,
2678 passed => TRUE,
2679 is_ok => TRUE,
2680 is_test => TRUE,
2681 has_skip => FALSE,
2682 has_todo => FALSE,
2683 number => 1,
2684 },
2685 ],
2686 plan => '1..1',
2687 passed => [ 1 .. 1 ],
2688 actual_passed => [ 1 .. 1 ],
2689 failed => [],
2690 actual_failed => [],
2691 todo => [],
2692 todo_passed => [],
2693 skipped => [],
2694 good_plan => TRUE,
2695 is_good_plan => TRUE,
2696 tests_planned => 1,
2697 tests_run => 1,
2698 parse_errors => [],
2699 'exit' => 0,
2700 wait => 0,
2701 version => 12,
2702 },
2703 version_good => {
2704 results => [
2705 { is_version => TRUE,
2706 raw => 'TAP version 13',
2707 },
2708 { is_plan => TRUE,
2709 raw => '1..5',
2710 tests_planned => 5,
2711 passed => TRUE,
2712 is_ok => TRUE,
2713 },
2714 { actual_passed => TRUE,
2715 is_actual_ok => TRUE,
2716 passed => TRUE,
2717 is_ok => TRUE,
2718 is_test => TRUE,
2719 has_skip => FALSE,
2720 has_todo => FALSE,
2721 number => 1,
2722 description => "",
2723 },
2724 { actual_passed => TRUE,
2725 is_actual_ok => TRUE,
2726 passed => TRUE,
2727 is_ok => TRUE,
2728 is_test => TRUE,
2729 has_skip => FALSE,
2730 has_todo => FALSE,
2731 number => 2,
2732 description => "",
2733 },
2734 { actual_passed => TRUE,
2735 is_actual_ok => TRUE,
2736 passed => TRUE,
2737 is_ok => TRUE,
2738 is_test => TRUE,
2739 has_skip => FALSE,
2740 has_todo => FALSE,
2741 number => 3,
2742 description => "",
2743 },
2744 { actual_passed => TRUE,
2745 is_actual_ok => TRUE,
2746 passed => TRUE,
2747 is_ok => TRUE,
2748 is_test => TRUE,
2749 has_skip => FALSE,
2750 has_todo => FALSE,
2751 number => 4,
2752 description => "",
2753 },
2754 { actual_passed => TRUE,
2755 is_actual_ok => TRUE,
2756 passed => TRUE,
2757 is_ok => TRUE,
2758 is_test => TRUE,
2759 has_skip => FALSE,
2760 has_todo => FALSE,
2761 number => 5,
2762 description => "",
2763 },
2764 ],
2765 plan => '1..5',
2766 passed => [ 1 .. 5 ],
2767 actual_passed => [ 1 .. 5 ],
2768 failed => [],
2769 actual_failed => [],
2770 todo => [],
2771 todo_passed => [],
2772 skipped => [],
2773 good_plan => TRUE,
2774 is_good_plan => TRUE,
2775 tests_planned => 5,
2776 tests_run => 5,
2777 parse_errors => [],
2778 'exit' => 0,
2779 wait => 0,
2780 version => 13,
2781 },
2782 version_old => {
2783 results => [
2784 { is_version => TRUE,
2785 raw => 'TAP version 12',
2786 },
2787 { is_plan => TRUE,
2788 raw => '1..5',
2789 tests_planned => 5,
2790 passed => TRUE,
2791 is_ok => TRUE,
2792 },
2793 { actual_passed => TRUE,
2794 is_actual_ok => TRUE,
2795 passed => TRUE,
2796 is_ok => TRUE,
2797 is_test => TRUE,
2798 has_skip => FALSE,
2799 has_todo => FALSE,
2800 number => 1,
2801 description => "",
2802 },
2803 { actual_passed => TRUE,
2804 is_actual_ok => TRUE,
2805 passed => TRUE,
2806 is_ok => TRUE,
2807 is_test => TRUE,
2808 has_skip => FALSE,
2809 has_todo => FALSE,
2810 number => 2,
2811 description => "",
2812 },
2813 { actual_passed => TRUE,
2814 is_actual_ok => TRUE,
2815 passed => TRUE,
2816 is_ok => TRUE,
2817 is_test => TRUE,
2818 has_skip => FALSE,
2819 has_todo => FALSE,
2820 number => 3,
2821 description => "",
2822 },
2823 { actual_passed => TRUE,
2824 is_actual_ok => TRUE,
2825 passed => TRUE,
2826 is_ok => TRUE,
2827 is_test => TRUE,
2828 has_skip => FALSE,
2829 has_todo => FALSE,
2830 number => 4,
2831 description => "",
2832 },
2833 { actual_passed => TRUE,
2834 is_actual_ok => TRUE,
2835 passed => TRUE,
2836 is_ok => TRUE,
2837 is_test => TRUE,
2838 has_skip => FALSE,
2839 has_todo => FALSE,
2840 number => 5,
2841 description => "",
2842 },
2843 ],
2844 plan => '1..5',
2845 passed => [ 1 .. 5 ],
2846 actual_passed => [ 1 .. 5 ],
2847 failed => [],
2848 actual_failed => [],
2849 todo => [],
2850 todo_passed => [],
2851 skipped => [],
2852 good_plan => TRUE,
2853 is_good_plan => TRUE,
2854 tests_planned => 5,
2855 tests_run => 5,
2856 parse_errors =>
2a7f4b9b 2857 ['Explicit TAP version must be at least 13. Got version 12'],
b965d173 2858 'exit' => 0,
2859 wait => 0,
2860 version => 12,
2861 },
2862 version_late => {
2863 results => [
2864 { is_plan => TRUE,
2865 raw => '1..5',
2866 tests_planned => 5,
2867 passed => TRUE,
2868 is_ok => TRUE,
2869 },
2870 { is_version => TRUE,
2871 raw => 'TAP version 13',
2872 },
2873 { actual_passed => TRUE,
2874 is_actual_ok => TRUE,
2875 passed => TRUE,
2876 is_ok => TRUE,
2877 is_test => TRUE,
2878 has_skip => FALSE,
2879 has_todo => FALSE,
2880 number => 1,
2881 description => "",
2882 },
2883 { actual_passed => TRUE,
2884 is_actual_ok => TRUE,
2885 passed => TRUE,
2886 is_ok => TRUE,
2887 is_test => TRUE,
2888 has_skip => FALSE,
2889 has_todo => FALSE,
2890 number => 2,
2891 description => "",
2892 },
2893 { actual_passed => TRUE,
2894 is_actual_ok => TRUE,
2895 passed => TRUE,
2896 is_ok => TRUE,
2897 is_test => TRUE,
2898 has_skip => FALSE,
2899 has_todo => FALSE,
2900 number => 3,
2901 description => "",
2902 },
2903 { actual_passed => TRUE,
2904 is_actual_ok => TRUE,
2905 passed => TRUE,
2906 is_ok => TRUE,
2907 is_test => TRUE,
2908 has_skip => FALSE,
2909 has_todo => FALSE,
2910 number => 4,
2911 description => "",
2912 },
2913 { actual_passed => TRUE,
2914 is_actual_ok => TRUE,
2915 passed => TRUE,
2916 is_ok => TRUE,
2917 is_test => TRUE,
2918 has_skip => FALSE,
2919 has_todo => FALSE,
2920 number => 5,
2921 description => "",
2922 },
2923 ],
2924 plan => '1..5',
2925 passed => [ 1 .. 5 ],
2926 actual_passed => [ 1 .. 5 ],
2927 failed => [],
2928 actual_failed => [],
2929 todo => [],
2930 todo_passed => [],
2931 skipped => [],
2932 good_plan => TRUE,
2933 is_good_plan => TRUE,
2934 tests_planned => 5,
2935 tests_run => 5,
2936 parse_errors =>
2a7f4b9b 2937 ['If TAP version is present it must be the first line of output'],
b965d173 2938 'exit' => 0,
2939 wait => 0,
2940 version => 12,
2941 },
2942
2943 escape_eol => {
2944 results => [
2945 { is_plan => TRUE,
2946 raw => '1..2',
2947 tests_planned => 2,
2948 passed => TRUE,
2949 is_ok => TRUE,
2950 },
2951 { actual_passed => TRUE,
2952 is_actual_ok => TRUE,
2953 description =>
2954 'Should parse as literal backslash --> \\',
2955 passed => TRUE,
2956 is_ok => TRUE,
2957 is_test => TRUE,
2958 has_skip => FALSE,
2959 has_todo => FALSE,
2960 number => 1,
2961 is_unplanned => FALSE,
2962 },
2963 { actual_passed => TRUE,
2964 is_actual_ok => TRUE,
2965 passed => TRUE,
2966 is_ok => TRUE,
2967 is_test => TRUE,
2968 has_skip => FALSE,
2969 has_todo => FALSE,
2970 number => 2,
2971 description => 'Not a continuation line',
2972 is_unplanned => FALSE,
2973 },
2974 ],
2975 plan => '1..2',
2976 passed => [ 1 .. 2 ],
2977 actual_passed => [ 1 .. 2 ],
2978 failed => [],
2979 actual_failed => [],
2980 todo => [],
2981 todo_passed => [],
2982 skipped => [],
2983 good_plan => TRUE,
2984 is_good_plan => TRUE,
2985 tests_planned => 2,
2986 tests_run => 2,
2987 parse_errors => [],
2988 'exit' => 0,
2989 wait => 0,
2990 version => 12,
2991 },
2992
2993 escape_hash => {
2994 results => [
2995 { is_plan => TRUE,
2996 raw => '1..3',
2997 tests_planned => 3,
2998 passed => TRUE,
2999 is_ok => TRUE,
3000 },
3001 { actual_passed => TRUE,
3002 is_actual_ok => TRUE,
3003 description => 'Not a \\# TODO',
3004 passed => TRUE,
3005 is_ok => TRUE,
3006 is_test => TRUE,
3007 has_skip => FALSE,
3008 has_todo => FALSE,
3009 number => 1,
3010 is_unplanned => FALSE,
3011 },
3012 { actual_passed => TRUE,
3013 is_actual_ok => TRUE,
3014 passed => TRUE,
3015 is_ok => TRUE,
3016 is_test => TRUE,
3017 has_skip => FALSE,
3018 has_todo => FALSE,
3019 number => 2,
3020 description => 'Not a \\# SKIP',
3021 is_unplanned => FALSE,
3022 },
3023 { actual_passed => TRUE,
3024 is_actual_ok => TRUE,
3025 passed => TRUE,
3026 is_ok => TRUE,
3027 is_test => TRUE,
3028 has_skip => FALSE,
3029 has_todo => FALSE,
3030 number => 3,
3031 description => 'Escaped \\\\\\#',
3032 is_unplanned => FALSE,
3033 },
3034 ],
3035 plan => '1..3',
3036 passed => [ 1 .. 3 ],
3037 actual_passed => [ 1 .. 3 ],
3038 failed => [],
3039 actual_failed => [],
3040 todo => [],
3041 todo_passed => [],
3042 skipped => [],
3043 good_plan => TRUE,
3044 is_good_plan => TRUE,
3045 tests_planned => 3,
3046 tests_run => 3,
3047 parse_errors => [],
3048 'exit' => 0,
3049 wait => 0,
3050 version => 12,
3051 },
a39e16d8 3052
3053 zero_valid => {
3054 results => [
3055 { is_plan => TRUE,
3056 raw => '1..5',
3057 tests_planned => 5,
3058 passed => TRUE,
3059 is_ok => TRUE,
3060 },
3061 { actual_passed => TRUE,
3062 is_actual_ok => TRUE,
3063 description => '- One',
3064 passed => TRUE,
3065 is_ok => TRUE,
3066 is_test => TRUE,
3067 has_skip => FALSE,
3068 has_todo => FALSE,
3069 number => 1,
3070 is_unplanned => FALSE,
3071 },
3072 { actual_passed => TRUE,
3073 is_actual_ok => TRUE,
3074 description => '- Two',
3075 passed => TRUE,
3076 is_ok => TRUE,
3077 is_test => TRUE,
3078 has_skip => FALSE,
3079 has_todo => FALSE,
3080 number => 2,
3081 is_unplanned => FALSE,
3082 },
3083 { actual_passed => TRUE,
3084 is_actual_ok => TRUE,
3085 description => '- Three',
3086 passed => TRUE,
3087 is_ok => TRUE,
3088 is_test => TRUE,
3089 has_skip => FALSE,
3090 has_todo => FALSE,
3091 number => 3,
3092 is_unplanned => FALSE,
3093 },
3094 { actual_passed => TRUE,
3095 is_actual_ok => TRUE,
3096 description => '- Four',
3097 passed => TRUE,
3098 is_ok => TRUE,
3099 is_test => TRUE,
3100 has_skip => FALSE,
3101 has_todo => FALSE,
3102 number => 0,
3103 is_unplanned => FALSE,
3104 },
3105 { actual_passed => TRUE,
3106 is_actual_ok => TRUE,
3107 description => '- Five',
3108 passed => TRUE,
3109 is_ok => TRUE,
3110 is_test => TRUE,
3111 has_skip => FALSE,
3112 has_todo => FALSE,
3113 number => 5,
3114 is_unplanned => FALSE,
3115 },
3116 ],
3117 plan => '1..5',
3118 passed => [ 1 .. 3, 0, 5 ],
3119 actual_passed => [ 1 .. 3, 0, 5 ],
3120 failed => [],
3121 actual_failed => [],
3122 todo => [],
3123 todo_passed => [],
3124 skipped => [],
3125 good_plan => TRUE,
3126 is_good_plan => TRUE,
3127 tests_planned => 5,
3128 tests_run => 5,
3129 parse_errors => [
3130 'Tests out of sequence. Found (0) but expected (4)',
3131 ],
3132 'exit' => 0,
3133 wait => 0,
3134 version => 12,
3135 },
b965d173 3136);
3137
3138my %HANDLER_FOR = (
3139 NOT_ZERO, sub { local $^W; 0 != shift },
3140 TRUE, sub { local $^W; !!shift },
3141 FALSE, sub { local $^W; !shift },
3142);
3143
3144my $can_open3 = ( $Config{d_fork} || $IsWin32 ) ? 1 : 0;
3145
3146for my $hide_fork ( 0 .. $can_open3 ) {
3147 if ($hide_fork) {
3148 no strict 'refs';
3149 local $^W = 0;
3150 *{'TAP::Parser::Iterator::Process::_use_open3'} = sub {return};
3151 }
3152
3153 TEST:
3154 for my $test ( sort keys %samples ) {
3155
3156 #next unless 'empty' eq $test;
3157 my %details = %{ $samples{$test} };
3158
3159 if ( my $skip_if = delete $details{skip_if} ) {
3160 next TEST if $skip_if->();
3161 }
3162
3163 my $results = delete $details{results};
3164 my $args = delete $details{__ARGS__};
3165 my $need_open3 = delete $details{need_open3};
3166
3167 next TEST if $need_open3 && ( $hide_fork || !$can_open3 );
3168
3169 # the following acrobatics are necessary to make it easy for the
3170 # Test::Builder::failure_output() method to be overridden when
3171 # TAP::Parser is not installed. Otherwise, these tests will fail.
5e727a3e 3172
3173 unshift @{ $args->{switches} },
3174 $ENV{PERL_CORE} ? ( map {"-I$_"} @INC ) : ('-It/lib');
b965d173 3175
3176 $args->{source} = File::Spec->catfile( $SAMPLE_TESTS, $test );
3177 $args->{merge} = !$hide_fork;
3178
3179 my $parser = eval { analyze_test( $test, [@$results], $args ) };
3180 my $error = $@;
5e727a3e 3181 ok !$error, "'$test' should parse successfully"
3182 or diag $error;
b965d173 3183
3184 if ($error) {
3185 my $tests = 0;
3186 while ( my ( $method, $answer ) = each %details ) {
3187 $tests += ref $answer ? 2 : 1;
3188 }
3189 SKIP: {
3190 skip "$test did not parse successfully", $tests;
3191 }
3192 }
3193 else {
3194 while ( my ( $method, $answer ) = each %details ) {
3195 if ( my $handler = $HANDLER_FOR{ $answer || '' } ) { # yuck
3196 ok $handler->( $parser->$method() ),
3197 "... and $method should return a reasonable value ($test)";
3198 }
3199 elsif ( !ref $answer ) {
3200 local $^W; # uninit warnings
3201
3202 $answer = _vmsify_answer( $method, $answer );
3203
3204 is $parser->$method(), $answer,
3205 "... and $method should equal $answer ($test)";
3206 }
3207 else {
3208 is scalar $parser->$method(), scalar @$answer,
3209 "... and $method should be the correct amount ($test)";
3210 is_deeply [ $parser->$method() ], $answer,
3211 "... and $method should be the correct values ($test)";
3212 }
3213 }
3214 }
3215 }
3216}
3217
5e727a3e 3218my %Unix2VMS_Exit_Codes = ( 1 => 4, );
b965d173 3219
3220sub _vmsify_answer {
3221 my ( $method, $answer ) = @_;
3222
3223 return $answer unless $IsVMS;
3224
3225 if ( $method eq 'exit'
3226 and exists $Unix2VMS_Exit_Codes{$answer} )
3227 {
3228 $answer = $Unix2VMS_Exit_Codes{$answer};
3229 }
3230
3231 return $answer;
3232}
3233
3234sub analyze_test {
3235 my ( $test, $results, $args ) = @_;
3236
3237 my $parser = TAP::Parser->new($args);
3238 my $count = 1;
3239 while ( defined( my $result = $parser->next ) ) {
3240
3241 my $expected = shift @$results;
3242 my $desc
3243 = $result->is_test
3244 ? $result->description
3245 : $result->raw;
5e727a3e 3246 $desc = $result->plan
3247 if $result->is_plan && $desc =~ /SKIP/i;
b965d173 3248 $desc =~ s/#/<hash>/g;
3249 $desc =~ s/\s+/ /g; # Drop newlines
3250 ok defined $expected,
3251 "$test/$count We should have a result for $desc";
3252 while ( my ( $method, $answer ) = each %$expected ) {
3253
3254 if ( my $handler = $HANDLER_FOR{ $answer || '' } ) { # yuck
3255 ok $handler->( $result->$method() ),
3256 "... and $method should return a reasonable value ($test/$count)";
3257 }
3258 elsif ( ref $answer ) {
2a7f4b9b 3259 is_deeply scalar( $result->$method() ), $answer,
b965d173 3260 "... and $method should return the correct structure ($test/$count)";
3261 }
3262 else {
3263 is $result->$method(), $answer,
3264 "... and $method should return the correct answer ($test/$count)";
3265 }
3266 }
3267 $count++;
3268 }
3269 is @$results, 0,
3270 "... and we should have the correct number of results ($test)";
3271 return $parser;
3272}
3273
3274# vms_nit