OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:convert" show JSON; | 7 import "dart:convert" show JSON; |
8 import "dart:io"; | 8 import "dart:io"; |
9 | 9 |
10 import "path.dart"; | 10 import "path.dart"; |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 return decodeUtf8(output) | 582 return decodeUtf8(output) |
583 .replaceAll('\r\n', '\n') | 583 .replaceAll('\r\n', '\n') |
584 .replaceAll('\r', '\n') | 584 .replaceAll('\r', '\n') |
585 .split('\n'); | 585 .split('\n'); |
586 } | 586 } |
587 | 587 |
588 List<String> _buildFailureOutput(TestCase test, | 588 List<String> _buildFailureOutput(TestCase test, |
589 [Formatter formatter = Formatter.normal]) { | 589 [Formatter formatter = Formatter.normal]) { |
590 var output = [ | 590 var output = [ |
591 '', | 591 '', |
592 formatter.failed('FAILED: ${test.configurationString}${test.displayName}') | 592 formatter.failed('FAILED: ${test.configurationString} ${test.displayName}') |
593 ]; | 593 ]; |
594 | 594 |
595 var expected = new StringBuffer(); | 595 var expected = new StringBuffer(); |
596 expected.write('Expected: '); | 596 expected.write('Expected: '); |
597 for (var expectation in test.expectedOutcomes) { | 597 for (var expectation in test.expectedOutcomes) { |
598 expected.write('$expectation '); | 598 expected.write('$expectation '); |
599 } | 599 } |
600 | 600 |
601 output.add(expected.toString()); | 601 output.add(expected.toString()); |
602 output.add('Actual: ${test.result}'); | 602 output.add('Actual: ${test.result}'); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 String _buildSummaryEnd(int failedTests) { | 675 String _buildSummaryEnd(int failedTests) { |
676 if (failedTests == 0) { | 676 if (failedTests == 0) { |
677 return '\n===\n=== All tests succeeded\n===\n'; | 677 return '\n===\n=== All tests succeeded\n===\n'; |
678 } else { | 678 } else { |
679 var pluralSuffix = failedTests != 1 ? 's' : ''; | 679 var pluralSuffix = failedTests != 1 ? 's' : ''; |
680 return '\n===\n=== ${failedTests} test$pluralSuffix failed\n===\n'; | 680 return '\n===\n=== ${failedTests} test$pluralSuffix failed\n===\n'; |
681 } | 681 } |
682 } | 682 } |
OLD | NEW |