-
Notifications
You must be signed in to change notification settings - Fork 8
/
20test-break.t
executable file
·58 lines (55 loc) · 1.64 KB
/
20test-break.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env perl
use warnings; use strict;
use rlib '.'; use Helper;
my $test_prog = prog_file('gcd.pl');
my $opts = {
filter => sub{
my ($got_lines, $correct_lines) = @_;
my @result = ();
my $skip_next = 0;
for my $line (split("\n", $got_lines)) {
if ($line =~ /matched debugger cache file:/) {
$line = 'XXXX matched debugger cache file:';
push @result, ($line, "\tgcd.pl");
$skip_next = 1;
next;
} elsif ($line =~ /^Use 'info file/) {
$line = "Use 'info file XXX brkpts' to see breakpoints I know about";
push @result, $line;
} elsif ($line =~ /Line 10 of/) {
push(@result,
'*** Line 10 of XXX not known to be a trace line.');
} else {
push @result, $line unless $skip_next;;
$skip_next = 0;
}
}
$got_lines = join("\n", @result);
return ($got_lines, $correct_lines);
},
run_opts => " --no-highlight --basename -nx --testing"
};
run_debugger("$test_prog 3 5", 'break.cmd', undef, $opts);
$test_prog = prog_file('TCPPack.pm');
$opts = {
filter => sub{
my ($got_lines, $correct_lines) = @_;
my @result = ();
for my $line (split("\n", $got_lines)) {
if ($line =~ /Breakpoint 1 set in Exporter\.pm at line/) {
push (@result,
'Breakpoint 1 set in Exporter.pm at line 29');
} elsif ($line =~ /^1 breakpoint keep y at Exporter\.pm/) {
push(@result,
'1 breakpoint keep y at Exporter.pm:29');
} else {
push @result, $line;
}
}
$got_lines = join("\n", @result);
return ($got_lines, $correct_lines);
},
run_opts => " --no-highlight --basename -nx --testing"
};
run_debugger("$test_prog", 'break2.cmd', undef, $opts);
done_testing();