\n";
echo "";
echo "| ";
echo "Date added";
echo " | ";
echo "";
echo "CVS checkout time";
print " \n";
echo " | ";
echo "";
echo "Configure time cpu";
print " \n";
echo " | ";
echo "";
echo "Configure time wall";
print " \n";
echo " | ";
echo "";
echo "Build time cpu";
print " \n";
echo " | ";
echo "";
echo "Build time wall";
print " \n";
echo " | ";
echo "";
echo "Dejagnu time cpu";
print " \n";
echo " | ";
echo "";
echo "Dejagnu time wall";
print " \n";
echo " | ";
echo "";
echo "# of expected test passes";
print " \n";
echo " | ";
echo "";
echo "# of unexpected test failures";
print " \n";
echo " | ";
echo "";
echo "# of expected test failures";
print " \n";
echo " | ";
echo "";
echo "# of warnings";
echo " | ";
echo "";
echo " | ";
echo "
";
$result = getNightsResource($machine);
$line=1;
$row = mysql_fetch_array($result);
$x=0;
while($x<10 && $prev_row = mysql_fetch_array($result)){
$warnings ="";
if(strcmp($row['warnings'],"")!=0){
$warnings=$row['warnings'];
}
$num_warnings = preg_match_all('/warning/', $warnings, $match);
if(strpos($row['buildstatus'],"OK")===FALSE){
print "\t\n";
$build_ok=0;
}
else if($line % 2 ==0){
print "\t
\n";
$build_ok=1;
}
else{
print "\t
\n";
$build_ok=1;
}
$line++;
#this test is to test whether the test that precedes this failed,
#thus the test would have bogus data and we shouldnt color based on its
#results
if(strpos($prev_row['buildstatus'],"OK")===false){
$prev_build_ok=0;
}
else{
$prev_build_ok=1;
}
/*~~~~~~~~~~~~ Date of test ~~~~~~~~~~~~*/
echo "| ";
$date = preg_replace("/\s\d\d:\d\d:\d\d/","",$row['added']);
echo "$date";
echo " | ";
/*~~~~~~~~~~~~ Get CVS Wall Time ~~~~~~~~~~~~*/
echo "";
echo $row['getcvstime_wall'];
echo " | ";
/*~~~~~~~~~~~~ Configure Time CPU ~~~~~~~~~~~~*/
if($prev_row['configuretime_cpu']!=0 && $build_ok && $prev_build_ok){
$delta = round(( ($prev_row['configuretime_cpu'] - $row['configuretime_cpu']) / $prev_row['configuretime_cpu'] ) * 100,2);
if ($delta > 20){
print "{$row['configuretime_cpu']} | ";
}
else if ($delta < -20){
print "{$row['configuretime_cpu']} | ";
}
else{
print "{$row['configuretime_cpu']} | ";
}
}
else{
print "{$row['configuretime_cpu']} | ";
}
/*~~~~~~~~~~~~ Configure Time Wall ~~~~~~~~~~~~*/
echo "";
echo $row['configuretime_wall'];
echo " | ";
/*~~~~~~~~~~~~ Build Time CPU ~~~~~~~~~~~~*/
if($prev_row['buildtime_cpu']!=0 && $build_ok && $prev_build_ok){
$delta = round(( ($prev_row['buildtime_cpu'] - $row['buildtime_cpu']) / $prev_row['buildtime_cpu'] ) * 100,2);
if ($delta > 10){
print "{$row['buildtime_cpu']} | ";
}
else if ($delta < -10){
print "{$row['buildtime_cpu']} | ";
}
else{
print "{$row['buildtime_cpu']} | ";
}
}
else{
print "{$row['buildtime_cpu']} | ";
}
/*~~~~~~~~~~~~ Build Time Wall ~~~~~~~~~~~~*/
echo "";
echo $row['buildtime_wall'];
echo " | ";
/*~~~~~~~~~~~~ Dejagnu Time CPU ~~~~~~~~~~~~*/
if($prev_row['dejagnutime_cpu']!=0 && $build_ok && $prev_build_ok){
$delta = round( ( ($prev_row['dejagnutime_cpu'] - $row['dejagnutime_cpu']) / $prev_row['dejagnutime_cpu'] ) * 100,2);
if ($delta > 10){
print "{$row['dejagnutime_cpu']} | ";
}
else if ($delta < -10){
print "{$row['dejagnutime_cpu']} | ";
}
else{
print "{$row['dejagnutime_cpu']} | ";
}
}
else{
print "{$row['dejagnutime_cpu']} | ";
}
/*~~~~~~~~~~~~ Dejagnu Time Wall ~~~~~~~~~~~~*/
echo "";
echo $row['dejagnutime_wall'];
echo " | ";
/*~~~~~~~~~~~~ # of expected passes ~~~~~~~~~~~~*/
if ($row['teststats_exppass'] > $prev_row['teststats_exppass'] && $build_ok && $prev_build_ok){
$color="#CCFFCC";
}
else if ($row['teststats_exppass'] < $prev_row['teststats_exppass'] && $build_ok && $prev_build_ok){
$color="#FFAAAA";
}
else{
$color="white";
}
if(!$build_ok){
print "{$row['teststats_exppass']} | ";
}
else{
print "{$row['teststats_exppass']} | ";
}
/*~~~~~~~~~~~~ # of unexpected failures ~~~~~~~~~~~~*/
if ($row['teststats_unexpfail'] < $prev_row['teststats_unexpfail'] && $build_ok && $prev_build_ok){
$color="#CCFFCC";
}
else if ($row['teststats_unexpfail'] > $prev_row['teststats_unexpfail'] && $build_ok && $prev_build_ok){
$color="#FFAAAA";
}
else{
$color="white";
}
if(!$build_ok){
print "{$row['teststats_unexpfail']} | ";
}
else if($row['teststats_exppass']!=0){
print "{$row['teststats_unexpfail']} | ";
}
else{
print "{$row['teststats_unexpfail']} | ";
}
/*~~~~~~~~~~~~ # of expected failures ~~~~~~~~~~~~*/
if ($row['teststats_expfail'] < $prev_row['teststats_expfail'] && $build_ok && $prev_build_ok){
print "{$row['teststats_expfail']} | ";
}
else if ($row['teststats_expfail'] > $prev_row['teststats_expfail'] && $build_ok && $prev_build_ok){
print "{$row['teststats_expfail']} | ";
}
else{
print "{$row['teststats_expfail']} | ";
}
/*~~~~~~~~~~~~ Number Of Warnings ~~~~~~~~~~~~*/
if($num_warnings>0){
print "\t$num_warnings | \n";
}
else{
print "\t$num_warnings | \n";
}
/*~~~~~~~~~~~~ Link to test page ~~~~~~~~~~~~*/
echo "";
print "View details\n";
echo " | ";
echo "
";
$row = $prev_row;
$x++;
} #end while
mysql_free_result($result);
/*******************************
*
* Taking care of last row
*******************************/
if($line % 2 ==0){
print "\t\n";
}
else{
print "\t
\n";
}
$line++;
echo "| ";
$date = preg_replace("/\s\d\d:\d\d:\d\d/","",$row['added']);
echo $date;
echo " | ";
echo "";
echo $row['getcvstime_wall'];
echo " | ";
echo "";
echo $row['configuretime_cpu'];
echo " | ";
echo "";
echo $row['configuretime_wall'];
echo " | ";
echo "";
echo $row['buildtime_cpu'];
echo " | ";
echo "";
echo $row['buildtime_wall'];
echo " | ";
echo "";
echo $row['dejagnutime_cpu'];
echo " | ";
echo "";
echo $row['dejagnutime_wall'];
echo " | ";
echo "";
echo $row['teststats_exppass'];
echo " | ";
echo "";
echo $row['teststats_unexpfail'];
echo " | ";
echo "";
echo $row['teststats_expfail'];
echo " | ";
echo "";
if(isset($num_warnings)){
echo $num_warnings;
}
else{
echo "-";
}
echo " | ";
echo "";
print "View details\n";
echo " | ";
echo "
";
echo "
";
print "