BEGIN {
chdir 't';
}
else {
}
}
use strict;
# VMS uses native, not POSIX, exit codes.
# MacPerl's exit codes are broken.
$IsMacPerl ? 0 :
1;
my %samples = (
simple => {
total => {
bonus => 0,
max => 5,
'ok' => 5,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
simple_fail => {
total => {
bonus => 0,
max => 5,
'ok' => 3,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped => 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
descriptive => {
total => {
bonus => 0,
max => 5,
'ok' => 5,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
no_nums => {
total => {
bonus => 0,
max => 5,
'ok' => 4,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
'todo' => {
total => {
bonus => 1,
max => 5,
'ok' => 5,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 2,
skipped => 0,
},
failed => { },
all_ok => 1,
},
todo_inline => {
total => {
bonus => 1,
max => 3,
'ok' => 3,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped => 0,
'todo' => 2,
skipped => 0,
},
failed => { },
all_ok => 1,
},
'skip' => {
total => {
bonus => 0,
max => 5,
'ok' => 5,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 1,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
'skip_nomsg' => {
total => {
bonus => 0,
max => 1,
'ok' => 1,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 1,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
bailout => 0,
combined => {
total => {
bonus => 1,
max => 10,
'ok' => 8,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 1,
'todo' => 2,
skipped => 0
},
failed => {
},
all_ok => 0,
},
duplicates => {
total => {
bonus => 0,
max => 10,
'ok' => 11,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
head_end => {
total => {
bonus => 0,
max => 4,
'ok' => 4,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
head_fail => {
total => {
bonus => 0,
max => 4,
'ok' => 3,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
no_output => {
total => {
bonus => 0,
max => 0,
'ok' => 0,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped => 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
skipall => {
total => {
bonus => 0,
max => 0,
'ok' => 0,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 1,
},
failed => { },
all_ok => 1,
},
skipall_nomsg => {
total => {
bonus => 0,
max => 0,
'ok' => 0,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 1,
},
failed => { },
all_ok => 1,
},
with_comments => {
total => {
bonus => 2,
max => 5,
'ok' => 5,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 4,
skipped => 0,
},
failed => { },
all_ok => 1,
},
taint => {
total => {
bonus => 0,
max => 1,
'ok' => 1,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
taint_warn => {
total => {
bonus => 0,
max => 1,
'ok' => 1,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
'die' => {
total => {
bonus => 0,
max => 0,
'ok' => 0,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
estat => $die_estat,
},
all_ok => 0,
},
die_head_end => {
total => {
bonus => 0,
max => 0,
'ok' => 4,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
estat => $die_estat,
},
all_ok => 0,
},
die_last_minute => {
total => {
bonus => 0,
max => 4,
'ok' => 4,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
estat => $die_estat,
max => 4,
failed => 0,
},
all_ok => 0,
},
bignum => {
total => {
bonus => 0,
max => 2,
'ok' => 4,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
'shbang_misparse' => {
total => {
bonus => 0,
max => 2,
'ok' => 2,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
too_many => {
total => {
bonus => 0,
max => 3,
'ok' => 7,
files => 1,
bad => 1,
good => 0,
tests => 1,
sub_skipped => 0,
'todo' => 0,
skipped => 0,
},
failed => {
},
all_ok => 0,
},
switches => {
total => {
bonus => 0,
max => 1,
'ok' => 1,
files => 1,
bad => 0,
good => 1,
tests => 1,
sub_skipped=> 0,
'todo' => 0,
skipped => 0,
},
failed => { },
all_ok => 1,
},
);
SKIP: {
# _run_all_tests() runs the tests but skips the formatting.
eval {
select NULL; # _run_all_tests() isn't as quiet as it should be.
};
select STDOUT;
# $? is unreliable in MacPerl, so we'll just fudge it.
$failed->{estat} = $die_estat if $IsMacPerl and $failed;
SKIP: {
}
SKIP: {
}
SKIP: {
Enormous test number seen [test 100001]
Can't detailize, too big.
Enormous test number seen [test 136211425]
Can't detailize, too big.
WARN
}
SKIP: {
}
}
}