Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: tools/testing/dart/test_progress.dart

Issue 19388002: test.py: Report timings by adding up the time of all commands (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_progress.dart
diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart
index b288db5b064349b6eba742a5b032a1e7bf37b050..497bdca591293a26438be466f721afb9f17de585 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -213,17 +213,23 @@ class TimingPrinter extends EventListener {
}
void allDone() {
- // TODO: We should take all the commands into account
+ Duration durationOfTest(testCase) {
+ var duration = const Duration();
+ for (var output in testCase.commandOutputs.values) {
+ duration += output.time;
+ }
+ return duration;
+ }
kustermann 2013/07/16 14:48:47 This procedure will be called O(n*log n) which mea
+
Duration d = (new DateTime.now()).difference(_startTime);
print('\n--- Total time: ${_timeString(d)} ---');
_tests.sort((a, b) {
- Duration aDuration = a.lastCommandOutput.time;
- Duration bDuration = b.lastCommandOutput.time;
- return bDuration.inMilliseconds - aDuration.inMilliseconds;
+ return
+ durationOfTest(b).inMilliseconds - durationOfTest(a).inMilliseconds;
});
for (int i = 0; i < 20 && i < _tests.length; i++) {
var name = _tests[i].displayName;
- var duration = _tests[i].lastCommandOutput.time;
+ var duration = durationOfTest(_tests[i]);
var configuration = _tests[i].configurationString;
print('${duration} - $configuration $name');
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698