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\n";
22 open MAKE,("make 2>&1 |") || die "Cannot fork a make: $!";
28 my $str = "# The source don't compile! Go fix it before running make check #";
31 print LOG "\n$dashes\n$str\n$dashes\n\n";
32 print "\n$dashes\n$str\n$dashes\n\n";
37 open CHECK,("make -k check 2>&1 |") || die "Cannot fork a make check: $!";
42 if (/Entering directory .([^']*)'/) { #})){
44 $dir =~ s|$ENV{PWD}/||;
46 push @pass, "$dir/$1" if (/^PASS: (.*)$/);
47 push @xpass,"$dir/$1" if (/^XPASS: (.*)$/);
48 push @fail, "$dir/$1" if (/^FAIL: (.*)$/);
49 push @xfail,"$dir/$1" if (/^XFAIL: (.*)$/);
50 push @skip, "$dir/$1" if (/^SKIP: (.*)$/);
54 my $all = scalar @fail + scalar @xfail + scalar @pass + scalar @xpass + scalar @skip;
57 if (scalar @fail == 0) {
58 if (scalar @xfail == 0) {
59 $banner="All $all tests passed. Congratulation.";
61 $banner="All $all tests behaved as expected (".(scalar @xfail)." expected failures)";
63 } elsif (scalar @xpass == 0) {
64 $banner=(scalar @fail)." of $all tests failed";
66 $banner=(scalar @fail+scalar @xpass)." of $all tests did not behave as expected (".(scalar @xpass)." unexpected passes)";
68 $banner = "# $banner #";
71 print LOG "\n$dashes\n$banner\n$dashes\n\n";
72 print "\n$dashes\n$banner (full logs in checkall.log)\n$dashes\n\n";
75 print LOG "* ".(scalar @skip)." skipped tests:\n";
76 print "* ".(scalar @skip)." skipped tests:\n";
77 map {print " $_\n";print LOG " $_\n"} @skip;
80 print LOG "* ".(scalar @xpass)." unexpected pass:\n";
81 print "* ".(scalar @xpass)." unexpected pass:\n";
82 map {print " $_\n";print LOG " $_\n"} @xpass;
85 print LOG "* ".(scalar @xfail)." expected failures:\n";
86 print "* ".(scalar @xfail)." expected failures:\n";
87 map {print " $_\n";print LOG " $_\n"} @xfail;
90 print LOG "* ".(scalar @fail)." failed tests:\n";
91 print "* ".(scalar @fail)." failed tests:\n";
92 map {print " $_\n";print LOG " $_\n"} @fail;
95 exit scalar @fail == 0;