From: Nicholas Clark Date: Wed, 20 May 2009 11:00:37 +0000 (+0200) Subject: Tests for calls to Perl_croak() in the C source. Starting with "No such hook". X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b63d99d508dbe4b46146e3520549a6ad23a121b;p=p5sagit%2Fp5-mst-13.2.git Tests for calls to Perl_croak() in the C source. Starting with "No such hook". --- diff --git a/MANIFEST b/MANIFEST index 6ba8b98..b258255 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3930,6 +3930,7 @@ t/lib/compress/truncate.pl Compress::Zlib t/lib/compress/zlib-generic.pl Compress::Zlib t/lib/contains_bad_pod.xr Pod-Parser test file t/lib/contains_pod.xr Pod-Parser test file +t/lib/croak.t Test calls to Perl_croak() in the C source. t/lib/cygwin.t Builtin cygwin function tests t/lib/deprecate/Deprecated.pm Deprecated module to test deprecate.pm t/lib/deprecate/Optionally.pm Optionally deprecated module to test deprecate.pm diff --git a/t/lib/croak.t b/t/lib/croak.t new file mode 100755 index 0000000..6a9b405 --- /dev/null +++ b/t/lib/croak.t @@ -0,0 +1,20 @@ +#!./perl +# So far, it seems, there is no place to test all the Perl_croak() calls in the +# C code. So this is a start. It's likely that it needs refactoring to be data +# driven. Data driven code exists in various other tests - best plan would be to +# investigate whether any common code library already exists, and if not, +# refactor the "donor" test code into a common code library. + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require './test.pl'; + plan( tests => 1 ); +} + +use strict; + +fresh_perl_is(<<'EOF', 'No such hook: _HUNGRY at - line 1.', {}, 'Perl_magic_setsig'); +$SIG{_HUNGRY} = \&mmm_pie; +warn "Mmm, pie"; +EOF