In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0ec7d39d922fe99b200d649d3831d277fb8140c6?hp=9fb1bf9d6077e18c69220b2091fc278b2e87b3fe>

- Log -----------------------------------------------------------------
commit 0ec7d39d922fe99b200d649d3831d277fb8140c6
Author: Father Chrysostomos <[email protected]>
Date:   Sat Sep 25 11:15:35 2010 -0700

    Try once more to fix sigtrap.t
    
    It produces output like this:
    lib/sigtrap....................................................sh: line 1: 
66151 Abort trap              ./perl "-I../lib" -Msigtrap=INT -e 'sub { kill 
q-INT-, $$ } -> (3)' 2>&1
    ok
    
    And is effectively skipped on Windows.
    
    So this new revision of the test
    • calls the signal handler directly, instead of trying to trigger it
      with a signal and
    • overrides kill globally to stop sigtrap.pm from aborting.
-----------------------------------------------------------------------

Summary of changes:
 lib/sigtrap.t |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/sigtrap.t b/lib/sigtrap.t
index 30f5339..8ee0696 100644
--- a/lib/sigtrap.t
+++ b/lib/sigtrap.t
@@ -57,13 +57,15 @@ $SIG{FAKE} = 'IGNORE';
 sigtrap->import('untrapped', 'FAKE');
 is( $SIG{FAKE}, 'IGNORE', 'respect existing handler set to IGNORE' );
 
-unlike
-   runperl(
-    switches => [ '-Msigtrap=INT' ],
-    prog => 'sub { kill q-INT-, $$ } -> (3)',
-    stderr => 1
-   ),
-   qr/Modification of a read-only value/,
+fresh_perl_like
+  '
+    BEGIN { *CORE::GLOBAL::kill = sub {} }
+    require sigtrap;
+    import sigtrap "INT";
+    sub { $SIG{INT}->("INT") } -> (3)
+  ',
+   qr/\$ = main::__ANON__\(3\) called/,
+  { stderr => 1 },
   "stack-trace does not try to modify read-only arguments"
 ;
 

--
Perl5 Master Repository

Reply via email to