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

Side by Side Diff: pkg/unittest/lib/compact_vm_config.dart

Issue 101753006: Fix printing of compact_vm_config when test status change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * A test configuration that generates a compact 1-line progress bar. The bar is 6 * A test configuration that generates a compact 1-line progress bar. The bar is
7 * updated in-place before and after each test is executed. If all test pass, 7 * updated in-place before and after each test is executed. If all test pass,
8 * you should only see a couple lines in the terminal. If a test fails, the 8 * you should only see a couple lines in the terminal. If a test fails, the
9 * failure is shown and the progress bar continues to be updated below it. 9 * failure is shown and the progress bar continues to be updated below it.
10 */ 10 */
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (test.message != '') { 60 if (test.message != '') {
61 print(indent(test.message)); 61 print(indent(test.message));
62 } 62 }
63 63
64 if (test.stackTrace != null) { 64 if (test.stackTrace != null) {
65 print(indent(test.stackTrace.toString())); 65 print(indent(test.stackTrace.toString()));
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 void onTestResultChanged(TestCase test) {
71 _pass--;
72 _fail++;
73 _progressLine(_start, _pass, _fail, test.description);
74 print('');
75 if (test.message != '') {
76 print(indent(test.message));
77 }
78
79 if (test.stackTrace != null) {
80 print(indent(test.stackTrace.toString()));
81 }
82 }
83
70 void onDone(bool success) { 84 void onDone(bool success) {
71 // Override and don't call the superclass onDone() to avoid printing the 85 // Override and don't call the superclass onDone() to avoid printing the
72 // "unittest-suite-..." boilerplate. 86 // "unittest-suite-..." boilerplate.
73 Future.wait([stdout.close(), stderr.close()]).then((_) { 87 Future.wait([stdout.close(), stderr.close()]).then((_) {
74 _receivePort.close(); 88 _receivePort.close();
75 exit(success ? 0 : 1); 89 exit(success ? 0 : 1);
76 }); 90 });
77 } 91 }
78 92
79 void onSummary(int passed, int failed, int errors, List<TestCase> results, 93 void onSummary(int passed, int failed, int errors, List<TestCase> results,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // If the test is running on the Dart buildbots, we don't want to use this 205 // If the test is running on the Dart buildbots, we don't want to use this
192 // config since it's output may not be what the bots expect. 206 // config since it's output may not be what the bots expect.
193 if (Platform.environment['LOGNAME'] == 'chrome-bot') { 207 if (Platform.environment['LOGNAME'] == 'chrome-bot') {
194 return; 208 return;
195 } 209 }
196 210
197 unittestConfiguration = _singleton; 211 unittestConfiguration = _singleton;
198 } 212 }
199 213
200 final _singleton = new CompactVMConfiguration(); 214 final _singleton = new CompactVMConfiguration();
OLDNEW
« no previous file with comments | « no previous file | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698