BEGIN {
chdir 't';
}
else {
}
}
use strict;
# VMS uses native, not POSIX, exit codes.
# We can only predict that the wait status should be zero or not.
my $wait_non_zero = 1;
my %samples = (
combined => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 10,
seen => 10,
'ok' => 8,
'todo' => 2,
'skip' => 1,
bonus => 1,
},
},
type => 'todo'
},
type => 'skip',
reason => 'contract negociations'
},
type => 'todo'
},
]
},
descriptive => {
passing => 1,
'wait' => 0,
'exit' => 0,
max => 5,
seen => 5,
'ok' => 5,
'todo' => 0,
'skip' => 0,
bonus => 0,
name => 'Interlock activated'
},
},
},
name => 'Blazing sword formed'
},
name => 'Robeast destroyed'
},
],
},
duplicates => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 10,
seen => 11,
'ok' => 11,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
head_end => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 4,
seen => 4,
'ok' => 4,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
lone_not_bug => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 4,
seen => 4,
'ok' => 4,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
head_fail => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 4,
seen => 4,
'ok' => 3,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
no_output => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 0,
seen => 0,
'ok' => 0,
'todo' => 0,
'skip' => 0,
bonus => 0,
details => [],
},
simple => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 5,
seen => 5,
'ok' => 5,
'todo' => 0,
'skip' => 0,
bonus => 0,
]
},
simple_fail => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 5,
seen => 5,
'ok' => 3,
'todo' => 0,
'skip' => 0,
bonus => 0,
]
},
'skip' => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 5,
seen => 5,
'ok' => 5,
'todo' => 0,
'skip' => 1,
bonus => 0,
type => 'skip',
},
]
},
'skip_nomsg' => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 1,
seen => 1,
'ok' => 1,
'todo' => 0,
'skip' => 1,
bonus => 0,
type => 'skip',
},
]
},
skipall => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 0,
seen => 0,
'ok' => 0,
'todo' => 0,
'skip' => 0,
bonus => 0,
details => [],
},
skipall_nomsg => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 0,
seen => 0,
'ok' => 0,
'todo' => 0,
'skip' => 0,
bonus => 0,
details => [],
},
'todo' => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 5,
seen => 5,
'ok' => 5,
'todo' => 2,
'skip' => 0,
bonus => 1,
type => 'todo' },
type => 'todo' },
],
},
taint => {
passing => 1,
'exit' => 0,
'wait' => 0,
max => 1,
seen => 1,
'ok' => 1,
'todo' => 0,
'skip' => 0,
bonus => 0,
name => '- -T honored'
},
],
},
vms_nit => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 2,
seen => 2,
'ok' => 1,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
'die' => {
passing => 0,
max => 0,
seen => 0,
'ok' => 0,
'todo' => 0,
'skip' => 0,
bonus => 0,
details => []
},
die_head_end => {
passing => 0,
max => 0,
seen => 4,
'ok' => 4,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
die_last_minute => {
passing => 0,
max => 4,
seen => 4,
'ok' => 4,
'todo' => 0,
'skip' => 0,
bonus => 0,
],
},
bignum => {
passing => 0,
'exit' => 0,
'wait' => 0,
max => 2,
seen => 4,
'ok' => 4,
'todo' => 0,
'skip' => 0,
bonus => 0,
]
},
'shbang_misparse' =>{
passing => 1,
'exit' => 0,
'wait' => 0,
max => 2,
seen => 2,
'ok' => 2,
'todo' => 0,
'skip' => 0,
bonus => 0,
},
);
$_[0] =~ /^Can't detailize/
};
for my $test ( sort keys %samples ) {
my $expect = $samples{$test};
for (0..$#{$expect->{details}}) {
$expect->{details}[$_]{type} = ''
unless exists $expect->{details}[$_]{type};
$expect->{details}[$_]{name} = ''
unless exists $expect->{details}[$_]{name};
$expect->{details}[$_]{reason} = ''
unless exists $expect->{details}[$_]{reason};
}
my $test_path = File::Spec->catfile($SAMPLE_TESTS, $test);
my $strap = Test::Harness::Straps->new;
my %results = $strap->analyze_file($test_path);
is_deeply($results{details}, $expect->{details}, "$test details" );
delete $expect->{details};
delete $results{details};
SKIP: {
# Have to check the exit status seperately so we can skip it
# in MacPerl.
}
} # for %samples
}