8 GetOptions ('headers=s' => \@headers, 'dialect=s' => \$dialect);
9 @headers = split(/,/,join(',',@headers));
11 # List of the headers we are testing.
13 @headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h",
14 "utime.h", "unistd.h", "ulimit.h", "ucontext.h", "time.h",
15 "termios.h", "tar.h", "sys/wait.h", "sys/utsname.h", "sys/un.h",
16 "sys/uio.h", "sys/types.h", "sys/times.h", "sys/timeb.h",
17 "sys/time.h", "sys/statvfs.h", "sys/stat.h", "sys/socket.h",
18 "sys/shm.h", "sys/sem.h", "sys/resource.h", "sys/msg.h",
19 "sys/mman.h", "sys/ipc.h", "syslog.h", "stropts.h", "strings.h",
20 "string.h", "stdlib.h", "stdio.h", "stddef.h", "stdarg.h",
21 "spawn.h", "signal.h", "setjmp.h", "semaphore.h",
22 "search.h", "sched.h", "regex.h", "pwd.h", "pthread.h",
23 "poll.h", "nl_types.h", "netinet/tcp.h", "netinet/in.h",
24 "net/if.h", "netdb.h", "ndbm.h", "mqueue.h", "monetary.h",
25 "math.h", "locale.h", "libgen.h", "limits.h", "langinfo.h",
26 "iso646.h", "inttypes.h", "iconv.h", "grp.h", "glob.h", "ftw.h",
27 "fnmatch.h", "fmtmsg.h", "float.h", "fcntl.h", "errno.h",
28 "dlfcn.h", "dirent.h", "ctype.h", "cpio.h", "assert.h",
29 "arpa/inet.h", "aio.h");
32 if ($dialect ne "ISO" && $dialect ne "POSIX" && $dialect ne "XPG3"
33 && $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K") {
34 die "unknown dialect \"$dialect\"";
37 $CFLAGS{"ISO"} = "-I. '-D__attribute__(x)=' -ansi";
38 $CFLAGS{"POSIX"} = "-I. '-D__attribute__(x)=' -D_POSIX_C_SOURCE=199912";
39 $CFLAGS{"XPG3"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE";
40 $CFLAGS{"XPG4"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE_EXTENDED";
41 $CFLAGS{"UNIX98"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=500";
42 $CFLAGS{"XOPEN2K"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
45 # These are the ISO C99 keywords.
46 @keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default',
47 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto',
48 'if', 'inline', 'int', 'long', 'register', 'restrict', 'return',
49 'short', 'signed', 'sizeof', 'static', 'struct', 'switch',
50 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while');
52 # These are symbols which are known to pollute the namespace.
53 @knownproblems = ('unix', 'linux', 'i386');
55 # Some headers need a bit more attention.
56 $mustprepend{'regex.h'} = "#include <sys/types.h>\n";
57 $mustprepend{'wordexp.h'} = "#include <stddef.h>\n";
59 # Make a hash table from this information.
60 while ($#keywords >= 0) {
61 $iskeyword{pop (@keywords)} = 1;
64 # Make a hash table from the known problems.
65 while ($#knownproblems >= 0) {
66 $isknown{pop (@knownproblems)} = 1;
79 my($pattern, $string) = @_;
80 my($strlen) = length ($string);
83 if (substr ($pattern, 0, 1) eq '*') {
84 my($patlen) = length ($pattern) - 1;
85 $res = ($strlen >= $patlen
86 && substr ($pattern, -$patlen, $patlen) eq substr ($string, -$patlen, $patlen));
87 } elsif (substr ($pattern, -1, 1) eq '*') {
88 my($patlen) = length ($pattern) - 1;
89 $res = ($strlen >= $patlen
90 && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen));
92 $res = $pattern eq $string;
100 my($fnamebase, $msg, $errmsg, $skip, $optional) = @_;
111 $ret = system "$CC $CFLAGS{$dialect} -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1";
113 if ($optional != 0) {
114 printf (" $errmsg\n");
119 printf (" $errmsg Compiler message:\n");
127 if ($verbose > 1 && -s "$fnamebase.out") {
128 # We print all warnings issued.
132 if ($printlog != 0) {
133 printf (" " . "-" x 71 . "\n");
134 open (MESSAGE, "< $fnamebase.out");
139 printf (" " . "-" x 71 . "\n");
142 unlink "$fnamebase.c";
143 unlink "$fnamebase.o";
144 unlink "$fnamebase.out";
152 my($fnamebase, $msg, $errmsg, $skip) = @_;
163 $ret = system "$CC $CFLAGS{$dialect} -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1";
167 printf (" $errmsg Compiler message:\n");
173 # Now run the program. If the exit code is not zero something is wrong.
174 $result = system "$fnamebase > $fnamebase.out2 2>&1";
177 if ($verbose > 1 && -s "$fnamebase.out") {
178 # We print all warnings issued.
180 system "cat $fnamebase.out2 >> $fnamebase.out";
185 unlink "$fnamebase.out";
186 rename "$fnamebase.out2", "$fnamebase.out";
189 if ($printlog != 0) {
190 printf (" " . "-" x 71 . "\n");
191 open (MESSAGE, "< $fnamebase.out");
196 printf (" " . "-" x 71 . "\n");
200 unlink "$fnamebase.c";
201 unlink "$fnamebase.o";
202 unlink "$fnamebase.out";
203 unlink "$fnamebase.out2";
210 my($token, @allow) = @_;
213 return if ($token =~ /^[0-9_]/ || $iskeyword{$token});
215 for ($idx = 0; $idx <= $#allow; ++$idx) {
216 return if (poorfnmatch ($allow[$idx], $token));
219 if ($isknown{$token}) {
224 printf ("FAIL\n " . "-" x 72 . "\n");
226 printf (" Namespace violation: \"%s\"\n", $token);
232 my($h, $fnamebase, @allow) = @_;
236 # Generate a program to get the contents of this header.
237 open (TESTFILE, ">$fnamebase.c");
238 print TESTFILE "#include <$h>\n";
243 open (CONTENT, "$CC $CFLAGS{$dialect} -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
244 loop: while (<CONTENT>) {
245 next loop if (/^#undef /);
247 if (/^#define (.*)/) {
248 newtoken ($1, @allow);
250 # We have to tokenize the line.
253 my($len) = length ($str);
255 foreach $token (split(/[^a-zA-Z0-9_]/, $str)) {
257 newtoken ($token, @allow);
263 unlink "$fnamebase.c";
265 printf (" " . "-" x 72 . "\n");
267 } elsif ($nknown > 0) {
268 printf ("EXPECTED FAILURES\n");
276 while ($#headers >= 0) {
277 my($h) = pop (@headers);
280 my($fnamebase) = "$tmpdir/$hf-test";
283 my(@allowheader) = ();
284 my(%seenheader) = ();
285 my($prepend) = $mustprepend{$h};
287 printf ("Testing <$h>\n");
288 printf ("----------" . "-" x length ($h) . "\n");
290 # Generate a program to test for the availability of this header.
291 open (TESTFILE, ">$fnamebase.c");
292 print TESTFILE "$prepend";
293 print TESTFILE "#include <$h>\n";
296 $missing = compiletest ($fnamebase, "Checking whether <$h> is available",
297 "Header <$h> not available", 0, 0);
301 open (CONTROL, "$CC -E -D$dialect - < data/$h-data |");
302 control: while (<CONTROL>) {
304 next control if (/^#/);
305 next control if (/^[ ]*$/);
307 if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
308 my($struct) = "$2$3";
314 # Remember that this name is allowed.
315 push @allow, $member;
317 # Generate a program to test for the availability of this member.
318 open (TESTFILE, ">$fnamebase.c");
319 print TESTFILE "$prepend";
320 print TESTFILE "#include <$h>\n";
321 print TESTFILE "$struct a;\n";
322 print TESTFILE "$struct b;\n";
323 print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n";
324 print TESTFILE "void foobarbaz (void) {\n";
325 print TESTFILE " xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n";
326 print TESTFILE "}\n";
329 $res = compiletest ($fnamebase, "Testing for member $member",
330 "Member \"$member\" not available.", $res, 0);
333 # Test the types of the members.
334 open (TESTFILE, ">$fnamebase.c");
335 print TESTFILE "$prepend";
336 print TESTFILE "#include <$h>\n";
337 print TESTFILE "$struct a;\n";
338 print TESTFILE "extern $type b$rest;\n";
339 print TESTFILE "extern __typeof__ (a.$member) b;\n";
342 compiletest ($fnamebase, "Testing for type of member $member",
343 "Member \"$member\" does not have the correct type.", $res);
344 } elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) {
350 # Remember that this name is allowed.
353 # Generate a program to test for the availability of this constant.
354 open (TESTFILE, ">$fnamebase.c");
355 print TESTFILE "$prepend";
356 print TESTFILE "#include <$h>\n";
357 print TESTFILE "__typeof__ ($const) a = $const;\n";
360 $res = compiletest ($fnamebase, "Testing for constant $const",
361 "NOT PRESENT", $res, 1);
364 # Generate a program to test for the value of this constant.
365 open (TESTFILE, ">$fnamebase.c");
366 print TESTFILE "$prepend";
367 print TESTFILE "#include <$h>\n";
368 # Negate the value since 0 means ok
369 print TESTFILE "int main (void) { return !($const $op $value); }\n";
372 $res = runtest ($fnamebase, "Testing for value of constant $const",
373 "Constant \"$const\" has not the right value.", $res);
375 } elsif (/^constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) {
381 # Remember that this name is allowed.
384 # Generate a program to test for the availability of this constant.
385 open (TESTFILE, ">$fnamebase.c");
386 print TESTFILE "$prepend";
387 print TESTFILE "#include <$h>\n";
388 print TESTFILE "__typeof__ ($const) a = $const;\n";
391 $res = compiletest ($fnamebase, "Testing for constant $const",
392 "Constant \"$const\" not available.", $res, 0);
395 # Generate a program to test for the value of this constant.
396 open (TESTFILE, ">$fnamebase.c");
397 print TESTFILE "$prepend";
398 print TESTFILE "#include <$h>\n";
399 # Negate the value since 0 means ok
400 print TESTFILE "int main (void) { return !($const $op $value); }\n";
403 $res = runtest ($fnamebase, "Testing for value of constant $const",
404 "Constant \"$const\" has not the right value.", $res);
406 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
412 # Remember that this name is allowed.
415 # Generate a program to test for the availability of this constant.
416 open (TESTFILE, ">$fnamebase.c");
417 print TESTFILE "$prepend";
418 print TESTFILE "#include <$h>\n";
419 print TESTFILE "__typeof__ ($const) a = $const;\n";
422 $res = compiletest ($fnamebase, "Testing for constant $const",
423 "Constant \"$const\" not available.", $res, 0);
425 # Test the types of the members.
426 open (TESTFILE, ">$fnamebase.c");
427 print TESTFILE "$prepend";
428 print TESTFILE "#include <$h>\n";
429 print TESTFILE "__typeof__ (($type) 0) a;\n";
430 print TESTFILE "extern __typeof__ ($const) a;\n";
433 compiletest ($fnamebase, "Testing for type of constant $const",
434 "Constant \"$const\" does not have the correct type.",
438 # Generate a program to test for the value of this constant.
439 open (TESTFILE, ">$fnamebase.c");
440 print TESTFILE "$prepend";
441 print TESTFILE "#include <$h>\n";
442 print TESTFILE "int main (void) { return $const != $value; }\n";
445 $res = runtest ($fnamebase, "Testing for value of constant $const",
446 "Constant \"$const\" has not the right value.", $res);
448 } elsif (/^optional-constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
453 # Remember that this name is allowed.
456 # Generate a program to test for the availability of this constant.
457 open (TESTFILE, ">$fnamebase.c");
458 print TESTFILE "$prepend";
459 print TESTFILE "#include <$h>\n";
460 print TESTFILE "__typeof__ ($const) a = $const;\n";
463 $res = compiletest ($fnamebase, "Testing for constant $const",
464 "NOT PRESENT", $res, 1);
467 # Generate a program to test for the value of this constant.
468 open (TESTFILE, ">$fnamebase.c");
469 print TESTFILE "$prepend";
470 print TESTFILE "#include <$h>\n";
471 print TESTFILE "int main (void) { return $const != $value; }\n";
474 $res = runtest ($fnamebase, "Testing for value of constant $const",
475 "Constant \"$const\" has not the right value.", $res);
477 } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
482 # Remember that this name is allowed.
485 # Generate a program to test for the availability of this constant.
486 open (TESTFILE, ">$fnamebase.c");
487 print TESTFILE "$prepend";
488 print TESTFILE "#include <$h>\n";
489 print TESTFILE "__typeof__ ($const) a = $const;\n";
492 $res = compiletest ($fnamebase, "Testing for constant $const",
493 "Constant \"$const\" not available.", $res, 0);
496 # Generate a program to test for the value of this constant.
497 open (TESTFILE, ">$fnamebase.c");
498 print TESTFILE "$prepend";
499 print TESTFILE "#include <$h>\n";
500 print TESTFILE "int main (void) { return $const != $value; }\n";
503 $res = runtest ($fnamebase, "Testing for value of constant $const",
504 "Constant \"$const\" has not the right value.", $res);
506 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
512 # Remember that this name is allowed.
515 # Generate a program to test for the availability of this constant.
516 open (TESTFILE, ">$fnamebase.c");
517 print TESTFILE "$prepend";
518 print TESTFILE "#include <$h>\n";
519 print TESTFILE "__typeof__ ($const) a = $const;\n";
522 $res = compiletest ($fnamebase, "Testing for constant $const",
523 "Constant \"$const\" not available.", $res, 0);
525 # Test the types of the members.
526 open (TESTFILE, ">$fnamebase.c");
527 print TESTFILE "$prepend";
528 print TESTFILE "#include <$h>\n";
529 print TESTFILE "__typeof__ (($type) 0) a;\n";
530 print TESTFILE "extern __typeof__ ($const) a;\n";
533 compiletest ($fnamebase, "Testing for type of constant $const",
534 "Constant \"$const\" does not have the correct type.",
538 # Generate a program to test for the value of this constant.
539 open (TESTFILE, ">$fnamebase.c");
540 print TESTFILE "$prepend";
541 print TESTFILE "#include <$h>\n";
542 print TESTFILE "int main (void) { return $const != $value; }\n";
545 $res = runtest ($fnamebase, "Testing for value of constant $const",
546 "Constant \"$const\" has not the right value.", $res);
548 } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
551 # Remember that this name is allowed.
552 if ($type =~ /^struct *(.*)/) {
554 } elsif ($type =~ /^union *(.*)/) {
560 # Remember that this name is allowed.
563 # Generate a program to test for the availability of this constant.
564 open (TESTFILE, ">$fnamebase.c");
565 print TESTFILE "$prepend";
566 print TESTFILE "#include <$h>\n";
567 print TESTFILE "$type *a;\n";
570 compiletest ($fnamebase, "Testing for type $type",
571 "Type \"$type\" not available.", $missing, 0);
572 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
573 my($rettype) = "$2$3";
578 # Remember that this name is allowed.
581 # Generate a program to test for availability of this function.
582 open (TESTFILE, ">$fnamebase.c");
583 print TESTFILE "$prepend";
584 print TESTFILE "#include <$h>\n";
585 # print TESTFILE "#undef $fname\n";
586 print TESTFILE "$rettype (*(*foobarbaz) $args = $fname;\n";
589 $res = compiletest ($fnamebase, "Test availability of function $fname",
590 "Function \"$fname\" is not available.", $res, 0);
592 # Generate a program to test for the type of this function.
593 open (TESTFILE, ">$fnamebase.c");
594 print TESTFILE "$prepend";
595 print TESTFILE "#include <$h>\n";
596 # print TESTFILE "#undef $fname\n";
597 print TESTFILE "extern $rettype (*(*foobarbaz) $args;\n";
598 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
601 compiletest ($fnamebase, "Test for type of function $fname",
602 "Function \"$fname\" has incorrect type.", $res, 0);
603 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
604 my($rettype) = "$2$3";
609 # Remember that this name is allowed.
612 # Generate a program to test for availability of this function.
613 open (TESTFILE, ">$fnamebase.c");
614 print TESTFILE "$prepend";
615 print TESTFILE "#include <$h>\n";
616 # print TESTFILE "#undef $fname\n";
617 print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
620 $res = compiletest ($fnamebase, "Test availability of function $fname",
621 "Function \"$fname\" is not available.", $res, 0);
623 # Generate a program to test for the type of this function.
624 open (TESTFILE, ">$fnamebase.c");
625 print TESTFILE "$prepend";
626 print TESTFILE "#include <$h>\n";
627 # print TESTFILE "#undef $fname\n";
628 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
629 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
632 compiletest ($fnamebase, "Test for type of function $fname",
633 "Function \"$fname\" has incorrect type.", $res, 0);
634 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
639 # Remember that this name is allowed.
642 # Generate a program to test for availability of this function.
643 open (TESTFILE, ">$fnamebase.c");
644 print TESTFILE "$prepend";
645 print TESTFILE "#include <$h>\n";
646 # print TESTFILE "#undef $fname\n";
647 print TESTFILE "$type *foobarbaz = &$vname;\n";
650 $res = compiletest ($fnamebase, "Test availability of variable $vname",
651 "Variable \"$vname\" is not available.", $res, 0);
653 # Generate a program to test for the type of this function.
654 open (TESTFILE, ">$fnamebase.c");
655 print TESTFILE "$prepend";
656 print TESTFILE "#include <$h>\n";
657 # print TESTFILE "#undef $fname\n";
658 print TESTFILE "extern $type $vname;\n";
661 compiletest ($fnamebase, "Test for type of variable $fname",
662 "Variable \"$vname\" has incorrect type.", $res, 0);
663 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
664 my($rettype) = "$2$3";
669 # Remember that this name is allowed.
672 # Generate a program to test for availability of this function.
673 open (TESTFILE, ">$fnamebase.c");
674 print TESTFILE "$prepend";
675 print TESTFILE "#include <$h>\n";
676 print TESTFILE "#ifndef $fname\n";
677 print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
678 print TESTFILE "#endif\n";
681 $res = compiletest ($fnamebase, "Test availability of function $fname",
682 "Function \"$fname\" is not available.", $res, 0);
684 # Generate a program to test for the type of this function.
685 open (TESTFILE, ">$fnamebase.c");
686 print TESTFILE "$prepend";
687 print TESTFILE "#include <$h>\n";
688 print TESTFILE "#ifndef $fname\n";
689 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
690 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
691 print TESTFILE "#endif\n";
694 compiletest ($fnamebase, "Test for type of function $fname",
695 "Function \"$fname\" has incorrect type.", $res, 0);
696 } elsif (/^macro-str *([^ ]*)\s*(\".*\")/) {
697 # The above regex doesn't handle a \" in a string.
702 # Remember that this name is allowed.
705 # Generate a program to test for availability of this macro.
706 open (TESTFILE, ">$fnamebase.c");
707 print TESTFILE "$prepend";
708 print TESTFILE "#include <$h>\n";
709 print TESTFILE "#ifndef $macro\n";
710 print TESTFILE "# error \"Macro $macro not defined\"\n";
711 print TESTFILE "#endif\n";
714 compiletest ($fnamebase, "Test availability of macro $macro",
715 "Macro \"$macro\" is not available.", $missing, 0);
717 # Generate a program to test for the value of this macro.
718 open (TESTFILE, ">$fnamebase.c");
719 print TESTFILE "$prepend";
720 print TESTFILE "#include <$h>\n";
721 # We can't include <string.h> here.
722 print TESTFILE "extern int (strcmp)(const char *, const char *);\n";
723 print TESTFILE "int main (void) { return strcmp ($macro, $string) != 0;}\n";
726 $res = runtest ($fnamebase, "Testing for value of macro $macro",
727 "Macro \"$macro\" has not the right value.", $res);
728 } elsif (/^macro *([^ ]*)/) {
731 # Remember that this name is allowed.
734 # Generate a program to test for availability of this macro.
735 open (TESTFILE, ">$fnamebase.c");
736 print TESTFILE "$prepend";
737 print TESTFILE "#include <$h>\n";
738 print TESTFILE "#ifndef $macro\n";
739 print TESTFILE "# error \"Macro $macro not defined\"\n";
740 print TESTFILE "#endif\n";
743 compiletest ($fnamebase, "Test availability of macro $macro",
744 "Macro \"$macro\" is not available.", $missing, 0);
745 } elsif (/^allow-header *(.*)/) {
747 if ($seenheader{$pattern} != 1) {
748 push @allowheader, $pattern;
749 $seenheader{$pattern} = 1;
752 } elsif (/^allow *(.*)/) {
754 push @allow, $pattern;
757 # printf ("line is `%s'\n", $_);
765 # Read the data files for the header files which are allowed to be included.
766 while ($#allowheader >= 0) {
767 my($ah) = pop @allowheader;
769 open (ALLOW, "$CC -E -D$dialect - < data/$ah-data |");
770 acontrol: while (<ALLOW>) {
771 next acontrol if (/^#/);
772 next acontrol if (/^[ ]*$/);
774 if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
776 } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
778 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
780 } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
783 # Remember that this name is allowed.
784 if ($type =~ /^struct *(.*)/) {
786 } elsif ($type =~ /^union *(.*)/) {
791 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
793 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
795 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
797 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
799 } elsif (/^macro *([^ ]*)/) {
801 } elsif (/^allow-header *(.*)/) {
802 if ($seenheader{$1} != 1) {
803 push @allowheader, $1;
806 } elsif (/^allow *(.*)/) {
813 # Now check the namespace.
814 printf (" Checking the namespace of \"%s\"... ", $h);
819 checknamespace ($h, $fnamebase, @allow);
825 printf "-" x 76 . "\n";
826 printf (" Total number of tests : %4d\n", $total);
828 printf (" Number of known failures: %4d (", $known);
829 $percent = ($known * 100) / $total;
830 if ($known > 0 && $percent < 1.0) {
833 printf ("%3d%%)\n", $percent);
836 printf (" Number of failed tests : %4d (", $errors);
837 $percent = ($errors * 100) / $total;
838 if ($errors > 0 && $percent < 1.0) {
841 printf ("%3d%%)\n", $percent);
844 printf (" Number of skipped tests : %4d (", $skipped);
845 $percent = ($skipped * 100) / $total;
846 if ($skipped > 0 && $percent < 1.0) {
849 printf ("%3d%%)\n", $percent);