Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 import '../lib/src/system_cache.dart'; | 32 import '../lib/src/system_cache.dart'; |
| 33 import '../lib/src/utils.dart'; | 33 import '../lib/src/utils.dart'; |
| 34 import '../lib/src/validator.dart'; | 34 import '../lib/src/validator.dart'; |
| 35 import 'descriptor.dart' as d; | 35 import 'descriptor.dart' as d; |
| 36 | 36 |
| 37 /// This should be called at the top of a test file to set up an appropriate | 37 /// This should be called at the top of a test file to set up an appropriate |
| 38 /// test configuration for the machine running the tests. | 38 /// test configuration for the machine running the tests. |
| 39 initConfig() { | 39 initConfig() { |
| 40 useCompactVMConfiguration(); | 40 useCompactVMConfiguration(); |
| 41 filterStacks = true; | 41 filterStacks = true; |
| 42 unittestConfiguration.timeout = const Duration(seconds: 60); | |
|
kustermann
2013/09/03 07:32:38
That's not the best thing to do. If this test is r
| |
| 42 } | 43 } |
| 43 | 44 |
| 44 /// Returns whether we're running on a Dart build bot. | 45 /// Returns whether we're running on a Dart build bot. |
| 45 bool get runningOnBuildbot => | 46 bool get runningOnBuildbot => |
| 46 Platform.environment.containsKey('BUILDBOT_BUILDERNAME'); | 47 Platform.environment.containsKey('BUILDBOT_BUILDERNAME'); |
| 47 | 48 |
| 48 /// The current [HttpServer] created using [serve]. | 49 /// The current [HttpServer] created using [serve]. |
| 49 var _server; | 50 var _server; |
| 50 | 51 |
| 51 /// The list of paths that have been requested from the server since the last | 52 /// The list of paths that have been requested from the server since the last |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 bool matches(item, Map matchState) { | 786 bool matches(item, Map matchState) { |
| 786 if (item is! Pair) return false; | 787 if (item is! Pair) return false; |
| 787 return _firstMatcher.matches(item.first, matchState) && | 788 return _firstMatcher.matches(item.first, matchState) && |
| 788 _lastMatcher.matches(item.last, matchState); | 789 _lastMatcher.matches(item.last, matchState); |
| 789 } | 790 } |
| 790 | 791 |
| 791 Description describe(Description description) { | 792 Description describe(Description description) { |
| 792 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 793 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 793 } | 794 } |
| 794 } | 795 } |
| OLD | NEW |