Skip to content

Commit

Permalink
7903232: RunTestsCommand should also print Total/Setup/Cleanup times …
Browse files Browse the repository at this point in the history
…converted to seconds
  • Loading branch information
dbessono committed Jul 17, 2022
1 parent 45fd82a commit 575facb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions src/com/sun/javatest/batch/RunTestsCommand.java
Expand Up @@ -135,12 +135,15 @@ public void run(CommandContext ctx) throws Fault {
h.notifyOfTheFinalStats(stats != null ? Collections.unmodifiableMap(stats) : Collections.emptyMap(), boStats);

if (!ctx.isVerboseQuiet()) {
long tt = h.getElapsedTime();
long setupT = h.getTotalSetupTime();
long cleanupT = h.getTotalCleanupTime();
ctx.printMessage(i18n, "runTests.totalTime", formattedDuration(tt / 1000L));
ctx.printMessage(i18n, "runTests.setupTime", formattedDuration(setupT / 1000L));
ctx.printMessage(i18n, "runTests.cleanupTime", formattedDuration(cleanupT / 1000L));
long totalTimeSec = h.getElapsedTime() / 1000L;
long setupTimeSec = h.getTotalSetupTime() / 1000L;
long cleanupTimeSec = h.getTotalCleanupTime() / 1000L;
ctx.printMessage(i18n, "runTests.totalTime", formattedDuration(totalTimeSec),
totalTimeSec <= 60 ? "" : " (or " + totalTimeSec + " seconds)");
ctx.printMessage(i18n, "runTests.setupTime", formattedDuration(setupTimeSec),
setupTimeSec <= 60 ? "" : " (or " + setupTimeSec + " seconds)");
ctx.printMessage(i18n, "runTests.cleanupTime", formattedDuration(cleanupTimeSec),
cleanupTimeSec <= 60 ? "" : " (or " + cleanupTimeSec + " seconds)");

showResultStats(skipped, boStats);
}
Expand Down
6 changes: 3 additions & 3 deletions src/com/sun/javatest/batch/i18n.properties
Expand Up @@ -53,17 +53,17 @@ observer.noClassName=No class name given
observer.badArg=Bad option: {0}
observer.badClassPath=Bad class path ({0}): {1}

runTests.cleanupTime=Cleanup time: {0}
runTests.cleanupTime=Cleanup time: {0}{1}
runTests.error=Error: {0}
runTests.harnessError=An error occurred while running the tests:\n{0}
runTests.interrupted=The test run was interrupted.
runTests.noTests=Test results: no tests selected
runTests.resultsDone=Results written to {0}
runTests.setupTime=Setup time: {0}
runTests.setupTime=Setup time: {0}{1}
runTests.tests=Test results: {0,choice,0#|0<passed: {0,number}}{1,choice,0#|1#; }{2,choice,0#|0<failed: {2,number}}{3,choice,0#|1#; }{4,choice,0#|0<error: {4,number}}{5,choice,0#|1#; }{6,choice,0#|0<not run: {6,number}}{7,choice,0#|1#; }{8,choice,0#|0<skipped: {8,number}}
runTests.testsInTheSuite=Tests found in the suite: {0,number}
runTests.testsFailed=Error: Some tests did not pass
runTests.totalTime=Total time: {0}
runTests.totalTime=Total time: {0}{1}
runTests.warnError=Warning: Test run completed, but problem(s) were detected in the test suite\nduring the run.


Expand Down

0 comments on commit 575facb

Please sign in to comment.