Skip to content

Commit

Permalink
Support user defined comment in results summary (#435)
Browse files Browse the repository at this point in the history
- to identify summary in the middle

Signed-off-by: renfeiw <renfeiw@ca.ibm.com>
  • Loading branch information
renfeiw authored Apr 13, 2023
1 parent cb3ce37 commit 8ab5268
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions scripts/resultsSum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
my $spec = "";
my $customTarget = "";
my $testTarget = "";
my $comment = "";

for (my $i = 0; $i < scalar(@ARGV); $i++) {
my $arg = $ARGV[$i];
Expand Down Expand Up @@ -64,6 +65,8 @@
($customTarget) = $arg =~ /^\-\-customTarget=(.*)/;
} elsif ($arg =~ /^\-\-testTarget=/) {
($testTarget) = $arg =~ /^\-\-testTarget=(.*)/;
} elsif ($arg =~ /^\-\-comment=/) {
($comment) = $arg =~ /^\-\-comment=(.*)/;
}
}

Expand Down Expand Up @@ -215,7 +218,10 @@ sub resultReporter {
}

#generate console output
print "TEST TARGETS SUMMARY\n";
if ($comment ne "") {
$comment = "(${comment}) ";
}
print $comment . "TEST TARGETS SUMMARY\n";
print "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";

if ($numOfDisabled != 0) {
Expand All @@ -241,13 +247,16 @@ sub resultReporter {

$numOfExecuted = $numOfTotal - $numOfSkipped - $numOfDisabled;

print "TOTAL: $numOfTotal EXECUTED: $numOfExecuted PASSED: $numOfPassed FAILED: $numOfFailed";
my $testStatus = "TOTAL: $numOfTotal EXECUTED: $numOfExecuted PASSED: $numOfPassed FAILED: $numOfFailed";
# Hide numOfDisabled when running disabled tests list.
if ($runningDisabled == 0) {
print " DISABLED: $numOfDisabled";
$testStatus .= " DISABLED: $numOfDisabled";
}
print " SKIPPED: $numOfSkipped";
print "\n";
$testStatus .= " SKIPPED: $numOfSkipped";
if ($comment ne "") {
$testStatus = "($testStatus)";
}
print "$testStatus\n";
if ($numOfTotal > 0) {
# set tap file name if not given
if ($tapName eq '') {
Expand Down
2 changes: 1 addition & 1 deletion settings.mk
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,4 @@ resultsSummary:
@$(ECHO_NEWLINE)
@$(ECHO) $(Q)All tests finished, run result summary:$(Q)
$(CD) $(Q)$(TEST_ROOT)$(D)TKG$(D)scripts$(Q); \
perl $(Q)resultsSum.pl$(Q) --failuremk=$(Q)$(FAILEDTARGETS)$(Q) --resultFile=$(Q)$(TEMPRESULTFILE)$(Q) --platFile=$(Q)$(PLATFROMFILE)$(Q) --diagnostic=$(DIAGNOSTICLEVEL) --jdkVersion=$(JDK_VERSION) --jdkImpl=$(JDK_IMPL) --jdkVendor=$(Q)$(JDK_VENDOR)$(Q) --spec=$(SPEC) --buildList=$(BUILD_LIST) --customTarget=$(Q)$(CUSTOM_TARGET)$(Q) --testTarget=$(TESTTARGET) --tapPath=$(TESTOUTPUT)$(D) --tapName=$(TAP_NAME)
perl $(Q)resultsSum.pl$(Q) --failuremk=$(Q)$(FAILEDTARGETS)$(Q) --resultFile=$(Q)$(TEMPRESULTFILE)$(Q) --platFile=$(Q)$(PLATFROMFILE)$(Q) --diagnostic=$(DIAGNOSTICLEVEL) --jdkVersion=$(JDK_VERSION) --jdkImpl=$(JDK_IMPL) --jdkVendor=$(Q)$(JDK_VENDOR)$(Q) --spec=$(SPEC) --buildList=$(BUILD_LIST) --customTarget=$(Q)$(CUSTOM_TARGET)$(Q) --testTarget=$(TESTTARGET) --tapPath=$(TESTOUTPUT)$(D) --tapName=$(TAP_NAME) --comment=$(Q)$(RESULT_COMMENT)$(Q)

0 comments on commit 8ab5268

Please sign in to comment.