Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document bail-out()
Feature added to Rakudo in rakudo/rakudo@58dc8c6185
  • Loading branch information
zoffixznet committed Jul 19, 2016
1 parent 5dc3a7d commit bde27dc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/Language/testing.pod6
Expand Up @@ -548,6 +548,19 @@ required in the example to prevent the skipped tests from running.
Alternatively, you could enclose the remaining tests in an C<else>
branch.
=item X<bail-out($reason?)|bail-out>
If you already know the tests will fail, you can bail out of the test run
using C<bail-out()>:
=begin code
$has-db-connection or bail-out 'Must have database connection for testing';
=end code
The function aborts the current test run, signaling failure to the harness.
Takes an optional reason for bailing out. The subroutine will call
C<exit()>, so if you need to do a clean-up, do it before calling C<bail-out()>.
=head1 Manual control
If the convenience functionality documented above does not suit your needs,
Expand Down

0 comments on commit bde27dc

Please sign in to comment.