At 7:00 PM -0600 2/2/08, Craig A. Berry wrote:
>At 12:45 AM +0000 2/3/08, Nicholas Clark wrote:
>
>>What does the VMS equivalent of this 1 liner give?
>>
>>$ ./perl -Ilib -e 'use Test::More; plan skip_all => "Testing"'
>>1..0 # Skip Testing
>>$ echo $?
>>0
>
>$ perl  -"I[.lib]" -e "use Test::More; plan skip_all => 'Testing';"
>1..0 # Skip Testing
>$ show symbol $status
>  $STATUS == "%X00000001"
>
>which is a success status.  So we can't blame it on Test::More.

When xs.t doesn't find CBuilder (as it doesn't in maint-5.8), it does
a skip_all, which calls C<exit 0> and proceeds to execute the END
block that looks like:

END {
    ok( chdir File::Spec->updir );
    ok( teardown_xs(), 'teardown' );
}

Turns out skip_all doesn't skip tests run from an END block.  It may
ignore their output, but they tend to be grumpy when interrupted and
cause the test overall to exit with failure, like so:

$ perl  -"I[.lib]" -e "use Test::More; plan skip_all => 'Testing'; END {ok( 
chdir '[-]' );}"
1..0 # Skip Testing
You tried to run a test without a plan at -e line 1.
END failed--call queue aborted at -e line 360.
%SYSTEM-F-ABORT, abort


It's also potentially dangerous to navigate up a directory when we
don't know whether we ever descended a level (and normally wouldn't
when running in the core, even when we don't skip anything) and then
attempt to delete things that may or may not have been created.

The attached patch takes a very simplistic approach to skipping the
code in the END block when skip_all is in effect -- no doubt the
MakeMaker gurus will have a better approach.  It does not address the
fact that it looks like teardown occurs one directory up from where
it should when run as part of the core test suite.

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

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Attachment: xs_skip_problem.patch.txt
Description: Binary data

Reply via email to