sub mytool { my $ctx = context(); $ctx->ok(...); $ctx->diag(...); $ctx->release; # This is where the bail-on-fail is triggered }