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";
18 print LOG "Current svn version is: ".qx(svnversion)."\n\n";
20 print LOG "\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n";
21 print LOG "XXX Include config.log since it contains valuable information XXX\n";
22 print LOG "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n";
23 open CFG,"<config.log" || die "Cannot open config.log: $!*";
29 print LOG "\nXXXXXXXXXXXXXXXX\n";
30 print LOG "XXX Run make XXX\n";
31 print LOG "XXXXXXXXXXXXXXXX\n";
32 open MAKE,("make 2>&1 |") || die "Cannot fork a make: $!";
38 my $str = "# The source don't compile! Go fix it before running make check #";
41 print LOG "\n$dashes\n$str\n$dashes\n\n";
42 print "\n$dashes\n$str\n$dashes\n\n";
47 print LOG "\nXXXXXXXXXXXXXXXXXXXXXX\n";
48 print LOG "XXX Run make check XXX\n";
49 print LOG "XXXXXXXXXXXXXXXXXXXXXX\n";
50 open CHECK,("make -k check 2>&1 |") || die "Cannot fork a make check: $!";
55 if (/Entering directory .([^']*)'/) { #})){
57 $dir =~ s|$ENV{PWD}/||;
59 push @pass, "$dir/$1" if (/^PASS: (.*)$/);
60 push @xpass,"$dir/$1" if (/^XPASS: (.*)$/);
61 push @fail, "$dir/$1" if (/^FAIL: (.*)$/);
62 push @xfail,"$dir/$1" if (/^XFAIL: (.*)$/);
63 push @skip, "$dir/$1" if (/^SKIP: (.*)$/);
67 my $all = scalar @fail + scalar @xfail + scalar @pass + scalar @xpass + scalar @skip;
70 if (scalar @fail == 0) {
71 if (scalar @xfail == 0) {
72 $banner="All $all tests passed. Congratulation.";
74 $banner="All $all tests behaved as expected (".(scalar @xfail)." expected failures)";
76 } elsif (scalar @xpass == 0) {
77 $banner=(scalar @fail)." of $all tests failed";
79 $banner=(scalar @fail+scalar @xpass)." of $all tests did not behave as expected (".(scalar @xpass)." unexpected passes)";
81 $banner = "# $banner #";
84 print LOG "\n$dashes\n$banner\n$dashes\n\n";
85 print "\n$dashes\n$banner (full logs in checkall.log)\n$dashes\n\n";
88 print LOG "* ".(scalar @pass)." passed tests:\n";
89 map {print LOG " $_\n"} @pass;
92 print LOG "* ".(scalar @skip)." skipped tests:\n";
93 print "* ".(scalar @skip)." skipped tests:\n";
94 map {print " $_\n";print LOG " $_\n"} @skip;
97 print LOG "* ".(scalar @xpass)." unexpected pass:\n";
98 print "* ".(scalar @xpass)." unexpected pass:\n";
99 map {print " $_\n";print LOG " $_\n"} @xpass;
102 print LOG "* ".(scalar @xfail)." expected failures:\n";
103 print "* ".(scalar @xfail)." expected failures:\n";
104 map {print " $_\n";print LOG " $_\n"} @xfail;
107 print LOG "* ".(scalar @fail)." failed tests:\n";
108 print "* ".(scalar @fail)." failed tests:\n";
109 map {print " $_\n";print LOG " $_\n"} @fail;
112 exit scalar @fail == 0;