10 # Fail for every PERL_ARGS_ASSERT* macro that was declared but not used.
17 unless (-d 't' && -f 'MANIFEST') {
18 # we'll assume that we are in t then.
19 # All files are internal to perl, so Unix-style is sufficiently portable.
24 my $proto = $prefix . 'proto.h';
26 open my $fh, '<', $proto or die "Can't open $proto: $!";
29 $declared{$1}++ if /^#define\s+(PERL_ARGS_ASSERT[A-Za-z0-9_]+)\s+/;
33 cmp_ok(scalar keys %declared, '>', 0, 'Some macros were declared');
36 my $manifest = $prefix . 'MANIFEST';
37 open my $fh, '<', $manifest or die "Can't open $manifest: $!";
40 push @ARGV, $prefix . $1 if m!^((?:[^/]+/)?[^/]+\.c)\t!;
45 $used{$1}++ if /^\s+(PERL_ARGS_ASSERT_[A-Za-z0-9_]+);$/;
50 foreach (keys %declared) {
51 $unused{$_}++ unless $used{$_};
55 fail("$_ is declared but not used") foreach sort keys %unused;
57 pass('Every PERL_ARGS_ASSERT* macro declared is used');