At 10:08 PM +0300 4/26/02, Jarkko Hietaniemi wrote:
>On Fri, Apr 26, 2002 at 02:02:26PM -0400, Michael G Schwern wrote:
>> On Fri, Apr 26, 2002 at 12:46:22PM -0500, Craig A. Berry wrote:
>> > lib/Test/Harness/t/strap-analyze....FAILED at test 9
>> > lib/Test/Harness/t/test-harness.....FAILED at test 17
>> > Failed 3 test scripts out of 616, 99.51% okay.
>> >
>> > The new Test::Harness looks like it has some problems related to exit
>> > statuses.
>>
>> Yep.  It's just VMS's funny exit codes which I forgot to take into account.
>>
>> This'll fix it.  (It looks big, but 98% of it is just reindentation).
>
>Waiting for an ack from Craig or some other vmsperler.  Patches have
>a funny way for working fine for their creator, but not necessarily
>for anybody else :-)

strap-analyze.t now tests ok, but test-harness.t now looks like

not ok 17 - die_head_end - failed
#     Failed test ([-.lib.test.harness.t]test-harness.t at line 394)
#     Structures begin differing at:
#          $got->{estat} = '44'
#     $expected->{estat} = '4'

not ok 21 - die - failed
#     Failed test ([-.lib.test.harness.t]test-harness.t at line 394)
#     Structures begin differing at:
#          $got->{estat} = '44'
#     $expected->{estat} = '4'

not ok 69 - die_last_minute - failed
#     Failed test ([-.lib.test.harness.t]test-harness.t at line 394)
#     Structures begin differing at:
#          $got->{estat} = '44'
#     $expected->{estat} = '4'

44 is SS$_ABORT.  From perlvms.pod, for those who have outswapped
these precious tidbits from main memory:

=item $?

The "status value" returned in C<$?> is synthesized from the
actual exit status of the subprocess in a way that approximates
POSIX wait(5) semantics, in order to allow Perl programs to
portably test for successful completion of subprocesses.  The
low order 8 bits of C<$?> are always 0 under VMS, since the
termination status of a process may or may not have been
generated by an exception.  The next 8 bits are derived from
the severity portion of the subprocess' exit status: if the
severity was success or informational, these bits are all 0;
if the severity was warning, they contain a value of 1; if the
severity was error or fatal error, they contain the actual
severity bits, which turns out to be a value of 2 for error
and 4 for fatal error.

As a result, C<$?> will always be zero if the subprocess' exit
status indicated successful completion, and non-zero if a
warning or error occurred.  Conversely, when setting C<$?> in
an END block, an attempt is made to convert the POSIX value
into a native status intelligible to the operating system upon
exiting Perl.  What this boils down to is that setting C<$?>
to zero results in the generic success value SS$_NORMAL, and
setting C<$?> to a non-zero value results in the generic
failure status SS$_ABORT.  See also L<perlport/exit>.

The pragma C<use vmsish 'status'> makes C<$?> reflect the actual
VMS exit status instead of the default emulation of POSIX status
described above.  This pragma also disables the conversion of
non-zero values to SS$_ABORT when setting C<$?> in an END
block (but zero will still be converted to SS$_NORMAL).

-- 
____________________________________________
Craig A. Berry                  
mailto:[EMAIL PROTECTED]

"Literary critics usually know what they're
talking about. Even if they're wrong."
        -- Perl creator Larry Wall

Reply via email to