diff --git a/common/prettify.pm b/common/prettify.pm
index 926001224..de411063e 100644
--- a/common/prettify.pm
+++ b/common/prettify.pm
@@ -353,6 +353,194 @@ sub Normal ($)
###############################################################################
###############################################################################
+package Prettify::Failed_Tests_HTML;
+
+use strict;
+use warnings;
+
+use FileHandle;
+
+###############################################################################
+
+sub new ($)
+{
+ my $proto = shift;
+ my $class = ref ($proto) || $proto;
+ my $self = {};
+ my $basename = shift;
+ my $buildname = shift;
+ my $rev_link = shift;
+
+ my $path = substr($basename, 0, index($basename, '/'));
+ my $filename = $path . "/Failed_Tests.html";
+
+ $basename =~ s/^.*\///;
+
+ $self->{FULLHTML} = $basename . "_Full.html";
+ $self->{ERROR_COUNTER} = 0;
+ $self->{WARNING_COUNTER} = 0;
+ $self->{SECTION_COUNTER} = 0;
+ $self->{SUBSECTION_COUNTER} = 0;
+ $self->{TITLE} = "Failed Test Brief Log";
+ $self->{GIT_CHECKEDOUT_OPENDDS} = "unknown";
+ $self->{REV_LINK} = $rev_link;
+
+ unless (-e $filename) {
+ my $file_handle = new FileHandle ($filename, 'w');
+ print {$file_handle} "
$self->{TITLE}
\n";
+ }
+
+ $self->{FH} = new FileHandle ($filename, '>>');
+ $self->{FILENAME} = $filename;
+ $self->{BUILDNAME} = $buildname;
+
+ bless ($self, $class);
+ return $self;
+}
+
+sub Header ()
+{
+ my $self = shift;
+
+ if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') {
+ print {$self->{FH}} "\n";
+ print {$self->{FH}} "\n";
+ }
+}
+
+sub Footer ()
+{
+ my $self = shift;
+
+ if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') {
+ # In the case where there was no errors or warnings, output a note
+ if ($self->{ERROR_COUNTER} == 0 && $self->{WARNING_COUNTER} == 0) {
+ print {$self->{FH}} "No Errors or Warnings detected
\n";
+ }
+
+ print {$self->{FH}} "\n";
+ print {$self->{FH}} "\n";
+ }
+}
+
+sub Section ($)
+{
+ my $self = shift;
+ my $s = shift;
+
+ # Escape any '<' or '>' signs
+ $s =~ s/</g;
+ $s =~ s/>/>/g;
+
+ my $counter = ++$self->{SECTION_COUNTER};
+
+ # Save for later use
+
+ $self->{LAST_SECTION} = $s;
+}
+
+sub Description ($)
+{
+ my $self = shift;
+
+ # Ignore
+}
+
+sub Timestamp ($)
+{
+ my $self = shift;
+ # Ignore
+}
+
+sub Subsection ($)
+{
+ my $self = shift;
+ my $s = shift;
+
+ # Escape any '<' or '>' signs
+ $s =~ s/</g;
+ $s =~ s/>/>/g;
+
+ my $counter = ++$self->{SUBSECTION_COUNTER};
+
+ # Save for later use
+
+ $self->{LAST_SUBSECTION} = $s;
+}
+
+sub Print_Sections ()
+{
+ my $self = shift;
+
+ if (defined $self->{LAST_SECTION} && defined $self->{LAST_SUBSECTION} && $self->{LAST_SECTION} eq 'Test') {
+ if (defined $self->{BUILDNAME}) {
+ print {$self->{FH}} "
$self->{BUILDNAME}
\n";
+ my $rev = substr($self->{GIT_CHECKEDOUT_OPENDDS}, 0, 8);
+ if ($rev ne "unknown") {
+ print {$self->{FH}} "Rev: {REV_LINK}>$rev
\n";
+ }
+ $self->{BUILDNAME} = undef;
+ }
+
+ print {$self->{FH}} "{SUBSECTION_COUNTER}\">";
+ print {$self->{FH}} "$self->{LAST_SUBSECTION}
\n";
+ $self->{LAST_SUBSECTION} = undef;
+ }
+}
+
+sub Error ($)
+{
+ my $self = shift;
+ my $s = shift;
+
+ if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') {
+
+ # Escape any '<' or '>' signs
+ $s =~ s/</g;
+ $s =~ s/>/>/g;
+
+ my $counter = ++$self->{ERROR_COUNTER};
+
+ $self->Print_Sections ();
+
+ print {$self->{FH}} "\n";
+ print {$self->{FH}} "[{FULLHTML}#error_$counter"
+ . "\">Details] ";
+ print {$self->{FH}} "$s
\n";
+ }
+}
+
+sub Warning ($)
+{
+ my $self = shift;
+ my $s = shift;
+
+ if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') {
+ # Escape any '<' or '>' signs
+ $s =~ s/</g;
+ $s =~ s/>/>/g;
+
+ my $counter = ++$self->{WARNING_COUNTER};
+
+ $self->Print_Sections ();
+
+ print {$self->{FH}} "\n";
+ print {$self->{FH}} "[{FULLHTML}#warning_$counter"
+ . "\">Details] ";
+ print {$self->{FH}} "$s
\n";
+ }
+}
+
+sub Normal ($)
+{
+ my $self = shift;
+
+ # Ignore
+}
+
+###############################################################################
+###############################################################################
+
package Prettify::JUnit;
use strict;
@@ -862,12 +1050,15 @@ use FileHandle;
###############################################################################
-sub new ($)
+sub new ($$$$$)
{
my $proto = shift;
my $class = ref ($proto) || $proto;
my $self = {};
my $basename = shift;
+ my $buildname = shift;
+ my $skip_failed_test_logs = shift;
+ my $rev_link = shift;
# Initialize some variables
@@ -897,6 +1088,10 @@ sub new ($)
new Prettify::Totals_HTML ($basename), #Must be 2
new Prettify::Config_HTML ($basename), #Must be 3
);
+
+ if (!$skip_failed_test_logs) {
+ push @{$self->{OUTPUT}}, new Prettify::Failed_Tests_HTML ($basename, $buildname, $rev_link); #Must be 4, if used
+ }
my $junit = main::GetVariable ('junit_xml_output');
if (defined $junit) {
@@ -1242,6 +1437,11 @@ sub Setup_Handler ($)
elsif ("$totals->{GIT_CHECKEDOUT_OPENDDS}" eq "Matched")
{
$totals->{GIT_CHECKEDOUT_OPENDDS} = $sha;
+ if (exists ($self->{OUTPUT}[4]))
+ {
+ (@{$self->{OUTPUT}})[4]->{GIT_CHECKEDOUT_OPENDDS} = $sha;
+ }
+
}
$self->Output_Normal ($s);
}
@@ -1372,6 +1572,10 @@ sub Config_Handler ($)
my $revision = $totals->{GIT_REVISIONS}[0];
print "Matched GIT url to revision $revision\n";
$totals->{GIT_CHECKEDOUT_OPENDDS} = $revision;
+ if (exists ($self->{OUTPUT}[4]))
+ {
+ (@{$self->{OUTPUT}})[4]->{GIT_CHECKEDOUT_OPENDDS} = $revision;
+ }
}
}
elsif ($s =~ m/GIT_COMMIT=(.+)/)
@@ -1505,13 +1709,16 @@ sub BuildErrors ($)
# In this function we process the log file line by line,
# looking for errors.
-sub Process ($)
+sub Process ($$$$)
{
my $filename = shift;
my $basename = $filename;
$basename =~ s/\.txt$//;
+ my $buildname = shift;
+ my $skip_failed_test_logs = shift;
+ my $rev_link = shift;
- my $processor = new Prettify ($basename);
+ my $processor = new Prettify ($basename, $buildname, $skip_failed_test_logs, $rev_link);
my $input = new FileHandle ($filename, 'r');
diff --git a/scoreboard.pl b/scoreboard.pl
index cf6b5203e..c69fe05b5 100755
--- a/scoreboard.pl
+++ b/scoreboard.pl
@@ -151,6 +151,7 @@ ($$)
### Print timestamp
+ print $indexhtml "
Failed Test Brief Log
\n";
print $indexhtml '
Last updated at ' . get_time_str() . "
\n";
### Print the Footer
@@ -539,7 +540,27 @@ ($)
}
print " Prettifying\n" if($verbose);
- Prettify::Process ("$directory/$buildname/$filename");
+
+ my $diffRev = '';
+ if (defined $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} &&
+ !($builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} =~ /None/)) {
+ $diffRev = $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS};
+ }
+ else {
+ $diffRev = 'None';
+ }
+ my $diffRoot = $builds{$buildname}->{DIFFROOT};
+ my $link = '';
+ my $linktarget = '';
+ if (defined $main::opt_n) {
+ $linktarget = "target=\"_blank\""
+ }
+ # If we have a diff revision, and a diffroot URL, create a link
+ if (($diffRev !~ /None/) && ($diffRoot)) {
+ my $url = $diffRoot . $diffRev;
+ $link = "$diffRev";
+ }
+ Prettify::Process ("$directory/$buildname/$filename", $buildname, $use_build_logs, $link);
}
}
}
@@ -567,6 +588,11 @@ ($)
return;
}
+ my $failed_tests = $directory . "/Failed_Tests.html";
+ if (-e $failed_tests) {
+ unlink $failed_tests;
+ }
+
foreach my $buildname (keys %builds) {
my $keep = $keep_default;
my @existing;
@@ -653,7 +679,28 @@ ($)
if ( -e $file . "_Totals.html" ) {next;}
if ( $post == 1 ) {
print " Prettifying $file.txt\n" if($verbose);
- Prettify::Process ("$file.txt");
+
+ my $diffRev = '';
+ if (defined $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} &&
+ !($builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} =~ /None/)) {
+ $diffRev = $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS};
+ }
+ else {
+ $diffRev = 'None';
+ }
+ my $diffRoot = $builds{$buildname}->{DIFFROOT};
+ my $link = '';
+ my $linktarget = '';
+ if (defined $main::opt_n) {
+ $linktarget = "target=\"_blank\""
+ }
+ # If we have a diff revision, and a diffroot URL, create a link
+ if (($diffRev !~ /None/) && ($diffRoot)) {
+ my $url = $diffRoot . $diffRev;
+ $link = "$diffRev";
+ }
+
+ Prettify::Process ("$file.txt", $buildname, $use_build_logs, $link);
$updated++;
} else {
# Create the triggerfile for the next time we run
@@ -779,6 +826,11 @@ ($)
return;
}
+ my $failed_tests = $directory . "/Failed_Tests.html";
+ if (-e $failed_tests) {
+ unlink $failed_tests;
+ }
+
foreach my $buildname (keys %builds) {
### Do we use the local cache or do we work
### with the storage of the build itself?
@@ -1138,6 +1190,9 @@ ($$$)
### Print timestamp
+ if (!$use_build_logs) {
+ print $indexhtml "
Failed Test Brief Log
\n";
+ }
print $indexhtml '
Last updated at ' . get_time_str() . "
\n";
### Print the Footer