Permalink
Browse files

Add tests

  • Loading branch information...
1 parent 5eaf857 commit ed82097a1ec5329d9ab70d29e91d4f6e55353cf7 @rafl committed Sep 4, 2010
Showing with 29 additions and 0 deletions.
  1. +29 −0 t/basic.t
View
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+use Test::More;
+
+use POSIX ':signal_h';
+
+use Devel::bt ();
+
+plan skip_all => 'Unable to locate gdb'
+ unless Devel::bt::find_gdb();
+
+my @signals = qw(SIGABRT SIGFPE SIGILL SIGQUIT SIGSEGV SIGBUS SIGTRAP);
+
+use Config ();
+
+local $ENV{PERL5LIB} = join $Config::Config{path_sep} => @INC;
+
+for my $signal (@signals) {
+ next unless __PACKAGE__->can($signal);
+ my $signum = __PACKAGE__->can($signal)->();
+ my @cmd = ($^X, qw(-d:bt -e), "kill $signum, \$\$");
+
+ use Capture::Tiny 'capture';
+ my ($stdout) = capture { system @cmd };
+
+ like $stdout, qr/\bperl_run\b/, "perl backtrace for $signal";
+}
+
+done_testing;

0 comments on commit ed82097

Please sign in to comment.