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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 465 |
466 // If the executable looks like a path, get its full path. That way we | 466 // If the executable looks like a path, get its full path. That way we |
467 // can still find it when we spawn it with a different working directory. | 467 // can still find it when we spawn it with a different working directory. |
468 if (dartBin.contains(Platform.pathSeparator)) { | 468 if (dartBin.contains(Platform.pathSeparator)) { |
469 dartBin = path.absolute(dartBin); | 469 dartBin = path.absolute(dartBin); |
470 } | 470 } |
471 | 471 |
472 // Find the main pub entrypoint. | 472 // Find the main pub entrypoint. |
473 var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart'); | 473 var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart'); |
474 | 474 |
475 var dartArgs = ['--package-root=$_packageRoot/', '--checked', pubPath, | 475 var dartArgs = [ |
476 '--verbose']; | 476 '--package-root=$_packageRoot/', |
| 477 // Make the heap bigger since dart2js uses a lot of memory. |
| 478 '--new_gen_heap_size=256', '--old_gen_heap_size=1536', |
| 479 '--checked', pubPath, '--verbose' |
| 480 ]; |
477 dartArgs.addAll(args); | 481 dartArgs.addAll(args); |
478 | 482 |
479 if (tokenEndpoint == null) tokenEndpoint = new Future.value(); | 483 if (tokenEndpoint == null) tokenEndpoint = new Future.value(); |
480 var environmentFuture = tokenEndpoint.then((tokenEndpoint) { | 484 var environmentFuture = tokenEndpoint.then((tokenEndpoint) { |
481 var environment = {}; | 485 var environment = {}; |
482 environment['_PUB_TESTING'] = 'true'; | 486 environment['_PUB_TESTING'] = 'true'; |
483 environment['PUB_CACHE'] = pathInSandbox(cachePath); | 487 environment['PUB_CACHE'] = pathInSandbox(cachePath); |
484 environment['DART_SDK'] = pathInSandbox(sdkPath); | 488 environment['DART_SDK'] = pathInSandbox(sdkPath); |
485 if (tokenEndpoint != null) { | 489 if (tokenEndpoint != null) { |
486 environment['_PUB_TEST_TOKEN_ENDPOINT'] = | 490 environment['_PUB_TEST_TOKEN_ENDPOINT'] = |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 bool matches(item, Map matchState) { | 845 bool matches(item, Map matchState) { |
842 if (item is! Pair) return false; | 846 if (item is! Pair) return false; |
843 return _firstMatcher.matches(item.first, matchState) && | 847 return _firstMatcher.matches(item.first, matchState) && |
844 _lastMatcher.matches(item.last, matchState); | 848 _lastMatcher.matches(item.last, matchState); |
845 } | 849 } |
846 | 850 |
847 Description describe(Description description) { | 851 Description describe(Description description) { |
848 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 852 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
849 } | 853 } |
850 } | 854 } |
OLD | NEW |