Dear All,
I'd like to submit an extension of the "genhtml.pl script:. It is well
known that PERL script is useful to parse the output log of "runltp"
in order to generate the corresponding html log.
I've extended classic "genhtml.pl" script by adding the following features:
1) I've added, in the summary, the detailed report of ALL test results
and not only the TFAIL ones. Now, the report (generated by genhtml.pl)
shows the number of executed tests as well as the number of passed
tests or tests with results TFAIL,TCONF,TBROK,TWARN, etc... I think
this detailed summary is more useful;
2) I've changed the LTP policy to get the machine architecture and the
kernel version used during the LTP session. If the LTP is run on i386
based arch the method used till now work fine. But if I cross-build
LTP and then I run LTP on other target architecture -different from
the host- the reported information are often wrong. I've changed the
way to get information by adding new env variables: "KERNEL_VERSION"
and "MACHINE_ARCH". You already use the same policy to get the LTP
version or the LTP start time and so on. In this way, the users which
cross-builds LTP, will be able to get right summary on the html report
by careful setup of that env. variables.
In attach, please find the patch I've done (with respect to the
ltp-full-20090131).
Please, let me know.
Best Regards
--
Francesco Rundo
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Extended the summary info to the case of LTP cross-built i.e. running on
different arch with respect to the host. Moreover, a more detailed summary
about LTP test results has been added.
Signed-off-by: Francesco Rundo <[email protected]>
--- ltp-full-20090131/tools/genhtml.pl.origin 2009-03-27 08:58:28.430001000
+0100
+++ ltp-full-20090131/tools/genhtml.pl 2009-03-27 09:43:04.810002000 +0100
@@ -42,6 +42,14 @@
my $test_counter = 1;
my $failed_test_counter = 0;
my $failed_test_counter_flag = 0;
+my $brok_test_counter = 0;
+my $brok_test_counter_flag = 0;
+my $warn_test_counter = 0;
+my $warn_test_counter_flag = 0;
+my $retr_test_counter = 0;
+my $retr_test_counter_flag = 0;
+my $conf_test_counter = 0;
+my $conf_test_counter_flag = 0;
my $detected_fail = 0;
my $detected_pass = 0;
@@ -109,7 +117,7 @@
$process_line = 0;
$flag = 0; $flag2 = 0; $flag3
= 0; $flag4 = 0;
$detected_fail = 0; $detected_pass = 0;
$detected_warn = 0; $detected_brok = 0; $detected_retr = 0;
$detected_conf = 0;
- $background_colour = 0; $failed_test_counter_flag = 0;
$row_line= "";
+ $background_colour = 0; $failed_test_counter_flag = 0;
$brok_test_counter_flag = 0; $warn_test_counter_flag = 0;
$retr_test_counter_flag = 0; $conf_test_counter_flag = 0; $row_line= "";
}
if ($process_line) {
@@ -170,21 +178,37 @@
$row_line = $row_line . "</strong></pre></td>";
}
if ( $flag2 == 1 ) {
- $row_line = $row_line . "$line \n";
- if ($line =~ /\ FAIL\ / ) {
- $detected_fail = 1;
- if ( $failed_test_counter_flag == 0 ) {
- $failed_test_counter++;
- $failed_test_counter_flag=1;
- }
- } elsif ($line =~ /\ BROK\ / ) {
- $detected_brok = 1;
- } elsif ($line =~ /\ WARN\ / ) {
- $detected_warn = 1;
- } elsif ($line =~ /\ RETR\ / ) {
- $detected_retr = 1;
- } elsif ($line =~ /\ CONF\ / ) {
- $detected_conf = 1;
+ $row_line = $row_line . "$line \n";
+ if ($line =~ /\ FAIL\ / ) {
+ $detected_fail = 1;
+ if ( $failed_test_counter_flag == 0 ) {
+ $failed_test_counter++;
+ $failed_test_counter_flag=1;
+ }
+ } elsif ($line =~ /\ BROK\ / ) {
+ $detected_brok = 1;
+ if ( $brok_test_counter_flag == 0 ) {
+ $brok_test_counter++;
+ $brok_test_counter_flag=1;
+ }
+ } elsif ($line =~ /\ WARN\ / ) {
+ $detected_warn = 1;
+ if ( $warn_test_counter_flag == 0 ) {
+ $warn_test_counter++;
+ $warn_test_counter_flag=1;
+ }
+ } elsif ($line =~ /\ RETR\ / ) {
+ $detected_retr = 1;
+ if ( $retr_test_counter_flag == 0 ) {
+ $retr_test_counter++;
+ $retr_test_counter_flag=1;
+ }
+ } elsif ($line =~ /\ CONF\ / ) {
+ $detected_conf = 1;
+ if ( $conf_test_counter_flag == 0 ) {
+ $conf_test_counter++;
+ $conf_test_counter_flag=1;
+ }
} else {
$detected_pass = 1;
}
@@ -215,13 +239,15 @@
print "<tr><td><strong>Total Tests</strong></td><td><strong>";
$test_counter--;
print "$test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Total Failures</strong></td><td><strong>
$failed_test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Kernel Version</strong></td><td><strong>";
-$kernel_version=system("uname -r"); chop($kernel_version);
-print " $kernel_version </strong></td></tr>\n";
-print "<tr><td><strong>Machine Architecture</strong> </td><td><strong>";
-$machine_architecture=system("uname -i"); chop($machine_architecture);
-print " $machine_architecture </strong></td></tr>\n";
+$test_passed=$test_counter-$failed_test_counter-$brok_test_counter-$warn_test_counter-$retr_test_counter-$conf_test_counter;
+print "<tr><td><strong>Total Test TPASS:</strong></td><td><strong>
$test_passed </strong></td></tr>\n";
+print "<tr><td><strong>Total Test TFAIL:</strong></td><td><strong>
$failed_test_counter </strong></td></tr>\n";
+print "<tr><td><strong>Total Test TBROK</strong></td><td><strong>
$brok_test_counter </strong></td></tr>\n";
+print "<tr><td><strong>Total Test TWARN</strong></td><td><strong>
$warn_test_counter </strong></td></tr>\n";
+print "<tr><td><strong>Total Test TRETR</strong></td><td><strong>
$retr_test_counter </strong></td></tr>\n";
+print "<tr><td><strong>Total Test TCONF</strong></td><td><strong>
$conf_test_counter </strong></td></tr>\n";
+print "<tr><td><strong>Kernel Version</strong></td><td><strong>
$ENV{KERNEL_VERSION} </strong></td></tr>\n";
+print "<tr><td><strong>Machine Architecture</strong></td><td><strong>
$ENV{MACHINE_ARCH} </strong></td></tr>\n";
print "<tr><td><strong>Hostname</strong> </td> <td><strong>";
$hostname=system("uname -n"); chop($hostname);
print " $hostname </strong></td></tr></tbody></table></div></body></html>\n";
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list