ext/XS-APItest/t/exception.t XS::APItest extension
ext/XS-APItest/t/hash.t XS::APItest: tests for hash related APIs
ext/XS-APItest/t/my_cxt.t XS::APItest: test MY_CXT interface
+ext/XS-APItest/t/my_exit.t XS::APItest: test my_exit
ext/XS-APItest/t/op.t XS::APItest: tests for OP related APIs
ext/XS-APItest/t/pmflag.t Test deprecation warning for Perl_pmflag()
ext/XS-APItest/t/printf.t XS::APItest extension
my_cxt_getint my_cxt_getsv my_cxt_setint my_cxt_setsv
sv_setsv_cow_hashkey_core sv_setsv_cow_hashkey_notcore
rmagical_cast rmagical_flags
- DPeek utf16_to_utf8 utf16_to_utf8_reversed pmflag
+ DPeek utf16_to_utf8 utf16_to_utf8_reversed pmflag my_exit
);
our $VERSION = '0.17';
RETVAL = before;
OUTPUT:
RETVAL
+
+void
+my_exit(int exitcode)
+ PPCODE:
+ my_exit(exitcode);
--- /dev/null
+#!perl
+
+use strict;
+use warnings;
+
+require "test.pl";
+
+plan(4);
+
+use XS::APItest;
+
+my ($prog, $expect) = (<<'PROG', <<'EXPECT');
+use XS::APItest;
+print "ok\n";
+my_exit(1);
+print "not\n";
+PROG
+ok
+EXPECT
+fresh_perl_is($prog, $expect);
+is($? >> 8, 1, "exit code plain my_exit");
+
+($prog, $expect) = (<<'PROG', <<'EXPECT');
+use XS::APItest;
+print "ok\n";
+call_sv( sub { my_exit(1); }, G_EVAL );
+print "not\n";
+PROG
+ok
+EXPECT
+fresh_perl_is($prog, $expect);
+is($? >> 8, 1, "exit code my_exit inside a call_sv with G_EVAL");
+
PL_curstash = PL_defstash;
FREETMPS;
JMPENV_POP;
- if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
- Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
case 3:
PL_curstash = PL_defstash;
FREETMPS;
JMPENV_POP;
- if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
- Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
case 3:
PL_curcop = &PL_compiling;
CopLINE_set(PL_curcop, oldline);
JMPENV_POP;
- if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED)) {
- if (paramList == PL_beginav)
- Perl_croak(aTHX_ "BEGIN failed--compilation aborted");
- else
- Perl_croak(aTHX_ "%s failed--call queue aborted",
- paramList == PL_checkav ? "CHECK"
- : paramList == PL_initav ? "INIT"
- : paramList == PL_unitcheckav ? "UNITCHECK"
- : "END");
- }
my_exit_jump();
/* NOTREACHED */
case 3: