9 if ( $Config{usecrosscompile} ) {
10 skip_all( "Not all files are available during cross-compilation" );
15 # Fail for every PERL_ARGS_ASSERT* macro that was declared but not used.
22 unless (-d 't' && -f 'MANIFEST') {
23 # we'll assume that we are in t then.
24 # All files are internal to perl, so Unix-style is sufficiently portable.
29 my $proto = $prefix . 'proto.h';
31 open my $fh, '<', $proto or die "Can't open $proto: $!";
34 $declared{$1}++ if /^#define\s+(PERL_ARGS_ASSERT[A-Za-z0-9_]+)\s+/;
38 cmp_ok(scalar keys %declared, '>', 0, 'Some macros were declared');
41 my $manifest = $prefix . 'MANIFEST';
42 open my $fh, '<', $manifest or die "Can't open $manifest: $!";
45 push @ARGV, $prefix . $1 if m!^((?:[^/]+/)?[^/]+\.c)\t!;
47 # Special case the *inline.h since they behave like *.c
48 push @ARGV, glob "$prefix/*inline.h";
52 $used{$1}++ if /^\s+(PERL_ARGS_ASSERT_[A-Za-z0-9_]+);$/;
57 foreach (keys %declared) {
58 $unused{$_}++ unless $used{$_};
62 fail("$_ is declared but not used") foreach sort keys %unused;
64 pass('Every PERL_ARGS_ASSERT* macro declared is used');