| 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 |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 import 'dart:collection' show Queue; | |
| 13 import 'dart:io'; | 12 import 'dart:io'; |
| 14 import 'dart:json' as json; | 13 import 'dart:json' as json; |
| 15 import 'dart:math'; | 14 import 'dart:math'; |
| 16 import 'dart:utf'; | |
| 17 | 15 |
| 18 import 'package:http/testing.dart'; | 16 import 'package:http/testing.dart'; |
| 19 import 'package:oauth2/oauth2.dart' as oauth2; | |
| 20 import 'package:path/path.dart' as path; | 17 import 'package:path/path.dart' as path; |
| 21 import 'package:scheduled_test/scheduled_process.dart'; | 18 import 'package:scheduled_test/scheduled_process.dart'; |
| 22 import 'package:scheduled_test/scheduled_server.dart'; | 19 import 'package:scheduled_test/scheduled_server.dart'; |
| 23 import 'package:scheduled_test/scheduled_test.dart'; | 20 import 'package:scheduled_test/scheduled_test.dart'; |
| 24 import 'package:unittest/compact_vm_config.dart'; | 21 import 'package:unittest/compact_vm_config.dart'; |
| 25 import 'package:yaml/yaml.dart'; | |
| 26 | 22 |
| 27 import '../lib/src/entrypoint.dart'; | 23 import '../lib/src/entrypoint.dart'; |
| 28 // TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides | 24 // TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides |
| 29 // with the git descriptor method. Maybe we should try to clean up the top level | 25 // with the git descriptor method. Maybe we should try to clean up the top level |
| 30 // scope a bit? | 26 // scope a bit? |
| 31 import '../lib/src/git.dart' as gitlib; | 27 import '../lib/src/git.dart' as gitlib; |
| 32 import '../lib/src/http.dart'; | 28 import '../lib/src/http.dart'; |
| 33 import '../lib/src/io.dart'; | 29 import '../lib/src/io.dart'; |
| 34 import '../lib/src/log.dart' as log; | 30 import '../lib/src/log.dart' as log; |
| 35 import '../lib/src/safe_http_server.dart'; | 31 import '../lib/src/safe_http_server.dart'; |
| 36 import '../lib/src/source/git.dart'; | |
| 37 import '../lib/src/source/hosted.dart'; | |
| 38 import '../lib/src/source/path.dart'; | |
| 39 import '../lib/src/system_cache.dart'; | 32 import '../lib/src/system_cache.dart'; |
| 40 import '../lib/src/utils.dart'; | 33 import '../lib/src/utils.dart'; |
| 41 import '../lib/src/validator.dart'; | 34 import '../lib/src/validator.dart'; |
| 42 import 'descriptor.dart' as d; | 35 import 'descriptor.dart' as d; |
| 43 | 36 |
| 44 /// 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 |
| 45 /// test configuration for the machine running the tests. | 38 /// test configuration for the machine running the tests. |
| 46 initConfig() { | 39 initConfig() { |
| 47 useCompactVMConfiguration(); | 40 useCompactVMConfiguration(); |
| 48 } | 41 } |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 bool matches(item, Map matchState) { | 751 bool matches(item, Map matchState) { |
| 759 if (item is! Pair) return false; | 752 if (item is! Pair) return false; |
| 760 return _firstMatcher.matches(item.first, matchState) && | 753 return _firstMatcher.matches(item.first, matchState) && |
| 761 _lastMatcher.matches(item.last, matchState); | 754 _lastMatcher.matches(item.last, matchState); |
| 762 } | 755 } |
| 763 | 756 |
| 764 Description describe(Description description) { | 757 Description describe(Description description) { |
| 765 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 758 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 766 } | 759 } |
| 767 } | 760 } |
| OLD | NEW |