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 /** | 5 /** |
6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
7 * | 7 * |
8 * This library includes: | 8 * This library includes: |
9 * | 9 * |
10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 * marked as completed, otherwise you'll get an exception indicating that a | 72 * marked as completed, otherwise you'll get an exception indicating that a |
73 * future has already been completed). | 73 * future has already been completed). |
74 */ | 74 */ |
75 void add(Future task) { | 75 void add(Future task) { |
76 if (_pending == _FINISHED) { | 76 if (_pending == _FINISHED) { |
77 throw new Exception("FutureFutureAlreadyCompleteException"); | 77 throw new Exception("FutureFutureAlreadyCompleteException"); |
78 } | 78 } |
79 _pending++; | 79 _pending++; |
80 var handledTaskFuture = task.catchError((e) { | 80 var handledTaskFuture = task.catchError((e) { |
81 if (!wasCompleted) { | 81 if (!wasCompleted) { |
82 _completer.completeError(e.error, e.stackTrace); | 82 _completer.completeError(e); |
83 wasCompleted = true; | 83 wasCompleted = true; |
84 } | 84 } |
85 }).then((_) { | 85 }).then((_) { |
86 _pending--; | 86 _pending--; |
87 if (_pending == 0) { | 87 if (_pending == 0) { |
88 _pending = _FINISHED; | 88 _pending = _FINISHED; |
89 if (!wasCompleted) { | 89 if (!wasCompleted) { |
90 _completer.complete(futures); | 90 _completer.complete(futures); |
91 wasCompleted = true; | 91 wasCompleted = true; |
92 } | 92 } |
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 * $pass tests are expected to pass | 1938 * $pass tests are expected to pass |
1939 * $failOk tests are expected to fail that we won't fix | 1939 * $failOk tests are expected to fail that we won't fix |
1940 * $fail tests are expected to fail that we should fix | 1940 * $fail tests are expected to fail that we should fix |
1941 * $crash tests are expected to crash that we should fix | 1941 * $crash tests are expected to crash that we should fix |
1942 * $timeout tests are allowed to timeout | 1942 * $timeout tests are allowed to timeout |
1943 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1943 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
1944 """; | 1944 """; |
1945 print(report); | 1945 print(report); |
1946 } | 1946 } |
1947 } | 1947 } |
OLD | NEW |