@@ -10,6 +10,7 @@ use warnings;
1010
1111use FileHandle;
1212use Cwd;
13+ our $path = " " ;
1314
1415# ##############################################################################
1516
@@ -20,6 +21,8 @@ sub new ($)
2021 my $self = {};
2122 my $basename = shift ;
2223 my $filename = $basename . " _Full.html" ;
24+ my $log_root = main::GetVariable(' log_root' );
25+ $path = ((defined $log_root ) ? ($log_root . ' /' . $filename ) : $filename );
2326 $self -> {ERROR_COUNTER } = 0;
2427 $self -> {WARNING_COUNTER } = 0;
2528 $self -> {SECTION_COUNTER } = 0;
@@ -620,7 +623,6 @@ sub Footer ()
620623{
621624 my $self = shift ;
622625 my $out = $self -> {FH };
623-
624626 my $indent = ' ' ;
625627 print $out $indent , " <testsuite name=\" Autobuild_Tests\" " ;
626628 if (defined $self -> {TIMESTAMP } and length $self -> {TIMESTAMP })
@@ -629,32 +631,30 @@ sub Footer ()
629631 }
630632
631633 my $numtests = @{$self -> {TESTS }};
632-
633- if ($numtests == 0)
634- {
635- # Need to insert a dummy testcase to jenkins doesn't think there is
636- # a failure.
637- print $out ' tests="1">' , " \n " , $indent x 2 ,
638- ' <testcase name="dummy_test"/>' , " \n " ;
634+ if ($numtests > 0) {
635+ print $out " tests=\" $numtests \" failures=\" $self ->{FAILED}\" hostname=\" $Prettify::Config_HTML::host \" >\n " ;
639636 }
640- else
641- {
642- print $out " tests=\" $numtests \" failures=\" $self ->{FAILED}\" >\n " ;
637+ else { # Insert a dummy testcase so jenkins doesn't think there is a failure.
638+ print $out ' tests="1">' , " \n " , $indent x 2 , ' <testcase name="dummy_test"/>' , " \n " ;
643639 }
644640
645- foreach my $test (@{$self -> {TESTS }})
646- {
647- my $error = $test -> {ERROR } || ' ' ;
641+ print $out $indent x 2 , " <properties>\n " ;
642+ foreach my $k (keys %Prettify::commits ) {
643+ print $out $indent x 3 , " <property name=\" $k \" value=\" $Prettify::commits {$k }\" />\n " ;
644+ }
645+ print $out $indent x 3 , " <property name=\" log_file\" value=\" $Prettify::Full_HTML::path \" />\n " ;
646+ print $out $indent x 2 , " </properties>\n " ;
648647
648+ foreach my $test (@{$self -> {TESTS }}) {
649+ my $error = $test -> {ERROR } || ' ' ;
649650 print $out $indent x 2 ,
650- " <testcase name=\" $test ->{NAME}\" status=\" $test ->{RESULT}\" " ,
651- " time=\" $test ->{TIME}\" " , ($error eq " " ? " />\n " : ' >' );
651+ " <testcase name=\" $test ->{NAME}\" status=\" $test ->{RESULT}\" " ,
652+ " time=\" $test ->{TIME}\" " , ($error eq " " ? " />\n " : ' >' );
652653
653- if ($error ne " " )
654- {
655- print $out " <failure>\n " , $indent x 3 ,
656- " <![CDATA[$error ]]></failure><system-out>\n " , $indent x 3 ,
657- " <![CDATA[$test ->{OUT}]]></system-out></testcase>\n " ;
654+ if ($error ne " " ) {
655+ print $out " <failure>\n " ,
656+ $indent x 3 , " <![CDATA[$error ]]></failure><system-out>\n " ,
657+ $indent x 3 , " <![CDATA[$test ->{OUT}]]></system-out></testcase>\n " ;
658658 }
659659 }
660660
@@ -1117,6 +1117,7 @@ use base qw(common::parse_compiler_output);
11171117use Data::Dumper;
11181118use File::Basename;
11191119use FileHandle;
1120+ our %commits = ();
11201121
11211122# ##############################################################################
11221123
@@ -1385,7 +1386,6 @@ sub Normal_Handler ($)
13851386
13861387sub Setup_Handler ($)
13871388{
1388-
13891389 my $self = shift ;
13901390 my $s = shift ;
13911391 if (!defined $s )
@@ -1655,13 +1655,15 @@ sub Config_Handler ($)
16551655 my $revision = $totals -> {GIT_REVISIONS }[0];
16561656 print " Matched GIT url to revision $revision \n " ;
16571657 $totals -> {GIT_CHECKEDOUT_ACE } = $revision ;
1658+ $commits {' GIT_COMMIT_ACE' } = $revision ;
16581659 }
1659- elsif ($url =~ m / (git| https):\/\/ .*\/ OpenDDS\. git/ i )
1660+ elsif ($url =~ m / (git@|(git| https):\/\/ ) .*\/ OpenDDS\. git/ i )
16601661 {
16611662 print " Matched GIT url $url \n " ;
16621663 my $revision = $totals -> {GIT_REVISIONS }[0];
16631664 print " Matched GIT url to revision $revision \n " ;
16641665 $totals -> {GIT_CHECKEDOUT_OPENDDS } = $revision ;
1666+ $commits {' GIT_COMMIT_OPENDDS' } = $revision ;
16651667 if (exists ($self -> {OUTPUT }[$self -> {FAILED_TESTS_ONLY } ? 0 : 4]))
16661668 {
16671669 (@{$self -> {OUTPUT }})[$self -> {FAILED_TESTS_ONLY } ? 0 : 4]-> {GIT_CHECKEDOUT_OPENDDS } = $revision ;
@@ -1929,6 +1931,8 @@ use strict;
19291931use warnings;
19301932
19311933use FileHandle;
1934+ our $host = ' localhost' ;
1935+ my $host_next = 0;
19321936
19331937sub new ($)
19341938{
@@ -1976,10 +1980,17 @@ sub Normal ($)
19761980 my $s = shift ;
19771981 my $state = shift ;
19781982 if (defined $state ) {
1979- $state = lc ($state );
1983+ $state = lc ($state );
19801984 }
1981-
19821985 if (defined $state && $state eq ' config' ) {
1986+ if ($host eq ' localhost' ) {
1987+ if ($host_next == 1) {
1988+ $host = $s ;
1989+ }
1990+ elsif ($s eq " <h3>Hostname</h3>" ) {
1991+ $host_next = 1;
1992+ }
1993+ }
19831994 $s =~ s / </ </ g ;
19841995 $s =~ s / >/ >/ g ;
19851996 $s =~ s / <\s *(\/ ?\s *h\d |\/ a|a\s *href\s *=\s *\s *"[^"]*")\s *>/ <$1 >/ g ;
0 commit comments