-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest_details.php
123 lines (103 loc) · 2.39 KB
/
test_details.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
require_once("../inc/db.inc");
require_once("../inc/util.inc");
$server = 0;
if (get_int("server", true)) {
$server = 1;
}
require_once("test_util.inc");
db_init();
$version = BoincDb::escape_string(get_str("version"),true);
lookup_version($version);
function show_status($counts, $url) {
$colors[0] = "00ff00.gif";
$colors[1] = "ffff00.gif";
$colors[2] = "ff0000.gif";
echo "
<table border=1>
";
for ($i=0; $i<3; $i++) {
if ($counts[$i]) {
$w = $counts[$i]*20;
echo "
<tr>
<td><a href=$url&status=$i><img src=$colors[$i] width=$w height=12></a>$counts[$i]</td>
</tr>
";
} else {
echo "<tr><td><br></td></tr>\n";
}
}
echo "
</table>
";
}
page_head("Test status of version $version");
$n = array();
$n[0] = 0;
$n[1] = 0;
$n[2] = 0;
$n[3] = 0;
$tr = array();
$query = "select * from test_report where version='$version'";
$result = _mysql_query($query);
if (!$result) {
echo _mysql_error();
error_page("db error");
}
while ($r = _mysql_fetch_object($result)) {
array_push($tr, $r);
$n[$r->status]++;
}
_mysql_free_result($result);
start_table();
row1("Overall status");
echo "<tr><td>\n";
show_status($n, "test_list.php?version=$version");
$fl = fraction_left(lookup_version($version));
$pd = number_format(100*(1-$fl), 0);
echo "
<br>
$pd% of target testing has been done.
</td></tr>
";
end_table();
start_table();
row1("Platforms");
$v = lookup_version($version);
$platforms = $v[2];
foreach ($platforms as $p) {
$n[0] = 0;
$n[1] = 0;
$n[2] = 0;
for ($j=0; $j<count($tr); $j++) {
$r = $tr[$j];
if ($r->platform != $p[0]) continue;
$n[$r->status]++;
}
row1($p[1]);
echo "<tr><td>\n";
show_status($n, "test_list.php?version=$version&platform=$p[0]");
echo "</td></tr>\n";
}
end_table();
start_table();
row1("TEST GROUPS");
$test_groups = $v[1];
for ($i=0; $i<count($test_groups); $i++) {
$tg = $test_groups[$i];
$n[0] = 0;
$n[1] = 0;
$n[2] = 0;
for ($j=0; $j<count($tr); $j++) {
$r = $tr[$j];
if ($r->test_group != $tg[0]) continue;
$n[$r->status]++;
}
row1($tg[1]);
echo "<tr><td>\n";
show_status($n, "test_list.php?version=$version&test_group=$tg[0]");
echo "</td></tr>\n";
}
end_table();
?>