2 ////////////////////////////////////////////////////////////////////////////////
4 // File: AverageRunTime.php
6 // Description: Produce a report of the average run time
7 // Author: Andrew@ClearSCM.com
8 // Created: Mon Apr 28 15:20:06 MST 2008
12 // (c) Copyright 2008, General Dynamics, all rights reserved.
14 // All rights reserved except as subject to DFARS 252.227-7014 of contract
15 // number CP02H8901N issued under prime contract N00039-04-C-2009.
17 // Warning: This document contains technical data whose export is restricted
18 // by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) or the
19 // Export Administration Act of 1979, as amended, Title, 50, U.S.C., App. 2401
20 // et seq. Violations of these export laws are subject to severe criminal
21 // penalties. Disseminate in accordance with provisions of DoD Directive
24 ////////////////////////////////////////////////////////////////////////////////
25 $script = basename ($_SERVER["PHP_SELF"]);
26 include_once "$_SERVER[DOCUMENT_ROOT]/php/Utils.php";
27 include_once "$_SERVER[DOCUMENT_ROOT]/php/RantestDB.php";
29 $build = $_REQUEST["build"];
30 $level = $_REQUEST["level"];
31 $DUT = $_REQUEST["DUT"];
32 $test = $_REQUEST["test"];
34 if (!isset ($test) or ($test == "")) {
38 // Replace "*"'s with "%"'s
39 $build = preg_replace ("/\*/", "%", $build);
40 $level = preg_replace ("/\*/", "%", $level);
41 $DUT = preg_replace ("/\*/", "%", $DUT);
42 $test = preg_replace ("/\*/", "%", $test);
48 $testcase = "<All Tests>";
50 $testcase = "${build}_${level}_${DUT}_${test}";
53 $testname2 = preg_replace ("/%/", "*", $testcase);
55 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
56 "http://www.w3.org/TR/html4/strict.dtd">
59 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
60 <link rel="stylesheet" type="text/css" media="screen" href="/css/Testing.css">
61 <link rel="stylesheet" type="text/css" media="screen" href="/css/Tables.css">
62 <title>Test history for <?php print ($testcase == "<All Tests>") ? "All Tests" : $testname2;?></title>
66 <h1 align="center">Test history for <?php print ($testcase == "<All Tests>") ? "All Tests" : $testname2;?></h1>
69 if ($testcase == "<All Tests>") {
71 <table align=center width=40%>
78 <th class=right>Total</th>
90 <th class=right>Result</th>
103 if ($testcase == "<All Tests>") {
106 test.name as testname,
108 status.name as status
114 test.id = testruns.tcid and
115 testruns.statusid = status.id
121 $result = mysql_query ($statement)
122 or DBError ("Unable to execute query: ", $statement);
124 $lastTestcase = "unknown";
129 while ($row = mysql_fetch_array ($result)) {
130 $logs = logs ($row["eastlogs"]);
132 if ($row["testcase"] == $lastTestcase) {
133 if ($row["status"] == "Success") {
134 $passed = $row["count"];
136 $failed = $row["count"];
139 $row_color = ($row_nbr++ % 2 == 0) ? " class=other" : "";
141 $total = $passed + $failed;
145 <td align=center>$row_nbr</td>
146 <td><a href="$script?testcase=$row[testname]">$row[testname]</a></td>
147 <td align=right>$passed</td>
148 <td align=right>$failed</td>
149 <td align=right>$total</td>
152 $lastTestcase = "unknown";
157 $lastTestcase = $row["testcase"];
159 if ($row["status"] == "Success") {
160 $passed = $row["count"];
162 $failed = $row["count"];
169 testruns.runid as runid,
170 testrun.start as start,
172 test.name as testname,
173 status.name as status,
174 testruns.eastlogs as eastlogs
181 test.name like "$testcase" and
182 test.id = testruns.tcid and
183 testrun.id = testruns.runid and
184 testruns.statusid = status.id
190 $result = mysql_query ($statement)
191 or DBError ("Unable to execute query: ", $statement);
193 while ($row = mysql_fetch_array ($result)) {
194 $class = SetRowColor ($row["status"]);
195 $status = colorResult ($row["status"]);
196 $date = YMD2MDY (substr ($row["start"], 0, 10));
199 $logs = logs ($row["eastlogs"]);
203 <td align=center>$row_nbr</td>
204 <td><a href="/rantest.php?testName=$row[testname]&runID=$row[runid]&date=$date">$row[testname]</a></td>
205 <td align=center>$row[start]</td>
206 <td align=center>$row[end]</td>