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

Side by Side Diff: pkg/testing/lib/src/log.dart

Issue 2626003003: Implement multitest expectations. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library testing.log; 5 library testing.log;
6 6
7 import 'chain.dart' show 7 import 'chain.dart' show
8 Result, 8 Result,
9 Step; 9 Step;
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (isVerbose) { 70 if (isVerbose) {
71 print(message); 71 print(message);
72 } else { 72 } else {
73 print("$eraseLine$message$cursorUp"); 73 print("$eraseLine$message$cursorUp");
74 } 74 }
75 } 75 }
76 76
77 String formatProgress(int completed, int failed, int total) { 77 String formatProgress(int completed, int failed, int total) {
78 Duration elapsed = wallclock.elapsed; 78 Duration elapsed = wallclock.elapsed;
79 String percent = pad((completed / total * 100.0).toStringAsFixed(1), 5); 79 String percent = pad((completed / total * 100.0).toStringAsFixed(1), 5);
80 String good = pad(completed, 5); 80 String good = pad(completed - failed, 5);
81 String bad = pad(failed, 5); 81 String bad = pad(failed, 5);
82 String minutes = pad(elapsed.inMinutes, 2, filler: "0"); 82 String minutes = pad(elapsed.inMinutes, 2, filler: "0");
83 String seconds = pad(elapsed.inSeconds % 60, 2, filler: "0"); 83 String seconds = pad(elapsed.inSeconds % 60, 2, filler: "0");
84 return "[ $minutes:$seconds | $percent% | +$good | -$bad ]"; 84 return "[ $minutes:$seconds | $percent% | +$good | -$bad ]";
85 } 85 }
86 86
87 String formatTestDescription(Suite suite, TestDescription description) { 87 String formatTestDescription(Suite suite, TestDescription description) {
88 return "${suite.name}/${description.shortName}"; 88 return "${suite.name}/${description.shortName}";
89 } 89 }
90 90
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 paddedLineNumber.substring(paddedLineNumber.length - pad); 155 paddedLineNumber.substring(paddedLineNumber.length - pad);
156 result.write("$paddedLineNumber: $line"); 156 result.write("$paddedLineNumber: $line");
157 lineNumber++; 157 lineNumber++;
158 } 158 }
159 return '$result'; 159 return '$result';
160 } 160 }
161 161
162 List<String> splitLines(String text) { 162 List<String> splitLines(String text) {
163 return text.split(new RegExp('^', multiLine: true)); 163 return text.split(new RegExp('^', multiLine: true));
164 } 164 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698