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

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

Issue 13521002: Remove \r in command stdout/stderr when building failure a failure output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 4589b8da75ad317c1500629c4b641c6b1c9fa8a6..af5caf6479a5b2d91a5abea5785ce09a23f61680 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -61,6 +61,12 @@ class ColorFormatter extends Formatter {
List<String> _buildFailureOutput(TestCase test,
[Formatter formatter = const Formatter()]) {
+
+ List<String> getLinesWithoutCarriageReturn(List<int> output) {
+ return decodeUtf8(output).replaceAll('\r\n', '\n')
+ .replaceAll('\r', '\n').split('\n');
+ }
+
List<String> output = new List<String>();
output.add('');
output.add(formatter.failed('FAILED: ${test.configurationString}'
@@ -98,13 +104,14 @@ List<String> _buildFailureOutput(TestCase test,
output.add('DRT pixel test failed! stdout is not printed because it '
'contains binary data!');
} else {
- output.add(decodeUtf8(test.lastCommandOutput.stdout));
+ output.addAll(
+ getLinesWithoutCarriageReturn(test.lastCommandOutput.stdout));
}
}
if (!test.lastCommandOutput.stderr.isEmpty) {
output.add('');
output.add('stderr:');
- output.add(decodeUtf8(test.lastCommandOutput.stderr));
+ output.addAll(getLinesWithoutCarriageReturn(test.lastCommandOutput.stderr));
}
if (test is BrowserTestCase) {
// Additional command for rerunning the steps locally after the fact.
« 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