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

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 | tools/testing/dart/test_runner.dart » ('j') | 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..20da10f84c9e1add81fc5864130e926652e72f91 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -94,7 +94,7 @@ List<String> _buildFailureOutput(TestCase test,
var command = test.commands[i];
var commandOutput = test.commandOutputs[command];
if (commandOutput != null) {
- output.add("CommandOutput[$i]:");
+ output.add("CommandOutput[${command.displayName}]:");
if (!commandOutput.diagnostics.isEmpty) {
String prefix = 'diagnostics:';
for (var s in commandOutput.diagnostics) {
@@ -203,29 +203,31 @@ class SummaryPrinter extends EventListener {
}
class TimingPrinter extends EventListener {
- List<TestCase> _tests = <TestCase>[];
+ List<CommandOutput> _commandOutputs = <CommandOutput>[];
DateTime _startTime;
TimingPrinter(this._startTime);
void done(TestCase testCase) {
- _tests.add(testCase);
+ for (var commandOutput in testCase.commandOutputs.values) {
+ _commandOutputs.add(commandOutput);
+ }
}
void allDone() {
- // TODO: We should take all the commands into account
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;
+ _commandOutputs.sort((a, b) {
+ return b.time.inMilliseconds - a.time.inMilliseconds;
});
- for (int i = 0; i < 20 && i < _tests.length; i++) {
- var name = _tests[i].displayName;
- var duration = _tests[i].lastCommandOutput.time;
- var configuration = _tests[i].configurationString;
- print('${duration} - $configuration $name');
+ for (int i = 0; i < 20 && i < _commandOutputs.length; i++) {
+ var commandOutput = _commandOutputs[i];
+ var command = commandOutput.command;
+ var testCase = commandOutput.testCase;
+ var duration = commandOutput.time;
+ var configuration = testCase.configurationString;
+ print('${commandOutput.time} - $configuration'
+ ' - ${testCase.displayName} (${command.displayName})');
}
}
}
« no previous file with comments | « no previous file | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698