Make DD_DEBUG handling more robust.
[p5sagit/Devel-Declare.git] / t / debug.t
CommitLineData
7dd7d008 1use strict;
2use warnings;
3
4use Test::More tests => 1;
5
6use Cwd qw/cwd/;
7use FindBin qw/$Bin/;
8
9$ENV{PERLDB_OPTS} = "NonStop";
10$ENV{DD_DEBUG} = 1;
11cwd("$Bin/..");
12
13# Write a .perldb file so we make sure we dont use the users one
14open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
15close PERLDB;
16
17$SIG{CHLD} = 'IGNORE';
87195072 18$SIG{ALRM} = sub {
7dd7d008 19 fail("SIGALRM timeout triggered");
20 kill(9, $$);
21};
22
23alarm 10;
24my $output = `$^X -d t/debug.pl`;
25
26like($output, qr/method new {}, sub {my \$self = shift;/,
27 "replaced line string visible in debug lines");
281;