| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // The windows bots are very slow, so we increase the default timeout. | 330 // The windows bots are very slow, so we increase the default timeout. |
| 331 if (Platform.operatingSystem == "windows") { | 331 if (Platform.operatingSystem == "windows") { |
| 332 currentSchedule.timeout = new Duration(seconds: 10); | 332 currentSchedule.timeout = new Duration(seconds: 10); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // Ensure the SDK version is always available. | 335 // Ensure the SDK version is always available. |
| 336 d.dir(sdkPath, [ | 336 d.dir(sdkPath, [ |
| 337 d.file('version', '0.1.2.3') | 337 d.file('version', '0.1.2.3') |
| 338 ]).create(); | 338 ]).create(); |
| 339 | 339 |
| 340 _sandboxDir = createTempDir(); | 340 _sandboxDir = createSystemTempDir(); |
| 341 d.defaultRoot = sandboxDir; | 341 d.defaultRoot = sandboxDir; |
| 342 currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), | 342 currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), |
| 343 'deleting the sandbox directory'); | 343 'deleting the sandbox directory'); |
| 344 | 344 |
| 345 // Schedule the test. | 345 // Schedule the test. |
| 346 body(); | 346 body(); |
| 347 }); | 347 }); |
| 348 } | 348 } |
| 349 | 349 |
| 350 /// Get the path to the root "pub/test" directory containing the pub | 350 /// Get the path to the root "pub/test" directory containing the pub |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 bool matches(item, Map matchState) { | 836 bool matches(item, Map matchState) { |
| 837 if (item is! Pair) return false; | 837 if (item is! Pair) return false; |
| 838 return _firstMatcher.matches(item.first, matchState) && | 838 return _firstMatcher.matches(item.first, matchState) && |
| 839 _lastMatcher.matches(item.last, matchState); | 839 _lastMatcher.matches(item.last, matchState); |
| 840 } | 840 } |
| 841 | 841 |
| 842 Description describe(Description description) { | 842 Description describe(Description description) { |
| 843 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 843 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 844 } | 844 } |
| 845 } | 845 } |
| OLD | NEW |