4 $ENV{LC_ALL} = "C"; # avoid NLS nuisance
14 if (-e "CMakeLists.txt") { # launched from dart
18 open LOG,(">checkall.log") || die "Cannot open log file: $!";
20 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
21 print LOG "Build started on $hour:$min:$sec $mon/$mday/$year\n";
22 print LOG "Current svn version is: ".qx(svnversion)."\n\n";
23 open MAKE,("make 2>&1 |") || die "Cannot fork a make: $!";
29 my $str = "# The source don't compile! Go fix it before running make check #";
32 print LOG "\n$dashes\n$str\n$dashes\n\n";
33 print "\n$dashes\n$str\n$dashes\n\n";
38 open CHECK,("make -k check 2>&1 |") || die "Cannot fork a make check: $!";
43 if (/Entering directory .([^']*)'/) { #})){
45 $dir =~ s|$ENV{PWD}/||;
47 push @pass, "$dir/$1" if (/^PASS: (.*)$/);
48 push @xpass,"$dir/$1" if (/^XPASS: (.*)$/);
49 push @fail, "$dir/$1" if (/^FAIL: (.*)$/);
50 push @xfail,"$dir/$1" if (/^XFAIL: (.*)$/);
51 push @skip, "$dir/$1" if (/^SKIP: (.*)$/);
55 my $all = scalar @fail + scalar @xfail + scalar @pass + scalar @xpass + scalar @skip;
58 if (scalar @fail == 0) {
59 if (scalar @xfail == 0) {
60 $banner="All $all tests passed. Congratulation.";
62 $banner="All $all tests behaved as expected (".(scalar @xfail)." expected failures)";
64 } elsif (scalar @xpass == 0) {
65 $banner=(scalar @fail)." of $all tests failed";
67 $banner=(scalar @fail+scalar @xpass)." of $all tests did not behave as expected (".(scalar @xpass)." unexpected passes)";
69 $banner = "# $banner #";
72 print LOG "\n$dashes\n$banner\n$dashes\n\n";
73 print "\n$dashes\n$banner (full logs in checkall.log)\n$dashes\n\n";
76 print LOG "* ".(scalar @skip)." skipped tests:\n";
77 print "* ".(scalar @skip)." skipped tests:\n";
78 map {print " $_\n";print LOG " $_\n"} @skip;
81 print LOG "* ".(scalar @xpass)." unexpected pass:\n";
82 print "* ".(scalar @xpass)." unexpected pass:\n";
83 map {print " $_\n";print LOG " $_\n"} @xpass;
86 print LOG "* ".(scalar @xfail)." expected failures:\n";
87 print "* ".(scalar @xfail)." expected failures:\n";
88 map {print " $_\n";print LOG " $_\n"} @xfail;
91 print LOG "* ".(scalar @fail)." failed tests:\n";
92 print "* ".(scalar @fail)." failed tests:\n";
93 map {print " $_\n";print LOG " $_\n"} @fail;
96 exit scalar @fail == 0;