| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub | 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub |
| 7 * tests are integration tests that stage some stuff on the file system, run | 7 * tests are integration tests that stage some stuff on the file system, run |
| 8 * pub, and then validate the results. This library provides an API to build | 8 * pub, and then validate the results. This library provides an API to build |
| 9 * tests like that. | 9 * tests like that. |
| 10 */ | 10 */ |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 | 623 |
| 624 // If the executable looks like a path, get its full path. That way we | 624 // If the executable looks like a path, get its full path. That way we |
| 625 // can still find it when we spawn it with a different working directory. | 625 // can still find it when we spawn it with a different working directory. |
| 626 if (dartBin.contains(Platform.pathSeparator)) { | 626 if (dartBin.contains(Platform.pathSeparator)) { |
| 627 dartBin = new File(dartBin).fullPathSync(); | 627 dartBin = new File(dartBin).fullPathSync(); |
| 628 } | 628 } |
| 629 | 629 |
| 630 // Find the main pub entrypoint. | 630 // Find the main pub entrypoint. |
| 631 var pubPath = fs.joinPaths(testDirectory, '../../pub/pub.dart'); | 631 var pubPath = fs.joinPaths(testDirectory, '../../pub/pub.dart'); |
| 632 | 632 |
| 633 var dartArgs = | 633 var dartArgs = ['--checked', pubPath, '--trace']; |
| 634 ['--enable-type-checks', '--enable-asserts', pubPath, '--trace']; | |
| 635 dartArgs.addAll(args); | 634 dartArgs.addAll(args); |
| 636 | 635 |
| 637 var environment = { | 636 var environment = { |
| 638 'PUB_CACHE': pathInSandbox(cachePath), | 637 'PUB_CACHE': pathInSandbox(cachePath), |
| 639 'DART_SDK': pathInSandbox(sdkPath) | 638 'DART_SDK': pathInSandbox(sdkPath) |
| 640 }; | 639 }; |
| 640 |
| 641 if (tokenEndpoint != null) { | 641 if (tokenEndpoint != null) { |
| 642 environment['_PUB_TEST_TOKEN_ENDPOINT'] = tokenEndpoint.toString(); | 642 environment['_PUB_TEST_TOKEN_ENDPOINT'] = tokenEndpoint.toString(); |
| 643 } | 643 } |
| 644 | 644 |
| 645 return fn(dartBin, dartArgs, workingDir: pathInSandbox(appPath), | 645 return fn(dartBin, dartArgs, workingDir: pathInSandbox(appPath), |
| 646 environment: environment); | 646 environment: environment); |
| 647 }); | 647 }); |
| 648 } | 648 } |
| 649 | 649 |
| 650 /** | 650 /** |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 /// calling [completion] is unnecessary. | 1537 /// calling [completion] is unnecessary. |
| 1538 void expectLater(Future actual, matcher, {String reason, | 1538 void expectLater(Future actual, matcher, {String reason, |
| 1539 FailureHandler failureHandler, bool verbose: false}) { | 1539 FailureHandler failureHandler, bool verbose: false}) { |
| 1540 _schedule((_) { | 1540 _schedule((_) { |
| 1541 return actual.transform((value) { | 1541 return actual.transform((value) { |
| 1542 expect(value, matcher, reason: reason, failureHandler: failureHandler, | 1542 expect(value, matcher, reason: reason, failureHandler: failureHandler, |
| 1543 verbose: false); | 1543 verbose: false); |
| 1544 }); | 1544 }); |
| 1545 }); | 1545 }); |
| 1546 } | 1546 } |
| OLD | NEW |