4 $CFLAGS = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
6 # List of the headers we are testing.
7 @headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h",
8 "utime.h", "unistd.h", "ulimit.h", "ucontext.h", "time.h",
9 "termios.h", "tar.h", "sys/wait.h", "sys/utsname.h", "sys/un.h",
10 "sys/uio.h", "sys/types.h", "sys/times.h", "sys/timeb.h",
11 "sys/time.h", "sys/statvfs.h", "sys/stat.h", "sys/socket.h",
12 "sys/shm.h", "sys/sem.h", "sys/resource.h", "sys/msg.h",
13 "sys/mman.h", "sys/ipc.h", "syslog.h", "stropts.h", "strings.h",
14 "string.h", "stdlib.h", "stdio.h", "stddef.h", "stdarg.h",
15 "spawn.h", "signal.h", "setjmp.h", "semaphore.h",
16 "search.h", "sched.h", "regex.h", "pwd.h", "pthread.h",
17 "poll.h", "nl_types.h", "netinet/tcp.h", "netinet/in.h",
18 "net/if.h", "netdb.h", "ndbm.h", "mqueue.h", "monetary.h",
19 "math.h", "locale.h", "libgen.h", "limits.h", "langinfo.h",
20 "iso646.h", "inttypes.h", "iconv.h", "grp.h", "glob.h", "ftw.h",
21 "fnmatch.h", "fmtmsg.h", "float.h", "fcntl.h", "errno.h",
22 "dlfcn.h", "dirent.h", "ctype.h", "cpio.h", "assert.h",
23 "arpa/inet.h", "aio.h");
25 # These are the ISO C99 keywords.
26 @keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default',
27 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto',
28 'if', 'inline', 'int', 'long', 'register', 'restrict', 'return',
29 'short', 'signed', 'sizeof', 'static', 'struct', 'switch',
30 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while');
32 # These are symbols which are known to pollute the namespace.
33 @knownproblems = ('unix', 'linux', 'i386');
35 # Some headers need a bit more attention.
36 $mustprepend{'regex.h'} = "#include <sys/types.h>\n";
37 $mustprepend{'wordexp.h'} = "#include <stddef.h>\n";
39 # Make a hash table from this information.
40 while ($#keywords >= 0) {
41 $iskeyword{pop (@keywords)} = 1;
44 # Make a hash table from the known problems.
45 while ($#knownproblems >= 0) {
46 $isknown{pop (@knownproblems)} = 1;
66 my($pattern, $string) = @_;
67 my($strlen) = length ($string);
70 if (substr ($pattern, 0, 1) eq '*') {
71 my($patlen) = length ($pattern) - 1;
72 $res = ($strlen >= $patlen
73 && substr ($pattern, -$patlen, $patlen) eq substr ($string, -$patlen, $patlen));
74 } elsif (substr ($pattern, -1, 1) eq '*') {
75 my($patlen) = length ($pattern) - 1;
76 $res = ($strlen >= $patlen
77 && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen));
79 $res = $pattern eq $string;
87 my($fnamebase, $msg, $errmsg, $skip, $optional) = @_;
98 $ret = system "$CC $CFLAGS -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1";
100 if ($optional != 0) {
101 printf (" $errmsg\n");
106 printf (" $errmsg Compiler message:\n");
114 if ($verbose > 1 && -s "$fnamebase.out") {
115 # We print all warnings issued.
119 if ($printlog != 0) {
120 printf (" " . "-" x 71 . "\n");
121 open (MESSAGE, "< $fnamebase.out");
126 printf (" " . "-" x 71 . "\n");
129 unlink "$fnamebase.c";
130 unlink "$fnamebase.o";
131 unlink "$fnamebase.out";
139 my($fnamebase, $msg, $errmsg, $skip) = @_;
150 $ret = system "$CC $CFLAGS -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1";
154 printf (" $errmsg Compiler message:\n");
160 # Now run the program. If the exit code is not zero something is wrong.
161 $result = system "$fnamebase > $fnamebase.out2 2>&1";
164 if ($verbose > 1 && -s "$fnamebase.out") {
165 # We print all warnings issued.
167 system "cat $fnamebase.out2 >> $fnamebase.out";
172 unlink "$fnamebase.out";
173 rename "$fnamebase.out2", "$fnamebase.out";
176 if ($printlog != 0) {
177 printf (" " . "-" x 71 . "\n");
178 open (MESSAGE, "< $fnamebase.out");
183 printf (" " . "-" x 71 . "\n");
187 unlink "$fnamebase.c";
188 unlink "$fnamebase.o";
189 unlink "$fnamebase.out";
190 unlink "$fnamebase.out2";
197 my($token, @allow) = @_;
200 return if ($token =~ /^[0-9_]/ || $iskeyword{$token});
202 for ($idx = 0; $idx <= $#allow; ++$idx) {
203 return if (poorfnmatch ($allow[$idx], $token));
206 if ($isknown{$token}) {
211 printf ("FAIL\n " . "-" x 72 . "\n");
213 printf (" Namespace violation: \"%s\"\n", $token);
219 my($h, $fnamebase, @allow) = @_;
223 # Generate a program to get the contents of this header.
224 open (TESTFILE, ">$fnamebase.c");
225 print TESTFILE "#include <$h>\n";
230 open (CONTENT, "$CC $CFLAGS -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
231 loop: while (<CONTENT>) {
232 next loop if (/^#undef /);
234 if (/^#define (.*)/) {
235 newtoken ($1, @allow);
237 # We have to tokenize the line.
240 my($len) = length ($str);
242 foreach $token (split(/[^a-zA-Z0-9_]/, $str)) {
244 newtoken ($token, @allow);
250 unlink "$fnamebase.c";
252 printf (" " . "-" x 72 . "\n");
254 } elsif ($nknown > 0) {
255 printf ("EXPECTED FAILURES\n");
263 while ($#headers >= 0) {
264 my($h) = pop (@headers);
267 my($fnamebase) = "$tmpdir/$hf-test";
270 my(@allowheader) = ();
271 my(%seenheader) = ();
272 my($prepend) = $mustprepend{$h};
274 printf ("Testing <$h>\n");
275 printf ("----------" . "-" x length ($h) . "\n");
277 # Generate a program to test for the availability of this header.
278 open (TESTFILE, ">$fnamebase.c");
279 print TESTFILE "$prepend";
280 print TESTFILE "#include <$h>\n";
283 $missing = compiletest ($fnamebase, "Checking whether <$h> is available",
284 "Header <$h> not available", 0, 0);
288 open (CONTROL, "$CC -E -D$dialect - < data/$h-data |");
289 control: while (<CONTROL>) {
291 next control if (/^#/);
292 next control if (/^[ ]*$/);
294 if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
295 my($struct) = "$2$3";
301 # Remember that this name is allowed.
302 push @allow, $member;
304 # Generate a program to test for the availability of this member.
305 open (TESTFILE, ">$fnamebase.c");
306 print TESTFILE "$prepend";
307 print TESTFILE "#include <$h>\n";
308 print TESTFILE "$struct a;\n";
309 print TESTFILE "$struct b;\n";
310 print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n";
311 print TESTFILE "void foobarbaz (void) {\n";
312 print TESTFILE " xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n";
313 print TESTFILE "}\n";
316 $res = compiletest ($fnamebase, "Testing for member $member",
317 "Member \"$member\" not available.", $res, 0);
320 # Test the types of the members.
321 open (TESTFILE, ">$fnamebase.c");
322 print TESTFILE "$prepend";
323 print TESTFILE "#include <$h>\n";
324 print TESTFILE "$struct a;\n";
325 print TESTFILE "extern $type b$rest;\n";
326 print TESTFILE "extern __typeof__ (a.$member) b;\n";
329 compiletest ($fnamebase, "Testing for type of member $member",
330 "Member \"$member\" does not have the correct type.", $res);
331 } elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) {
337 # Remember that this name is allowed.
340 # Generate a program to test for the availability of this constant.
341 open (TESTFILE, ">$fnamebase.c");
342 print TESTFILE "$prepend";
343 print TESTFILE "#include <$h>\n";
344 print TESTFILE "__typeof__ ($const) a = $const;\n";
347 $res = compiletest ($fnamebase, "Testing for constant $const",
348 "NOT PRESENT", $res, 1);
351 # Generate a program to test for the value of this constant.
352 open (TESTFILE, ">$fnamebase.c");
353 print TESTFILE "$prepend";
354 print TESTFILE "#include <$h>\n";
355 # Negate the value since 0 means ok
356 print TESTFILE "int main (void) { return !($const $op $value); }\n";
359 $res = runtest ($fnamebase, "Testing for value of constant $const",
360 "Constant \"$const\" has not the right value.", $res);
362 } elsif (/^constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) {
368 # Remember that this name is allowed.
371 # Generate a program to test for the availability of this constant.
372 open (TESTFILE, ">$fnamebase.c");
373 print TESTFILE "$prepend";
374 print TESTFILE "#include <$h>\n";
375 print TESTFILE "__typeof__ ($const) a = $const;\n";
378 $res = compiletest ($fnamebase, "Testing for constant $const",
379 "Constant \"$const\" not available.", $res, 0);
382 # Generate a program to test for the value of this constant.
383 open (TESTFILE, ">$fnamebase.c");
384 print TESTFILE "$prepend";
385 print TESTFILE "#include <$h>\n";
386 # Negate the value since 0 means ok
387 print TESTFILE "int main (void) { return !($const $op $value); }\n";
390 $res = runtest ($fnamebase, "Testing for value of constant $const",
391 "Constant \"$const\" has not the right value.", $res);
393 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
399 # Remember that this name is allowed.
402 # Generate a program to test for the availability of this constant.
403 open (TESTFILE, ">$fnamebase.c");
404 print TESTFILE "$prepend";
405 print TESTFILE "#include <$h>\n";
406 print TESTFILE "__typeof__ ($const) a = $const;\n";
409 $res = compiletest ($fnamebase, "Testing for constant $const",
410 "Constant \"$const\" not available.", $res, 0);
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 # Generate a program to test for the value of this constant.
426 open (TESTFILE, ">$fnamebase.c");
427 print TESTFILE "$prepend";
428 print TESTFILE "#include <$h>\n";
429 print TESTFILE "int main (void) { return $const != $value; }\n";
432 $res = runtest ($fnamebase, "Testing for value of constant $const",
433 "Constant \"$const\" has not the right value.", $res);
435 } elsif (/^optional-constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
440 # Remember that this name is allowed.
443 # Generate a program to test for the availability of this constant.
444 open (TESTFILE, ">$fnamebase.c");
445 print TESTFILE "$prepend";
446 print TESTFILE "#include <$h>\n";
447 print TESTFILE "__typeof__ ($const) a = $const;\n";
450 $res = compiletest ($fnamebase, "Testing for constant $const",
451 "NOT PRESENT", $res, 1);
454 # Generate a program to test for the value of this constant.
455 open (TESTFILE, ">$fnamebase.c");
456 print TESTFILE "$prepend";
457 print TESTFILE "#include <$h>\n";
458 print TESTFILE "int main (void) { return $const != $value; }\n";
461 $res = runtest ($fnamebase, "Testing for value of constant $const",
462 "Constant \"$const\" has not the right value.", $res);
464 } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
469 # Remember that this name is allowed.
472 # Generate a program to test for the availability of this constant.
473 open (TESTFILE, ">$fnamebase.c");
474 print TESTFILE "$prepend";
475 print TESTFILE "#include <$h>\n";
476 print TESTFILE "__typeof__ ($const) a = $const;\n";
479 $res = compiletest ($fnamebase, "Testing for constant $const",
480 "Constant \"$const\" not available.", $res, 0);
483 # Generate a program to test for the value of this constant.
484 open (TESTFILE, ">$fnamebase.c");
485 print TESTFILE "$prepend";
486 print TESTFILE "#include <$h>\n";
487 print TESTFILE "int main (void) { return $const != $value; }\n";
490 $res = runtest ($fnamebase, "Testing for value of constant $const",
491 "Constant \"$const\" has not the right value.", $res);
493 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
499 # Remember that this name is allowed.
502 # Generate a program to test for the availability of this constant.
503 open (TESTFILE, ">$fnamebase.c");
504 print TESTFILE "$prepend";
505 print TESTFILE "#include <$h>\n";
506 print TESTFILE "__typeof__ ($const) a = $const;\n";
509 $res = compiletest ($fnamebase, "Testing for constant $const",
510 "Constant \"$const\" not available.", $res, 0);
512 # Test the types of the members.
513 open (TESTFILE, ">$fnamebase.c");
514 print TESTFILE "$prepend";
515 print TESTFILE "#include <$h>\n";
516 print TESTFILE "__typeof__ (($type) 0) a;\n";
517 print TESTFILE "extern __typeof__ ($const) a;\n";
520 compiletest ($fnamebase, "Testing for type of constant $const",
521 "Constant \"$const\" does not have the correct type.",
525 # Generate a program to test for the value of this constant.
526 open (TESTFILE, ">$fnamebase.c");
527 print TESTFILE "$prepend";
528 print TESTFILE "#include <$h>\n";
529 print TESTFILE "int main (void) { return $const != $value; }\n";
532 $res = runtest ($fnamebase, "Testing for value of constant $const",
533 "Constant \"$const\" has not the right value.", $res);
535 } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
538 # Remember that this name is allowed.
539 if ($type =~ /^struct *(.*)/) {
541 } elsif ($type =~ /^union *(.*)/) {
547 # Remember that this name is allowed.
550 # Generate a program to test for the availability of this constant.
551 open (TESTFILE, ">$fnamebase.c");
552 print TESTFILE "$prepend";
553 print TESTFILE "#include <$h>\n";
554 print TESTFILE "$type *a;\n";
557 compiletest ($fnamebase, "Testing for type $type",
558 "Type \"$type\" not available.", $missing, 0);
559 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
560 my($rettype) = "$2$3";
565 # Remember that this name is allowed.
568 # Generate a program to test for availability of this function.
569 open (TESTFILE, ">$fnamebase.c");
570 print TESTFILE "$prepend";
571 print TESTFILE "#include <$h>\n";
572 # print TESTFILE "#undef $fname\n";
573 print TESTFILE "$rettype (*(*foobarbaz) $args = $fname;\n";
576 $res = compiletest ($fnamebase, "Test availability of function $fname",
577 "Function \"$fname\" is not available.", $res, 0);
579 # Generate a program to test for the type of this function.
580 open (TESTFILE, ">$fnamebase.c");
581 print TESTFILE "$prepend";
582 print TESTFILE "#include <$h>\n";
583 # print TESTFILE "#undef $fname\n";
584 print TESTFILE "extern $rettype (*(*foobarbaz) $args;\n";
585 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
588 compiletest ($fnamebase, "Test for type of function $fname",
589 "Function \"$fname\" has incorrect type.", $res, 0);
590 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
591 my($rettype) = "$2$3";
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 "$rettype (*foobarbaz) $args = $fname;\n";
607 $res = compiletest ($fnamebase, "Test availability of function $fname",
608 "Function \"$fname\" is not available.", $res, 0);
610 # Generate a program to test for the type of this function.
611 open (TESTFILE, ">$fnamebase.c");
612 print TESTFILE "$prepend";
613 print TESTFILE "#include <$h>\n";
614 # print TESTFILE "#undef $fname\n";
615 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
616 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
619 compiletest ($fnamebase, "Test for type of function $fname",
620 "Function \"$fname\" has incorrect type.", $res, 0);
621 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
626 # Remember that this name is allowed.
629 # Generate a program to test for availability of this function.
630 open (TESTFILE, ">$fnamebase.c");
631 print TESTFILE "$prepend";
632 print TESTFILE "#include <$h>\n";
633 # print TESTFILE "#undef $fname\n";
634 print TESTFILE "$type *foobarbaz = &$vname;\n";
637 $res = compiletest ($fnamebase, "Test availability of variable $vname",
638 "Variable \"$vname\" is not available.", $res, 0);
640 # Generate a program to test for the type of this function.
641 open (TESTFILE, ">$fnamebase.c");
642 print TESTFILE "$prepend";
643 print TESTFILE "#include <$h>\n";
644 # print TESTFILE "#undef $fname\n";
645 print TESTFILE "extern $type $vname;\n";
648 compiletest ($fnamebase, "Test for type of variable $fname",
649 "Variable \"$vname\" has incorrect type.", $res, 0);
650 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
651 my($rettype) = "$2$3";
656 # Remember that this name is allowed.
659 # Generate a program to test for availability of this function.
660 open (TESTFILE, ">$fnamebase.c");
661 print TESTFILE "$prepend";
662 print TESTFILE "#include <$h>\n";
663 print TESTFILE "#ifndef $fname\n";
664 print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
665 print TESTFILE "#endif\n";
668 $res = compiletest ($fnamebase, "Test availability of function $fname",
669 "Function \"$fname\" is not available.", $res, 0);
671 # Generate a program to test for the type of this function.
672 open (TESTFILE, ">$fnamebase.c");
673 print TESTFILE "$prepend";
674 print TESTFILE "#include <$h>\n";
675 print TESTFILE "#ifndef $fname\n";
676 print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
677 print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
678 print TESTFILE "#endif\n";
681 compiletest ($fnamebase, "Test for type of function $fname",
682 "Function \"$fname\" has incorrect type.", $res, 0);
683 } elsif (/^macro-str *([^ ]*)\s*(\".*\")/) {
684 # The above regex doesn't handle a \" in a string.
689 # Remember that this name is allowed.
692 # Generate a program to test for availability of this macro.
693 open (TESTFILE, ">$fnamebase.c");
694 print TESTFILE "$prepend";
695 print TESTFILE "#include <$h>\n";
696 print TESTFILE "#ifndef $macro\n";
697 print TESTFILE "# error \"Macro $macro not defined\"\n";
698 print TESTFILE "#endif\n";
701 compiletest ($fnamebase, "Test availability of macro $macro",
702 "Macro \"$macro\" is not available.", $missing, 0);
704 # Generate a program to test for the value of this macro.
705 open (TESTFILE, ">$fnamebase.c");
706 print TESTFILE "$prepend";
707 print TESTFILE "#include <$h>\n";
708 # We can't include <string.h> here.
709 print TESTFILE "extern int (strcmp)(const char *, const char *);\n";
710 print TESTFILE "int main (void) { return strcmp ($macro, $string) != 0;}\n";
713 $res = runtest ($fnamebase, "Testing for value of macro $macro",
714 "Macro \"$macro\" has not the right value.", $res);
715 } elsif (/^macro *([^ ]*)/) {
718 # Remember that this name is allowed.
721 # Generate a program to test for availability of this macro.
722 open (TESTFILE, ">$fnamebase.c");
723 print TESTFILE "$prepend";
724 print TESTFILE "#include <$h>\n";
725 print TESTFILE "#ifndef $macro\n";
726 print TESTFILE "# error \"Macro $macro not defined\"\n";
727 print TESTFILE "#endif\n";
730 compiletest ($fnamebase, "Test availability of macro $macro",
731 "Macro \"$macro\" is not available.", $missing, 0);
732 } elsif (/^allow-header *(.*)/) {
734 if ($seenheader{$pattern} != 1) {
735 push @allowheader, $pattern;
736 $seenheader{$pattern} = 1;
739 } elsif (/^allow *(.*)/) {
741 push @allow, $pattern;
744 # printf ("line is `%s'\n", $_);
752 # Read the data files for the header files which are allowed to be included.
753 while ($#allowheader >= 0) {
754 my($ah) = pop @allowheader;
756 open (ALLOW, "$CC -E -D$dialect - < data/$ah-data |");
757 acontrol: while (<ALLOW>) {
758 next acontrol if (/^#/);
759 next acontrol if (/^[ ]*$/);
761 if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
763 } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
765 } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
767 } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
770 # Remember that this name is allowed.
771 if ($type =~ /^struct *(.*)/) {
773 } elsif ($type =~ /^union *(.*)/) {
778 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
780 } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
782 } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
784 } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
786 } elsif (/^macro *([^ ]*)/) {
788 } elsif (/^allow-header *(.*)/) {
789 if ($seenheader{$1} != 1) {
790 push @allowheader, $1;
793 } elsif (/^allow *(.*)/) {
800 # Now check the namespace.
801 printf (" Checking the namespace of \"%s\"... ", $h);
806 checknamespace ($h, $fnamebase, @allow);
812 printf "-" x 76 . "\n";
813 printf (" Total number of tests : %4d\n", $total);
815 printf (" Number of known failures: %4d (", $known);
816 $percent = ($known * 100) / $total;
817 if ($known > 0 && $percent < 1.0) {
820 printf ("%3d%%)\n", $percent);
823 printf (" Number of failed tests : %4d (", $errors);
824 $percent = ($errors * 100) / $total;
825 if ($errors > 0 && $percent < 1.0) {
828 printf ("%3d%%)\n", $percent);
831 printf (" Number of skipped tests : %4d (", $skipped);
832 $percent = ($skipped * 100) / $total;
833 if ($skipped > 0 && $percent < 1.0) {
836 printf ("%3d%%)\n", $percent);