Commit | Line | Data |
---|---|---|
d8ca50cb FC |
1 | #!perl |
2 | ||
a81bac00 | 3 | @TODO = qw [ SAVEt_SAVESWITCHSTACK ]; |
d8ca50cb FC |
4 | @TODO{@TODO} = (); |
5 | ||
3a73a075 BF |
6 | BEGIN { chdir 't'; unshift @INC, "../lib"; require './test.pl' } |
7 | use Config; | |
8 | ||
9 | if ( $Config{usecrosscompile} ) { | |
10 | skip_all( "Not all files are available during cross-compilation" ); | |
11 | } | |
d8ca50cb FC |
12 | |
13 | sub read_cases { | |
14 | my ($file, $func) = @_; | |
15 | ||
16 | open my $fh, $file or die "$0 cannot open $file: $!"; | |
17 | ||
18 | while (readline $fh) { | |
19 | last if /^Perl_$func/; | |
20 | } | |
21 | my %found; | |
22 | while (readline $fh) { | |
23 | last if /^}/; | |
24 | $found{$1}++ if /case (SAVEt_\w*):/; | |
25 | } | |
26 | close $fh or die "$0 cannot close $file: $!"; | |
27 | \%found; | |
28 | } | |
29 | ||
30 | my $leave_scope = read_cases "../scope.c", "leave_scope"; | |
31 | my $ss_dup = read_cases "../sv.c", "ss_dup"; | |
32 | ||
33 | ok scalar %$leave_scope, 'we got some'; | |
34 | ||
35 | for (sort keys %$leave_scope) { | |
36 | local $::TODO = ' ' if exists $TODO{$_}; | |
37 | ok exists $$ss_dup{$_}, "ss_dup handles $_"; | |
38 | } | |
39 | ||
40 | done_testing; |