david_williams | 4a022dd | 2009-05-26 04:13:39 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <?php |
| 4 | |
| 5 | function endsWith( $str, $sub ) { |
| 6 | |
| 7 | return ( substr( $str, strlen( $str ) - strlen( $sub ) ) === $sub ); |
| 8 | } |
| 9 | |
| 10 | $parts = explode("/", getcwd()); |
| 11 | $parts2 = explode("-", $parts[count($parts) - 1]); |
| 12 | $buildName = $parts2[1]; |
| 13 | |
| 14 | echo "<title>Test Console Output for $buildName </title>"; |
| 15 | ?> |
| 16 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 17 | <link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" type="text/css"> |
| 18 | <title>Console Logs from Running JUnit Plug-in Tests</title></head> |
| 19 | <body> |
| 20 | |
| 21 | <p><b><font face="Verdana" size="+3">Test Console Output</font></b> </p> |
| 22 | |
| 23 | <table border=0 cellspacing=5 cellpadding=2 width="100%" > |
| 24 | <tr> |
| 25 | <td align=LEFT valign=TOP colspan="3" bgcolor="#0080C0"><b><font color="#FFFFFF" face="Arial,Helvetica">Console |
| 26 | output from running JUnit plugin tests for |
| 27 | <?php echo "$buildName"; ?> |
| 28 | </font></b></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <table border="0"> |
| 32 | |
| 33 | <?php |
| 34 | $hasNotes = false; |
| 35 | $aDirectory = dir("."); |
| 36 | $index = 0; |
| 37 | while ($anEntry = $aDirectory->read()) { |
| 38 | if ($anEntry != "." && $anEntry != ".." && !endsWith(__FILE__, $anEntry)) { |
| 39 | $entries[$index] = $anEntry; |
| 40 | $index++; |
| 41 | } |
| 42 | } |
| 43 | aDirectory.closedir(); |
| 44 | |
| 45 | |
| 46 | sort($entries); |
| 47 | |
| 48 | for ($i = 0; $i < $index; $i++) { |
| 49 | $anEntry = $entries[$i]; |
| 50 | $logsize = filesize("$anEntry"); |
| 51 | |
| 52 | |
| 53 | $level = 0; |
| 54 | if ($logsize > 20000) { |
| 55 | $level = 2; |
| 56 | } |
| 57 | else if ($logsize > 2000) { |
| 58 | $level = 1; |
| 59 | } |
| 60 | |
| 61 | if ($level == 0) { |
| 62 | $line = "<td><a href=\"$anEntry\">$anEntry</a> ($logsize bytes)</td>"; |
| 63 | } |
| 64 | else if ($level == 1) { |
| 65 | $line = "<td><em><a href=\"$anEntry\">$anEntry</a> ($logsize bytes)</em></td>"; |
| 66 | } else if ($level == 2) { |
| 67 | $line = "<td><strong><a href=\"$anEntry\">$anEntry</a> ($logsize bytes)</strong></td>"; |
| 68 | } |
| 69 | |
| 70 | |
| 71 | echo "<tr>"; |
| 72 | echo "$line"; |
| 73 | echo "</tr>"; |
| 74 | $hasNotes = true; |
| 75 | } |
| 76 | |
| 77 | if (!$hasNotes) { |
| 78 | echo "<br>There are no test logs for this build."; |
| 79 | } |
| 80 | ?> |
| 81 | |
| 82 | </table> |
| 83 | </body> |
| 84 | </html> |