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";
24 print LOG "\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n";
25 print LOG "XXX Include config.log since it contains valuable information XXX\n";
26 print LOG "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n";
27 open CFG,"<config.log" || die "Cannot open config.log: $!*";
33 print LOG "\nXXXXXXXXXXXXXXXX\n";
34 print LOG "XXX Run make XXX\n";
35 print LOG "XXXXXXXXXXXXXXXX\n";
36 open MAKE,("make 2>&1 |") || die "Cannot fork a make: $!";
42 my $str = "# The source don't compile! Go fix it before running make check #";
45 print LOG "\n$dashes\n$str\n$dashes\n\n";
46 print "\n$dashes\n$str\n$dashes\n\n";
51 print LOG "\nXXXXXXXXXXXXXXXXXXXXXX\n";
52 print LOG "XXX Run make check XXX\n";
53 print LOG "XXXXXXXXXXXXXXXXXXXXXX\n";
54 open CHECK,("make -k check 2>&1 |") || die "Cannot fork a make check: $!";
59 if (/Entering directory .([^']*)'/) { #})){
61 $dir =~ s|$ENV{PWD}/||;
63 push @pass, "$dir/$1" if (/^PASS: (.*)$/);
64 push @xpass,"$dir/$1" if (/^XPASS: (.*)$/);
65 push @fail, "$dir/$1" if (/^FAIL: (.*)$/);
66 push @xfail,"$dir/$1" if (/^XFAIL: (.*)$/);
67 push @skip, "$dir/$1" if (/^SKIP: (.*)$/);
71 my $all = scalar @fail + scalar @xfail + scalar @pass + scalar @xpass + scalar @skip;
74 if (scalar @fail == 0) {
75 if (scalar @xfail == 0) {
76 $banner="All $all tests passed. Congratulation.";
78 $banner="All $all tests behaved as expected (".(scalar @xfail)." expected failures)";
80 } elsif (scalar @xpass == 0) {
81 $banner=(scalar @fail)." of $all tests failed";
83 $banner=(scalar @fail+scalar @xpass)." of $all tests did not behave as expected (".(scalar @xpass)." unexpected passes)";
85 $banner = "# $banner #";
88 print LOG "\n$dashes\n$banner\n$dashes\n\n";
89 print "\n$dashes\n$banner (full logs in checkall.log)\n$dashes\n\n";
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;