Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #library("test_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
| 9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 expectations)); | 96 expectations)); |
| 97 | 97 |
| 98 receiveTestName.receive(testNameHandler); | 98 receiveTestName.receive(testNameHandler); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 void forEachTest(Function onTest, [Function onDone]) { | 102 void forEachTest(Function onTest, [Function onDone]) { |
| 103 doTest = onTest; | 103 doTest = onTest; |
| 104 doDone = (ignore) => (onDone != null) ? onDone() : null; | 104 doDone = (ignore) => (onDone != null) ? onDone() : null; |
| 105 | 105 |
| 106 var filesRead = 0; | |
| 107 void statusFileRead() { | |
| 108 filesRead++; | |
| 109 if (filesRead == statusFilePaths.length) { | |
| 110 receiveTestName = new ReceivePort(); | |
| 111 new CCTestListerIsolate().spawn().then((port) { | |
| 112 port.send(runnerPath, receiveTestName.toSendPort()); | |
| 113 receiveTestName.receive(testNameHandler); | |
| 114 }); | |
| 115 } | |
| 116 } | |
| 117 | |
| 106 testExpectations = | 118 testExpectations = |
| 107 new TestExpectations(complexMatching: complexStatusMatching()); | 119 new TestExpectations(complexMatching: complexStatusMatching()); |
| 108 for (var statusFilePath in statusFilePaths) { | 120 for (var statusFilePath in statusFilePaths) { |
| 109 ReadTestExpectationsInto(testExpectations, | 121 ReadTestExpectationsInto(testExpectations, |
| 110 statusFilePath, | 122 statusFilePath, |
| 111 configuration); | 123 configuration, |
| 124 statusFileRead); | |
| 112 } | 125 } |
| 113 | |
| 114 receiveTestName = new ReceivePort(); | |
| 115 new CCTestListerIsolate().spawn().then((port) { | |
| 116 port.send(runnerPath, receiveTestName.toSendPort()); | |
| 117 receiveTestName.receive(testNameHandler); | |
| 118 }); | |
| 119 } | 126 } |
| 120 | 127 |
| 121 void completeHandler(TestCase testCase) { | 128 void completeHandler(TestCase testCase) { |
| 122 } | 129 } |
| 123 } | 130 } |
| 124 | 131 |
| 125 | 132 |
| 126 class StandardTestSuite implements TestSuite { | 133 class StandardTestSuite implements TestSuite { |
| 127 Map configuration; | 134 Map configuration; |
| 128 String suiteName; | 135 String suiteName; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 146 void complexStatusMatching() => false; | 153 void complexStatusMatching() => false; |
| 147 | 154 |
| 148 String shellPath() => TestUtils.dartShellFileName(configuration); | 155 String shellPath() => TestUtils.dartShellFileName(configuration); |
| 149 | 156 |
| 150 List<String> additionalOptions() => []; | 157 List<String> additionalOptions() => []; |
| 151 | 158 |
| 152 void forEachTest(Function onTest, [Function onDone = null]) { | 159 void forEachTest(Function onTest, [Function onDone = null]) { |
| 153 doTest = onTest; | 160 doTest = onTest; |
| 154 doDone = (onDone != null) ? onDone : (() => null); | 161 doDone = (onDone != null) ? onDone : (() => null); |
| 155 | 162 |
| 163 var filesRead = 0; | |
| 164 void statusFileRead() { | |
| 165 filesRead++; | |
| 166 if (filesRead == statusFilePaths.length) { | |
| 167 processDirectory(); | |
| 168 } | |
| 169 } | |
| 170 | |
| 156 // Read test expectations from status files. | 171 // Read test expectations from status files. |
| 157 testExpectations = | 172 testExpectations = |
| 158 new TestExpectations(complexMatching: complexStatusMatching()); | 173 new TestExpectations(complexMatching: complexStatusMatching()); |
| 174 List<Future> fut = new List(); | |
|
Mads Ager (google)
2011/12/09 13:09:33
fut fut, delete?
Søren Gjesse
2011/12/09 13:36:43
Done.
| |
| 159 for (var statusFilePath in statusFilePaths) { | 175 for (var statusFilePath in statusFilePaths) { |
| 160 ReadTestExpectationsInto(testExpectations, | 176 ReadTestExpectationsInto(testExpectations, |
| 161 statusFilePath, | 177 statusFilePath, |
| 162 configuration); | 178 configuration, |
| 179 statusFileRead); | |
| 163 } | 180 } |
| 164 | |
| 165 processDirectory(); | |
| 166 } | 181 } |
| 167 | 182 |
| 168 void processDirectory() { | 183 void processDirectory() { |
| 169 directoryPath = getDirname(directoryPath); | 184 directoryPath = getDirname(directoryPath); |
| 170 Directory dir = new Directory(directoryPath); | 185 Directory dir = new Directory(directoryPath); |
| 171 dir.errorHandler = (s) { | 186 dir.errorHandler = (s) { |
| 172 throw s; | 187 throw s; |
| 173 }; | 188 }; |
| 174 dir.fileHandler = processFile; | 189 dir.fileHandler = processFile; |
| 175 dir.doneHandler = directoryListingDone; | 190 dir.doneHandler = directoryListingDone; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 * $noCrash tests are expected to be flaky but not crash | 556 * $noCrash tests are expected to be flaky but not crash |
| 542 * $pass tests are expected to pass | 557 * $pass tests are expected to pass |
| 543 * $failOk tests are expected to fail that we won't fix | 558 * $failOk tests are expected to fail that we won't fix |
| 544 * $fail tests are expected to fail that we should fix | 559 * $fail tests are expected to fail that we should fix |
| 545 * $crash tests are expected to crash that we should fix | 560 * $crash tests are expected to crash that we should fix |
| 546 * $timeout tests are allowed to timeout\ | 561 * $timeout tests are allowed to timeout\ |
| 547 """; | 562 """; |
| 548 print(report); | 563 print(report); |
| 549 } | 564 } |
| 550 } | 565 } |
| OLD | NEW |