| OLD | NEW |
| 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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub | 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub |
| 6 /// tests are integration tests that stage some stuff on the file system, run | 6 /// tests are integration tests that stage some stuff on the file system, run |
| 7 /// pub, and then validate the results. This library provides an API to build | 7 /// pub, and then validate the results. This library provides an API to build |
| 8 /// tests like that. | 8 /// tests like that. |
| 9 library test_pub; | 9 library test_pub; |
| 10 | 10 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 void solo_integration(String description, void body()) => | 243 void solo_integration(String description, void body()) => |
| 244 _integration(description, body, solo_test); | 244 _integration(description, body, solo_test); |
| 245 | 245 |
| 246 void _integration(String description, void body(), [Function testFn]) { | 246 void _integration(String description, void body(), [Function testFn]) { |
| 247 testFn(description, () { | 247 testFn(description, () { |
| 248 // The windows bots are very slow, so we increase the default timeout. | 248 // The windows bots are very slow, so we increase the default timeout. |
| 249 if (Platform.operatingSystem == "windows") { | 249 if (Platform.operatingSystem == "windows") { |
| 250 currentSchedule.timeout = new Duration(seconds: 10); | 250 currentSchedule.timeout = new Duration(seconds: 10); |
| 251 } | 251 } |
| 252 | 252 |
| 253 // By default, don't capture stack traces since they slow the tests way | |
| 254 // down. To debug failing tests, comment this out. | |
| 255 currentSchedule.captureStackTraces = | |
| 256 new Options().arguments.contains('--trace'); | |
| 257 | |
| 258 // Ensure the SDK version is always available. | 253 // Ensure the SDK version is always available. |
| 259 d.dir(sdkPath, [ | 254 d.dir(sdkPath, [ |
| 260 d.file('version', '0.1.2.3') | 255 d.file('version', '0.1.2.3') |
| 261 ]).create(); | 256 ]).create(); |
| 262 | 257 |
| 263 _sandboxDir = createTempDir(); | 258 _sandboxDir = createTempDir(); |
| 264 d.defaultRoot = sandboxDir; | 259 d.defaultRoot = sandboxDir; |
| 265 currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), | 260 currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), |
| 266 'deleting the sandbox directory'); | 261 'deleting the sandbox directory'); |
| 267 | 262 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 bool matches(item, MatchState matchState) { | 611 bool matches(item, MatchState matchState) { |
| 617 if (item is! Pair) return false; | 612 if (item is! Pair) return false; |
| 618 return _firstMatcher.matches(item.first, matchState) && | 613 return _firstMatcher.matches(item.first, matchState) && |
| 619 _lastMatcher.matches(item.last, matchState); | 614 _lastMatcher.matches(item.last, matchState); |
| 620 } | 615 } |
| 621 | 616 |
| 622 Description describe(Description description) { | 617 Description describe(Description description) { |
| 623 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 618 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 624 } | 619 } |
| 625 } | 620 } |
| OLD | NEW |