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 executing tests. | 6 * Classes and methods for executing tests. |
7 * | 7 * |
8 * This module includes: | 8 * This module includes: |
9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 | 754 |
755 Configuration configuration; | 755 Configuration configuration; |
756 String displayName; | 756 String displayName; |
757 int _expectations = 0; | 757 int _expectations = 0; |
758 int hash = 0; | 758 int hash = 0; |
759 Set<Expectation> expectedOutcomes; | 759 Set<Expectation> expectedOutcomes; |
760 | 760 |
761 TestCase(this.displayName, this.commands, this.configuration, | 761 TestCase(this.displayName, this.commands, this.configuration, |
762 this.expectedOutcomes, | 762 this.expectedOutcomes, |
763 {bool isNegative: false, TestInformation info}) { | 763 {bool isNegative: false, TestInformation info}) { |
| 764 // A test case should do something. |
| 765 assert(commands.isNotEmpty); |
| 766 |
764 if (isNegative || displayName.contains("negative_test")) { | 767 if (isNegative || displayName.contains("negative_test")) { |
765 _expectations |= IS_NEGATIVE; | 768 _expectations |= IS_NEGATIVE; |
766 } | 769 } |
767 if (info != null) { | 770 if (info != null) { |
768 _setExpectations(info); | 771 _setExpectations(info); |
769 hash = | 772 hash = |
770 info.originTestPath.relativeTo(TestUtils.dartDir).toString().hashCode; | 773 info.originTestPath.relativeTo(TestUtils.dartDir).toString().hashCode; |
771 } | 774 } |
772 } | 775 } |
773 | 776 |
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 } | 3234 } |
3232 } | 3235 } |
3233 | 3236 |
3234 void eventAllTestsDone() { | 3237 void eventAllTestsDone() { |
3235 for (var listener in _eventListener) { | 3238 for (var listener in _eventListener) { |
3236 listener.allDone(); | 3239 listener.allDone(); |
3237 } | 3240 } |
3238 _allDone(); | 3241 _allDone(); |
3239 } | 3242 } |
3240 } | 3243 } |
OLD | NEW |