Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public interface for aborting due to event #707

Closed
exodist opened this issue Aug 15, 2016 · 3 comments
Closed

Public interface for aborting due to event #707

exodist opened this issue Aug 15, 2016 · 3 comments

Comments

@exodist
Copy link
Member

exodist commented Aug 15, 2016

$ctx->plan(0, 'skip_all') and $ctx->bail() both send events that basically abort testing. This would normally be a problem because the context would notice it is not released and complain. To get around this both methods do ${$ctx->{_aborted}}++ to tell the context to chill out.

We need a public interface for this for people who write their own abort-now style events.

@haarg needs this.

@exodist
Copy link
Member Author

exodist commented Aug 15, 2016

I am thinking the interface should be $ctx->send_abort_event(...) that is identical to send_event(), but bumps the _aborted ref. I do not think _aborted itself should be publicly exposed.

@haarg
Copy link
Member

haarg commented Aug 15, 2016

Would it be possible to use the result of the terminate method on the event? It seems like it should already provide the distinction between abort events and others.

@exodist
Copy link
Member Author

exodist commented Aug 15, 2016

that would be a good idea. +1

exodist added a commit that referenced this issue Aug 18, 2016
exodist added a commit that referenced this issue Aug 18, 2016
    - Fix skip_all in require in intercept (#696)
    - Documentation of what is better in Test2 (#663)
    - Document Test::Builder::Tester plan limitations
    - Document limitations in is_deeply (#595)
    - Better documentation of done_testing purpose (#151)
    - Make ctx->send_event detect termination events (#707)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants