blob: 2ee3c362da6a369639bff236cb07da79b65d79e8 [file] [log] [blame]
david_williams88cbf012009-01-12 21:53:05 +00001<html>
2<head>
3<?php
4$parts = explode("/", getcwd());
5$parts2 = explode("-", $parts[count($parts) - 1]);
6$buildName = $parts2[1];
7
8echo "<title>Test Console Output for $buildName </title>";
9?>
10<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
11<link rel="stylesheet" href="http://dev.eclipse.org/default_style.css"
12 type="text/css">
13<title>Console Logs from Running JUnit Plug-in Tests</title>
14</head>
15<body>
16
17<p><b><font face="Verdana" size="+3">Test Console Output</font></b></p>
18
19<table border=0 cellspacing=5 cellpadding=2 width="100%">
20 <tr>
21 <td align=LEFT valign=TOP colspan="3" bgcolor="#0080C0"><b><font
22 color="#FFFFFF" face="Arial,Helvetica">Console output from running
23 JUnit plugin tests for <?php echo "$buildName"; ?> </font></b></td>
24 </tr>
25</table>
26<table border="0">
27
28<?php
29$rootDir = "testResults/consolelogs";
30$hasNotes = false;
31$aDirectory = dir($rootDir);
32$index = 0;
33$dirindex = 0;
34while ($anEntry = $aDirectory->read()) {
david_williamsdb9eed92009-11-18 20:03:49 +000035 if ($anEntry != "." && $anEntry != "..") {
36 if (is_file("$rootDir/$anEntry")) {
37 $entries[$index] = $anEntry;
38 $index++;
39 } else if (is_dir("$rootDir/$anEntry")) {
40 $direntries[$dirindex] = $anEntry;
41 $dirindex++;
42 }
43 }
david_williams88cbf012009-01-12 21:53:05 +000044}
45$aDirectory->close();
46
47
48sort($entries);
49sort($direntries);
50
51for ($i = 0; $i < $dirindex; $i++) {
david_williamsdb9eed92009-11-18 20:03:49 +000052 $anEntry = $direntries[$i];
53 $line = "<td><a href=\"testResults/consolelogs/$anEntry/logIndex.php\">$anEntry</a></td>";
54 echo "<tr>";
55 echo "$line";
56 echo "</tr>";
david_williams88cbf012009-01-12 21:53:05 +000057}
58for ($i = 0; $i < $index; $i++) {
david_williamsdb9eed92009-11-18 20:03:49 +000059 $anEntry = $entries[$i];
60 $logsize = filesize("testResults/consolelogs/$anEntry");
david_williams88cbf012009-01-12 21:53:05 +000061
62
david_williamsdb9eed92009-11-18 20:03:49 +000063 $level = 0;
64 if ($logsize > 20000) {
65 $level = 2;
66 }
67 else if ($logsize > 2000) {
68 $level = 1;
69 }
david_williams88cbf012009-01-12 21:53:05 +000070
david_williamsdb9eed92009-11-18 20:03:49 +000071 if ($level == 0) {
72 $line = "<td><a href=\"testResults/consolelogs/$anEntry\">$anEntry</a> ($logsize bytes)</td>";
73 }
74 else if ($level == 1) {
75 $line = "<td><em><a href=\"testResults/consolelogs/$anEntry\">$anEntry</a> ($logsize bytes)</em></td>";
76 } else if ($level == 2) {
77 $line = "<td><strong><a href=\"testResults/consolelogs/$anEntry\">$anEntry</a> ($logsize bytes)</strong></td>";
78 }
david_williams88cbf012009-01-12 21:53:05 +000079
80
david_williamsdb9eed92009-11-18 20:03:49 +000081 echo "<tr>";
82 echo "$line";
83 echo "</tr>";
84 $hasNotes = true;
david_williams88cbf012009-01-12 21:53:05 +000085}
86
87if (!$hasNotes) {
david_williamsdb9eed92009-11-18 20:03:49 +000088 echo "<br>There are no test logs for this build.";
david_williams88cbf012009-01-12 21:53:05 +000089}
90?>
91
92</table>
93</body>
94</html>