4 $ENV{LC_ALL} = "C"; # avoid NLS nuisance
14 open LOG,(">checkall.log") || die "Cannot open log file: $!";
16 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
17 print LOG "Build started on $hour:$min:$sec $mon/$mday/$year\n\n";
18 open MAKE,("make 2>&1 |") || die "Cannot fork a make: $!";
24 my $str = "# The source don't compile! Go fix it before running make check #";
27 print LOG "\n$dashes\n$str\n$dashes\n\n";
28 print "\n$dashes\n$str\n$dashes\n\n";
33 open CHECK,("make -k check 2>&1 |") || die "Cannot fork a make check: $!";
38 if (/Entering directory .([^']*)'/) { #})){
40 $dir =~ s|$ENV{PWD}/||;
42 push @pass, "$dir/$1" if (/^PASS: (.*)$/);
43 push @xpass,"$dir/$1" if (/^XPASS: (.*)$/);
44 push @fail, "$dir/$1" if (/^FAIL: (.*)$/);
45 push @xfail,"$dir/$1" if (/^XFAIL: (.*)$/);
46 push @skip, "$dir/$1" if (/^SKIP: (.*)$/);
50 my $all = scalar @fail + scalar @xfail + scalar @pass + scalar @xpass + scalar @skip;
53 if (scalar @fail == 0) {
54 if (scalar @xfail == 0) {
55 $banner="All $all tests passed. Congratulation.";
57 $banner="All $all tests behaved as expected (".(scalar @xfail)." expected failures)";
59 } elsif (scalar @xpass == 0) {
60 $banner=(scalar @fail)." of $all tests failed";
62 $banner=(scalar @fail+scalar @xpass)." of $all tests did not behave as expected (".(scalar @xpass)." unexpected passes)";
64 $banner = "# $banner #";
67 print LOG "\n$dashes\n$banner\n$dashes\n\n";
68 print "\n$dashes\n$banner (full logs in checkall.log)\n$dashes\n\n";
71 print LOG "* ".(scalar @skip)." skipped tests:\n";
72 print "* ".(scalar @skip)." skipped tests:\n";
73 map {print " $_\n";print LOG " $_\n"} @skip;
76 print LOG "* ".(scalar @xpass)." unexpected pass:\n";
77 print "* ".(scalar @xpass)." unexpected pass:\n";
78 map {print " $_\n";print LOG " $_\n"} @xpass;
81 print LOG "* ".(scalar @xfail)." expected failures:\n";
82 print "* ".(scalar @xfail)." expected failures:\n";
83 map {print " $_\n";print LOG " $_\n"} @xfail;
86 print LOG "* ".(scalar @fail)." failed tests:\n";
87 print "* ".(scalar @fail)." failed tests:\n";
88 map {print " $_\n";print LOG " $_\n"} @fail;
91 exit scalar @fail == 0;