| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test_progress; | 5 library test_progress; |
| 6 | 6 |
| 7 import "dart:io"; | 7 import "dart:io"; |
| 8 import "test_runner.dart"; | 8 import "test_runner.dart"; |
| 9 import "test_suite.dart"; | 9 import "test_suite.dart"; |
| 10 import "status_file_parser.dart"; | 10 import "status_file_parser.dart"; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 String _header(String header) => header; | 142 String _header(String header) => header; |
| 143 | 143 |
| 144 void _printFailureOutput(TestCase test) { | 144 void _printFailureOutput(TestCase test) { |
| 145 var failureOutput = _buildFailureOutput(test); | 145 var failureOutput = _buildFailureOutput(test); |
| 146 for (var line in failureOutput) { | 146 for (var line in failureOutput) { |
| 147 print(line); | 147 print(line); |
| 148 } | 148 } |
| 149 _failureSummary.addAll(failureOutput); | 149 _failureSummary.addAll(failureOutput); |
| 150 } | 150 } |
| 151 | 151 |
| 152 List<String> _buildFailureOutput(TestCase test) { | 152 List<String> _buildFailureOutput(TestCase test) { |
| 153 List<String> output = new List<String>(); | 153 List<String> output = new List<String>(); |
| 154 output.add(''); | 154 output.add(''); |
| 155 output.add(_header('FAILED: ${test.configurationString}' | 155 output.add(_header('FAILED: ${test.configurationString}' |
| 156 ' ${test.displayName}')); | 156 ' ${test.displayName}')); |
| 157 StringBuffer expected = new StringBuffer(); | 157 StringBuffer expected = new StringBuffer(); |
| 158 expected.add('Expected: '); | 158 expected.add('Expected: '); |
| 159 for (var expectation in test.expectedOutcomes) { | 159 for (var expectation in test.expectedOutcomes) { |
| 160 expected.add('$expectation '); | 160 expected.add('$expectation '); |
| 161 } | 161 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 176 if (!test.lastCommandOutput.diagnostics.isEmpty) { | 176 if (!test.lastCommandOutput.diagnostics.isEmpty) { |
| 177 String prefix = 'diagnostics:'; | 177 String prefix = 'diagnostics:'; |
| 178 for (var s in test.lastCommandOutput.diagnostics) { | 178 for (var s in test.lastCommandOutput.diagnostics) { |
| 179 output.add('$prefix ${s}'); | 179 output.add('$prefix ${s}'); |
| 180 prefix = ' '; | 180 prefix = ' '; |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 if (!test.lastCommandOutput.stdout.isEmpty) { | 183 if (!test.lastCommandOutput.stdout.isEmpty) { |
| 184 output.add(''); | 184 output.add(''); |
| 185 output.add('stdout:'); | 185 output.add('stdout:'); |
| 186 if (test.lastCommandOutput.command.isPixelTest) { | 186 for (var s in test.lastCommandOutput.stdout) { |
| 187 output.add('DRT pixel test failed! stdout is not printed because it ' | 187 output.add(s); |
| 188 'contains binary data!'); | |
| 189 } else { | |
| 190 output.add(new String.fromCharCodes(test.lastCommandOutput.stdout)); | |
| 191 } | 188 } |
| 192 } | 189 } |
| 193 if (!test.lastCommandOutput.stderr.isEmpty) { | 190 if (!test.lastCommandOutput.stderr.isEmpty) { |
| 194 output.add(''); | 191 output.add(''); |
| 195 output.add('stderr:'); | 192 output.add('stderr:'); |
| 196 output.add(new String.fromCharCodes(test.lastCommandOutput.stderr)); | 193 for (var s in test.lastCommandOutput.stderr) { |
| 194 output.add(s); |
| 195 } |
| 197 } | 196 } |
| 198 for (Command c in test.commands) { | 197 for (Command c in test.commands) { |
| 199 output.add(''); | 198 output.add(''); |
| 200 String message = (c == test.commands.last | 199 String message = (c == test.commands.last |
| 201 ? "Command line" : "Compilation command"); | 200 ? "Command line" : "Compilation command"); |
| 202 output.add('$message: ${c.commandLine}'); | 201 output.add('$message: ${c.commandLine}'); |
| 203 } | 202 } |
| 204 return output; | 203 return output; |
| 205 } | 204 } |
| 206 | 205 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 print(''); | 477 print(''); |
| 479 print('$config:'); | 478 print('$config:'); |
| 480 statuses.sort((a, b) => a.compareTo(b)); | 479 statuses.sort((a, b) => a.compareTo(b)); |
| 481 for (String status in statuses) { | 480 for (String status in statuses) { |
| 482 print(' $status'); | 481 print(' $status'); |
| 483 } | 482 } |
| 484 }); | 483 }); |
| 485 _printStatus(); | 484 _printStatus(); |
| 486 } | 485 } |
| 487 } | 486 } |
| OLD | NEW |