<& default-header.mas &>

<%perl> # Connect to the database. our $dbh=$m->comp('mysql-connect.mas');

<%perl> if($ARGS{type} eq 'unit'){ print "Unit Testing Results"; } elsif($ARGS{type} eq 'sim'){ print "Simulation Testing Results"; } else { print "Invalid testing type"; }

<%perl> # Report unit testing results. if($ARGS{type} eq "unit"){ print ""; get_detailed_unit_testing_results($ARGS{id}); } elsif ($ARGS{type} eq "sim"){ print ""; get_detailed_sim_testing_results($ARGS{id}); } else { print "Invalid testing type."; }
ID Module Test Wall [s] CPU [s] ResultID Name Wall [s] CPU [s] Result
Green-colored results indicate 100% successful Test Runs. Red-colored results indicate less than 100% successful Test Runs.

<& default-footer.mas &> <%perl> # Print rows and columns of unit testing results. sub get_detailed_unit_testing_results { my ($test_run)=@_; my $sql="SELECT * FROM unit_test_results where test_run=" . $test_run; my $sth=$dbh->prepare($sql); my $result=$sth->execute(); my $num=1; while(my $row=$sth->fetchrow_hashref()){ print ""; print "" . $num . ""; $num++; print "" . $row->{id} . ""; print "". $row->{module} . ""; print "" . $row->{test} . ""; print "" . $row->{wall} . ""; print "" . $row->{cpu} . ""; if($row->{result} eq 'P'){ print "PASS"; } else { print "FAIL"; } print ""; } } # Print rows and columns of simulation testing results. sub get_detailed_sim_testing_results { my ($test_run)=@_; my $sql="SELECT * FROM sim_test_results where test_run=" . $test_run; my $sth=$dbh->prepare($sql); my $result=$sth->execute(); while(my $row=$sth->fetchrow_hashref()){ print ""; print "" . $row->{id} . ""; print "". $row->{name} . ""; print "" . $row->{wall} . ""; print "" . $row->{cpu} . ""; if($row->{result} eq 'P'){ print "PASS"; } else { print "FAIL"; } print ""; } } "; echo "".$row['id'].""; echo "".$row['module'].""; echo "".$row['test'].""; echo "".$row['wall'].""; echo "".$row['cpu'].""; if($row['result'] === 'P'){ echo "PASS"; } else { echo "FAIL"; } echo""; } } # Print rows and columns of simulation testing results. function get_detailed_sim_testing_results ($test_run) { $sql="SELECT * FROM sim_test_results where test_run=".$test_run; $result = mysql_query($sql) or die(mysql_error()); $row=mysql_fetch_array($result); while($row = mysql_fetch_array($result)){ echo""; echo "".$row['id'].""; echo "".$row['name'].""; echo "".$row['wall'].""; echo "".$row['cpu'].""; if($row['result'] === 'P'){ echo "PASS"; } else { echo "FAIL"; } echo""; } }