From: deal Date: Fri, 19 Apr 2002 08:26:25 +0000 (+0000) Subject: Check in report generation for nightly build tests. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=813c130914d15f614924402761bfb29f8575f00a;p=dealii-svn.git Check in report generation for nightly build tests. git-svn-id: https://svn.dealii.org/trunk@5682 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/scripts/report-build-tests.pl b/deal.II/common/scripts/report-build-tests.pl new file mode 100644 index 0000000000..cdfdc9f8fe --- /dev/null +++ b/deal.II/common/scripts/report-build-tests.pl @@ -0,0 +1,273 @@ +############################################################ +# first read in list of test results +while (<>) +{ + if (/([\d-]+) ([\d:]*) ([^\s]+) (.*)/) + { + $date = $1; + $time = $2; + $name = $3; + $result = $4; + + $total_testcases{$date}++; + + if ($result eq '+') { + $results{$date}{$name} + = ''; + } + else + { + # TODO: the result is actually the name of a file with logs + # in it. Use that and cross-link to that file so that + # one can see what has gone wrong + $results{$date}{$name} + = ''; + $failed_testcases{$date}++; + }; + } +} + + +# generate a list of test case names and assign a number +# in alphabetical order to them +foreach $date (keys %results) { + foreach $name (keys %{ $results{$date} }) { + $testcase{$name} = 0; + } +} +$next_index = 1; +foreach $name (sort keys %testcase) { + $testcase{$name} = $next_index++; +} + + + + +########################################################### +# then generate output for the three frames and the panels for +# the different months + +# first get last active month for the default panel +foreach $date (sort {$b cmp $a} keys %results) +{ + $date =~ /(\d+)-(\d+)-\d+/; + $default_year = $1; + $default_month = $2; + last; +} + + + +open REPORT_FILE, ">builds_report.html"; + +print REPORT_FILE <<"EOT" + + + + + + +Build tests + + + + + + + + +EOT + ; + + +open HEAD_FILE, ">builds_report_head.html"; +print HEAD_FILE << 'EOT' + + + + + + +Build tests head + + +

Build tests

+

+Select results for one of the following months:
+EOT + ; + +open NAMES_FILE, ">builds_report_names.html"; +print NAMES_FILE << 'EOT' + + + + + + +Build tests head + + +EOT + ; + + + + +# finally output a table of results +$number_of_present_month = 0; +foreach $date (sort {$b cmp $a} keys %results) +{ + # if the month has changed (or if this is the first month we deal + # with), open a new file and write the file and table heads. also write + # a note into the head panel + # + # if this is not the first month, then put in a break into the table + # to avoid overly long tables which browsers take infinitely + # long to render + $date =~ /(\d+)-(\d+)-\d+/; + $this_year = $1; + $this_month = $2; + if ($this_month != $old_month) { + $number_of_present_month++; + + if (defined $old_month) { + print TABLE_FILE "\n"; + print TABLE_FILE "\n\n"; + close TABLE_FILE; + } + $file = "builds_report_${this_year}_${this_month}.html"; + use Cwd; + $dir = cwd(); + open TABLE_FILE, ">$file" or die "Can't open output file $file in $dir\n"; + +print TABLE_FILE <<"EOT" + + + + + + +Build tests for $year/$date + + + +

Results for $this_year/$this_month

+ +"; + + foreach $name (sort keys %testcase) + { + $_ = $results{$date}{$name}; + print TABLE_FILE ''; + } + print TABLE_FILE "\n"; + + # store old month name for the next iteration of the loop + $old_month = $this_month; +} + +print TABLE_FILE << 'EOT' +
Date Fail +EOT + ; + + for ($i=1;$i<$next_index;$i++) + { + printf TABLE_FILE "%02d", $i; + } + print TABLE_FILE "\n"; + + + # only write up to 8 months in a row into the month + # listing. if more, insert a linebreak + if (($number_of_present_month % 8 == 0) && + ($number_of_present_month != 0)) + { + print HEAD_FILE "
\n"; + } + # now write link to month file + print HEAD_FILE ""; + print HEAD_FILE "${this_year}/${this_month}  \n"; + } + + print TABLE_FILE "
$date "; + + $failed_testcases{$date} = 0 if (!defined $failed_testcases{$date}); + + print TABLE_FILE "" if ($failed_testcases{$date} == 0); + print TABLE_FILE "" if ($failed_testcases{$date} != 0); + + print TABLE_FILE "$failed_testcases{$date}/$total_testcases{$date} ', $_, '
+ + +EOT + ; + + +# now print the names of the tests, in two blocks of 3 columns each. have an +# empty column of specified width in between, to separate the blocks +print NAMES_FILE << 'EOT' +

Names of build tests

+ + + + + + + + + + +EOT + ; + + +# output the list of test cases. always put two in a row +$col = 0; +foreach $name (sort keys %testcase) { + if ($col == 0) { + print NAMES_FILE "\n"; + } + + $test_number = $testcase{$name}; + $test_system = $name; + $test_system =~ s/\+.*//; + $test_compiler = $name; + $test_compiler =~ s/.*\+//g; + $compiler_table{"gcc295"} = "gcc 2.95"; + $compiler_table{"gcc30"} = "gcc 3.0"; + if (defined $compiler_table{$test_compiler} ) { + $test_compiler = $compiler_table{$test_compiler}; + } + + print NAMES_FILE " ", + " ", + " \n"; + + # next column. if at end, wrap around + $col = ($col+1)%2; + + # if at end of row, then end it, otherwise insert the empty column + if ($col == 0) { + print NAMES_FILE "\n"; + } else { + print NAMES_FILE ""; + } +} + +print NAMES_FILE <<'EOT' +
Test number System name Compiler ------------------ Test number System name Compiler
${test_number}${test_system}${test_compiler}
+ + +EOT + ; + + + +print HEAD_FILE << 'EOT' +

+ + +EOT + ;