6 $standard = "XOPEN2K8";
9 GetOptions ('headers=s' => \@headers, 'standard=s' => \$standard,
10 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir);
11 @headers = split(/,/,join(',',@headers));
13 # List of the headers we are testing.
15 @headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h",
16 "utime.h", "unistd.h", "ulimit.h", "ucontext.h", "uchar.h",
17 "time.h", "tgmath.h", "termios.h", "tar.h", "sys/wait.h",
18 "sys/utsname.h", "sys/un.h", "sys/uio.h", "sys/types.h",
19 "sys/times.h", "sys/timeb.h", "sys/time.h", "sys/statvfs.h",
20 "sys/stat.h", "sys/socket.h", "sys/shm.h", "sys/sem.h",
21 "sys/select.h", "sys/resource.h", "sys/msg.h", "sys/mman.h",
22 "sys/ipc.h", "syslog.h", "stropts.h", "strings.h", "string.h",
23 "stdlib.h", "stdio.h", "stdint.h", "stddef.h", "stdarg.h",
24 "spawn.h", "signal.h", "setjmp.h", "semaphore.h", "search.h",
25 "sched.h", "regex.h", "pwd.h", "pthread.h", "poll.h",
26 "nl_types.h", "netinet/tcp.h", "netinet/in.h", "net/if.h",
27 "netdb.h", "ndbm.h", "mqueue.h", "monetary.h", "math.h",
28 "locale.h", "libgen.h", "limits.h", "langinfo.h", "iso646.h",
29 "inttypes.h", "iconv.h", "grp.h", "glob.h", "ftw.h", "fnmatch.h",
30 "fmtmsg.h", "float.h", "fcntl.h", "errno.h", "dlfcn.h",
31 "dirent.h", "ctype.h", "cpio.h", "complex.h", "assert.h",
32 "arpa/inet.h", "aio.h");
35 $CFLAGS{"ISO"} = "-ansi";
36 $CFLAGS{"ISO99"} = "-std=c99";
37 $CFLAGS{"ISO11"} = "-std=c1x -D_ISOC11_SOURCE";
38 $CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199912 -ansi";
39 $CFLAGS{"XPG3"} = "-ansi -D_XOPEN_SOURCE";
40 $CFLAGS{"XPG4"} = "-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED";
41 $CFLAGS{"UNIX98"} = "-ansi -D_XOPEN_SOURCE=500";
42 $CFLAGS{"XOPEN2K"} = "-std=c99 -D_XOPEN_SOURCE=600";
43 $CFLAGS{"XOPEN2K8"} = "-std=c99 -D_XOPEN_SOURCE=700";
44 $CFLAGS{"POSIX2008"} = "-std=c99 -D_POSIX_C_SOURCE=200809L";
46 $CFLAGS = "$flags -fno-builtin '-D__attribute__(x)=' $CFLAGS{$standard} -D_ISOMAC";
48 # Check standard name for validity.
49 die "unknown standard \"$standard\"" if ($CFLAGS{$standard} eq "");
51 # if ($standard ne "XOPEN2K8" && $standard ne "POSIX2008") {
52 # # Some headers need a bit more attention. At least with XPG7
53 # # all headers should be self-contained.
54 # $mustprepend{'inttypes.h'} = "#include <stddef.h>\n";
55 # $mustprepend{'glob.h'} = "#include <sys/types.h>\n";
56 # $mustprepend{'grp.h'} = "#include <sys/types.h>\n";
57 # $mustprepend{'regex.h'} = "#include <sys/types.h>\n";
58 # $mustprepend{'pwd.h'} = "#include <sys/types.h>\n";
59 # $mustprepend{'sched.h'} = "#include <sys/types.h>\n";
60 # $mustprepend{'signal.h'} = "#include <pthread.h>\n#include <sys/types.h>\n";
61 # $mustprepend{'stdio.h'} = "#include <sys/types.h>\n";
62 # $mustprepend{'sys/stat.h'} = "#include <sys/types.h>\n";
63 # $mustprepend{'wchar.h'} = "#include <stdarg.h>\n";
64 # $mustprepend{'wordexp.h'} = "#include <stddef.h>\n";
67 # These are the ISO C99 keywords.
68 @keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default',
69 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto',
70 'if', 'inline', 'int', 'long', 'register', 'restrict', 'return',
71 'short', 'signed', 'sizeof', 'static', 'struct', 'switch',
72 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while');
74 # Make a hash table from this information.
75 while ($#keywords >= 0) {
76 $iskeyword{pop (@keywords)} = 1;
87 my($pattern, $string) = @_;
88 my($strlen) = length ($string);
91 if (substr ($pattern, 0, 1) eq '*') {
92 my($patlen) = length ($pattern) - 1;
93 $res = ($strlen >= $patlen
94 && substr ($pattern, -$patlen, $patlen) eq substr ($string, -$patlen, $patlen));
95 } elsif (substr ($pattern, -1, 1) eq '*') {
96 if (substr ($pattern, -2, 1) eq ']') {
97 my($patlen) = index ($pattern, '[');
98 my($range) = substr ($pattern, $patlen + 1, -2);
99 $res = ($strlen > $patlen
100 && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen)
101 && index ($range, substr ($string, $patlen, 1)) != -1);
103 my($patlen) = length ($pattern) - 1;
104 $res = ($strlen >= $patlen
105 && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen));
108 $res = $pattern eq $string;
116 my($fnamebase, $msg, $errmsg, $skip, $optional) = @_;
127 $ret = system "$CC $CFLAGS -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1";
129 if ($optional != 0) {
130 printf (" $errmsg\n");
135 printf (" $errmsg Compiler message:\n");
143 if ($verbose > 1 && -s "$fnamebase.out") {
144 # We print all warnings issued.
148 if ($printlog != 0) {
149 printf (" " . "-" x 71 . "\n");
150 open (MESSAGE, "< $fnamebase.out");
155 printf (" " . "-" x 71 . "\n");
158 unlink "$fnamebase.c";
159 unlink "$fnamebase.o";
160 unlink "$fnamebase.out";
168 my($fnamebase, $msg, $errmsg, $skip) = @_;
179 $ret = system "$CC $CFLAGS -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1";
183 printf (" $errmsg Compiler message:\n");
189 # Now run the program. If the exit code is not zero something is wrong.
190 $result = system "$fnamebase > $fnamebase.out2 2>&1";
193 if ($verbose > 1 && -s "$fnamebase.out") {
194 # We print all warnings issued.
196 system "cat $fnamebase.out2 >> $fnamebase.out";
202 unlink "$fnamebase.out";
203 rename "$fnamebase.out2", "$fnamebase.out";
206 if ($printlog != 0) {
207 printf (" " . "-" x 71 . "\n");
208 open (MESSAGE, "< $fnamebase.out");
213 printf (" " . "-" x 71 . "\n");
217 unlink "$fnamebase.c";
218 unlink "$fnamebase.o";
219 unlink "$fnamebase.out";
220 unlink "$fnamebase.out2";
227 my($token, @allow) = @_;
230 return if ($token =~ /^[0-9_]/ || $iskeyword{$token});
232 for ($idx = 0; $idx <= $#allow; ++$idx) {
233 return if (poorfnmatch ($allow[$idx], $token));
242 return if ($token =~ /^[0-9_]/ || $iskeyword{$token});
244 if (exists $errors{$token}) {
245 undef $errors{$token};
251 my($h, $fnamebase, @allow) = @_;
255 # Generate a program to get the contents of this header.
256 open (TESTFILE, ">$fnamebase.c");
257 print TESTFILE "#include <$h>\n";
262 open (CONTENT, "$CC $CFLAGS -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
263 loop: while (<CONTENT>) {
265 if (/^#define (.*)/) {
266 newtoken ($1, @allow);
267 } elsif (/^#undef (.*)/) {
270 # We have to tokenize the line.
273 my($len) = length ($str);
275 foreach $token (split(/[^a-zA-Z0-9_]/, $str)) {
277 newtoken ($token, @allow);
283 unlink "$fnamebase.c";
286 # Sort the output list so it's easier to compare results with diff.
287 foreach $f (sort keys(%errors)) {
288 if ($errors{$f} == 1) {
289 if ($realerror == 0) {
290 printf ("FAIL\n " . "-" x 72 . "\n");
294 printf (" Namespace violation: \"%s\"\n", $f);
297 printf (" " . "-" x 72 . "\n") if ($realerror != 0);
300 if ($realerror == 0) {
306 while ($#headers >= 0) {
307 my($h) = pop (@headers);
310 my($fnamebase) = "$tmpdir/$hf-test";
313 my(@allowheader) = ();
314 my(%seenheader) = ();
315 my($prepend) = $mustprepend{$h};
318 printf ("Testing <$h>\n");
319 printf ("----------" . "-" x length ($h) . "\n");
321 open (CONTROL, "$CC -E -D$standard -x c data/$h-data |");
322 control: while (<CONTROL>) {
324 next control if (/^#/);
325 next control if (/^[ ]*$/);
329 # Generate a program to test for the availability of this header.
330 open (TESTFILE, ">$fnamebase.c");
331 print TESTFILE "$prepend";
332 print TESTFILE "#include <$h>\n";
335 $missing = compiletest ($fnamebase, "Checking whether <$h> is available",
336 "Header <$h> not available", 0, 0);
338 last control if ($missing);
346 if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
347 my($struct) = "$2$3";
353 # Remember that this name is allowed.
354 push @allow, $member;
356 # Generate a program to test for the availability of this member.
357 open (TESTFILE, ">$fnamebase.c");
358 print TESTFILE "$prepend";
359 print TESTFILE "#include <$h>\n";
360 print TESTFILE "$struct a;\n";
361 print TESTFILE "$struct b;\n";
362 print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n";
363 print TESTFILE "void foobarbaz (void) {\n";
364 print TESTFILE " xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n";
365 print TESTFILE "}\n";
368 $res = compiletest ($fnamebase, "Testing for member $member",
371 : "Member \"$member\" not available."), $res,
374 if ($res == 0 || $missing != 0 || !$optional) {
375 # Test the types of the members.
376 open (TESTFILE, ">$fnamebase.c");
377 print TESTFILE "$prepend";
378 print TESTFILE "#include <$h>\n";
379 print TESTFILE "$struct a;\n";
380 print TESTFILE "extern $type b$rest;\n";
381 print TESTFILE "extern __typeof__ (a.$member) b;\n";
384 compiletest ($fnamebase, "Testing for type of member $member",
385 "Member \"$member\" does not have the correct type.",
388 } elsif (/^constant *([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) {
395 # Remember that this name is allowed.
398 # Generate a program to test for the availability of this constant.
399 open (TESTFILE, ">$fnamebase.c");
400 print TESTFILE "$prepend";
401 print TESTFILE "#include <$h>\n";
402 print TESTFILE "__typeof__ ($const) a = $const;\n";
405 $res = compiletest ($fnamebase, "Testing for constant $const",
408 : "Constant \"$const\" not available."), $res,
411 if (defined ($type) && ($res == 0 || !$optional)) {
412 # Test the types of the members.
413 open (TESTFILE, ">$fnamebase.c");
414 print TESTFILE "$prepend";
415 print TESTFILE "#include <$h>\n";
416 print TESTFILE "__typeof__ (($type) 0) a;\n";
417 print TESTFILE "extern __typeof__ ($const) a;\n";
420 compiletest ($fnamebase, "Testing for type of constant $const",
421 "Constant \"$const\" does not have the correct type.",
425 if (defined ($op) && ($res == 0 || !$optional)) {
426 # Generate a program to test for the value of this constant.
427 open (TESTFILE, ">$fnamebase.c");
428 print TESTFILE "$prepend";
429 print TESTFILE "#include <$h>\n";
430 # Negate the value since 0 means ok
431 print TESTFILE "int main (void) { return !($const $op $value); }\n";
434 $res = runtest ($fnamebase, "Testing for value of constant $const",
435 "Constant \"$const\" has not the right value.", $res);
437 } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
442 # Remember that this name is allowed.
443 push @allow, $symbol;
445 # Generate a program to test for the availability of this constant.
446 open (TESTFILE, ">$fnamebase.c");
447 print TESTFILE "$prepend";
448 print TESTFILE "#include <$h>\n";
449 print TESTFILE "void foobarbaz (void) {\n";
450 print TESTFILE "__typeof__ ($symbol) a = $symbol;\n";
451 print TESTFILE "}\n";
454 $res = compiletest ($fnamebase, "Testing for symbol $symbol",
455 "Symbol \"$symbol\" not available.", $res, 0);
458 # Generate a program to test for the value of this constant.
459 open (TESTFILE, ">$fnamebase.c");
460 print TESTFILE "$prepend";
461 print TESTFILE "#include <$h>\n";
462 print TESTFILE "int main (void) { return $symbol != $value; }\n";
465 $res = runtest ($fnamebase, "Testing for value of symbol $symbol",
466 "Symbol \"$symbol\" has not the right value.", $res);
468 } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
470 my($maybe_opaque) = 0;
472 # Remember that this name is allowed.
473 if ($type =~ /^struct *(.*)/) {
475 } elsif ($type =~ /^union *(.*)/) {
482 # Generate a program to test for the availability of this type.
483 open (TESTFILE, ">$fnamebase.c");
484 print TESTFILE "$prepend";
485 print TESTFILE "#include <$h>\n";
486 if ($maybe_opaque == 1) {
487 print TESTFILE "$type *a;\n";
489 print TESTFILE "$type a;\n";
493 compiletest ($fnamebase, "Testing for type $type",
496 : "Type \"$type\" not available."), $missing, $optional);
497 } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) {
500 # Remember that this name is allowed.
501 if ($type =~ /^struct *(.*)/) {
503 } elsif ($type =~ /^union *(.*)/) {
509 # Generate a program to test for the availability of this type.
510 open (TESTFILE, ">$fnamebase.c");
511 print TESTFILE "$prepend";
512 print TESTFILE "#include <$h>\n";
513 print TESTFILE "$type;\n";
516 compiletest ($fnamebase, "Testing for type $type",
517 "Type \"$type\" not available.", $missing, 0);
518 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
519 my($rettype) = "$2$3";
524 # Remember that this name is allowed.
527 # Generate a program to test for availability of this function.
528 open (TESTFILE, ">$fnamebase.c");
529 print TESTFILE "$prepend";
530 print TESTFILE "#include <$h>\n";
531 # print TESTFILE "#undef $fname\n";
532 print TESTFILE "$rettype (*(*foobarbaz) $args = $fname;\n";
535 $res = compiletest ($fnamebase, "Test availability of function $fname",
538 : "Function \"$fname\" is not available."), $res,
541 if ($res == 0 || $missing == 1 || !$optional) {
542 # Generate a program to test for the type of this function.
543 open (TESTFILE, ">$fnamebase.c");
544 print TESTFILE "$prepend";
545 print TESTFILE "#include <$h>\n";
546 # print TESTFILE "#undef $fname\n";
547 print TESTFILE "extern $rettype (*(*foobarbaz) $args;\n";
548 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
551 compiletest ($fnamebase, "Test for type of function $fname",
552 "Function \"$fname\" has incorrect type.", $res, 0);
554 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
555 my($rettype) = "$2$3";
560 # Remember that this name is allowed.
563 # Generate a program to test for availability of this function.
564 open (TESTFILE, ">$fnamebase.c");
565 print TESTFILE "$prepend";
566 print TESTFILE "#include <$h>\n";
567 # print TESTFILE "#undef $fname\n";
568 print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
571 $res = compiletest ($fnamebase, "Test availability of function $fname",
574 : "Function \"$fname\" is not available."), $res,
577 if ($res == 0 || $missing != 0 || !$optional) {
578 # Generate a program to test for the type of this function.
579 open (TESTFILE, ">$fnamebase.c");
580 print TESTFILE "$prepend";
581 print TESTFILE "#include <$h>\n";
582 # print TESTFILE "#undef $fname\n";
583 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
584 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
587 compiletest ($fnamebase, "Test for type of function $fname",
588 "Function \"$fname\" has incorrect type.", $res, 0);
590 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) {
596 # Remember that this name is allowed.
599 # Generate a program to test for availability of this function.
600 open (TESTFILE, ">$fnamebase.c");
601 print TESTFILE "$prepend";
602 print TESTFILE "#include <$h>\n";
603 # print TESTFILE "#undef $fname\n";
604 print TESTFILE "typedef $type xyzzy$rest;\n";
605 print TESTFILE "$xyzzy *foobarbaz = &$vname;\n";
608 $res = compiletest ($fnamebase, "Test availability of variable $vname",
609 "Variable \"$vname\" is not available.", $res, 0);
611 # Generate a program to test for the type of this function.
612 open (TESTFILE, ">$fnamebase.c");
613 print TESTFILE "$prepend";
614 print TESTFILE "#include <$h>\n";
615 # print TESTFILE "#undef $fname\n";
616 print TESTFILE "extern $type $vname$rest;\n";
619 compiletest ($fnamebase, "Test for type of variable $fname",
620 "Variable \"$vname\" has incorrect type.", $res, 0);
621 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
622 my($rettype) = "$2$3";
627 # Remember that this name is allowed.
630 # Generate a program to test for availability of this function.
631 open (TESTFILE, ">$fnamebase.c");
632 print TESTFILE "$prepend";
633 print TESTFILE "#include <$h>\n";
634 print TESTFILE "#ifndef $fname\n";
635 print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
636 print TESTFILE "#endif\n";
639 $res = compiletest ($fnamebase, "Test availability of macro $fname",
640 "Function \"$fname\" is not available.", $res, 0);
642 # Generate a program to test for the type of this function.
643 open (TESTFILE, ">$fnamebase.c");
644 print TESTFILE "$prepend";
645 print TESTFILE "#include <$h>\n";
646 print TESTFILE "#ifndef $fname\n";
647 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
648 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
649 print TESTFILE "#endif\n";
652 compiletest ($fnamebase, "Test for type of macro $fname",
653 "Function \"$fname\" has incorrect type.", $res, 0);
654 } elsif (/^macro-str *([^ ]*) *(\".*\")/) {
655 # The above regex doesn't handle a \" in a string.
660 # Remember that this name is allowed.
663 # Generate a program to test for availability of this macro.
664 open (TESTFILE, ">$fnamebase.c");
665 print TESTFILE "$prepend";
666 print TESTFILE "#include <$h>\n";
667 print TESTFILE "#ifndef $macro\n";
668 print TESTFILE "# error \"Macro $macro not defined\"\n";
669 print TESTFILE "#endif\n";
672 compiletest ($fnamebase, "Test availability of macro $macro",
673 "Macro \"$macro\" is not available.", $missing, 0);
675 # Generate a program to test for the value of this macro.
676 open (TESTFILE, ">$fnamebase.c");
677 print TESTFILE "$prepend";
678 print TESTFILE "#include <$h>\n";
679 # We can't include <string.h> here.
680 print TESTFILE "extern int (strcmp)(const char *, const char *);\n";
681 print TESTFILE "int main (void) { return (strcmp) ($macro, $string) != 0;}\n";
684 $res = runtest ($fnamebase, "Testing for value of macro $macro",
685 "Macro \"$macro\" has not the right value.", $res);
686 } elsif (/^macro *([a-zA-Z0-9_]*) *(?:([>=<!]+) ([A-Za-z0-9_]*))?/) {
692 # Remember that this name is allowed.
695 # Generate a program to test for availability of this macro.
696 open (TESTFILE, ">$fnamebase.c");
697 print TESTFILE "$prepend";
698 print TESTFILE "#include <$h>\n";
699 print TESTFILE "#ifndef $macro\n";
700 print TESTFILE "# error \"Macro $macro not defined\"\n";
701 print TESTFILE "#endif\n";
704 $res = compiletest ($fnamebase, "Test availability of macro $macro",
707 : "Macro \"$macro\" is not available."), $res,
710 if (defined ($op) && ($res == 0 || !$optional)) {
711 # Generate a program to test for the value of this constant.
712 open (TESTFILE, ">$fnamebase.c");
713 print TESTFILE "$prepend";
714 print TESTFILE "#include <$h>\n";
715 # Negate the value since 0 means ok
716 print TESTFILE "int main (void) { return !($macro $op $value); }\n";
719 $res = runtest ($fnamebase, "Testing for value of macro $macro",
720 "Macro \"$macro\" has not the right value.", $res);
722 } elsif (/^allow-header *(.*)/) {
724 if ($seenheader{$pattern} != 1) {
725 push @allowheader, $pattern;
726 $seenheader{$pattern} = 1;
729 } elsif (/^allow *(.*)/) {
731 push @allow, $pattern;
734 # printf ("line is `%s'\n", $_);
742 # Read the data files for the header files which are allowed to be included.
743 while ($#allowheader >= 0) {
744 my($ah) = pop @allowheader;
746 open (ALLOW, "$CC -E -D$standard - < data/$ah-data |");
747 acontrol: while (<ALLOW>) {
749 next acontrol if (/^#/);
750 next acontrol if (/^[ ]*$/);
752 if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
754 } elsif (/^constant *([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) {
756 } elsif (/^(type|tag) *({([^}]*)|([a-zA-Z0-9_]*))/) {
759 # Remember that this name is allowed.
760 if ($type =~ /^struct *(.*)/) {
762 } elsif ($type =~ /^union *(.*)/) {
767 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
769 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
771 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
773 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
775 } elsif (/^macro *([a-zA-Z0-9_]*) *(?:([>=<!]+) ([A-Za-z0-9_]*))?/) {
777 } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
779 } elsif (/^allow-header *(.*)/) {
780 if ($seenheader{$1} != 1) {
781 push @allowheader, $1;
784 } elsif (/^allow *(.*)/) {
792 printf (" Not defined\n");
794 # Now check the namespace.
795 printf (" Checking the namespace of \"%s\"... ", $h);
800 checknamespace ($h, $fnamebase, @allow);
807 printf "-" x 76 . "\n";
808 printf (" Total number of tests : %4d\n", $total);
810 printf (" Number of failed tests : %4d (", $errors);
811 $percent = ($errors * 100) / $total;
812 if ($errors > 0 && $percent < 1.0) {
815 printf ("%3d%%)\n", $percent);
818 printf (" Number of skipped tests : %4d (", $skipped);
819 $percent = ($skipped * 100) / $total;
820 if ($skipped > 0 && $percent < 1.0) {
823 printf ("%3d%%)\n", $percent);
828 # perl-indent-level: 2