diff options
author | 2015-10-12 14:43:05 +0000 | |
---|---|---|
committer | 2015-10-13 01:00:40 +0000 | |
commit | aa8b1520c6c90ab9f0a489f996937fc6a355ca3c (patch) | |
tree | 8fa2a061391bd74a43d0eaef56991338ab8d757c /src/main/java/com/google/devtools/build/lib | |
parent | 0d5d522bf9fc2ae42ab71ca60094c79eb988501c (diff) |
Add timing info for tests and correct caching vs. run ratio
Now prints:
//foo:bar (cached) PASSED in 0.1s
instead of:
//foo:bar (1/0 cached) PASSED
Fixes #218.
--
MOS_MIGRATED_REVID=105210302
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java index dc39fbe8fe..ab8dced2a8 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java @@ -178,6 +178,7 @@ public class StandaloneTestStrategy extends TestStrategy { Path testLogPath = action.getTestLog().getPath(); TestResultData.Builder builder = TestResultData.newBuilder(); + long startTime = executor.getClock().currentTimeMillis(); try { try { if (executionOptions.testOutput.equals(TestOutputFormat.STREAMED)) { @@ -199,6 +200,9 @@ public class StandaloneTestStrategy extends TestStrategy { .setTestPassed(false) .setStatus(e.hasTimedOut() ? BlazeTestStatus.TIMEOUT : BlazeTestStatus.FAILED); } finally { + long duration = executor.getClock().currentTimeMillis() - startTime; + builder.addTestTimes(duration); + builder.setRunDurationMillis(duration); if (streamed != null) { streamed.close(); } |