make-cputime-page.pl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/perl -w
  2. # Copyright 2004 Aleksey Gurtovoy
  3. # Copyright 2001 Jens Maurer
  4. # Distributed under the Boost Software License, Version 1.0.
  5. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  6. use strict;
  7. my $filename;
  8. my $compiler;
  9. my $time = 0;
  10. my $ct = 0;
  11. my $first = 2;
  12. print "<html>\n<head>\n<title>\nCompile Times</title>\n</head>\n\n";
  13. print "<body bgcolor=\"#ffffff\" text=\"#000000\">\n";
  14. print "<img border=\"0\" src=\"boost.png\" width=\"277\" height=\"86\">";
  15. print "<p>\n";
  16. print "Compile time for each successful regression test in seconds.\n";
  17. print "<p>\n";
  18. print "<table border=\"1\">\n";
  19. print "<tr><td>Test</td>\n";
  20. while(<>) {
  21. if(/^\*\*\* (.*) \*\*\*$/) {
  22. $filename = $1;
  23. $first = ($first == 0 ? 0 : $first-1);
  24. if($first == 0) {
  25. print "</tr>\n\n<tr align=right>\n<td align=left><a href=\"http://www.boost.org/$filename\">$filename</a></td>\n";
  26. }
  27. } elsif(/^\*\* (.*)/) {
  28. $compiler = $1;
  29. if($first) {
  30. print "<td>$compiler</td>\n";
  31. } else {
  32. $ct = 1;
  33. }
  34. } elsif($ct && /^CPU time: ([.0-9]*) s user, ([.0-9]*) s system/) {
  35. $time = $1 + $2;
  36. } elsif($ct && /^Pass$/) {
  37. printf "<td>%.02f</td>\n", $time;
  38. $ct = 0;
  39. } elsif($ct && /^Fail$/) {
  40. print "<td>-</td>\n";
  41. $ct = 0;
  42. }
  43. }
  44. print "</tr>\n";
  45. print "</table>\n";
  46. print "</body>\n</html>\n";
粤ICP备19079148号