Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 17406010: Move getters from Options to Platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed Dart_GetType Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/sdk.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 /// Any futures in [args] will be resolved before the process is started. 429 /// Any futures in [args] will be resolved before the process is started.
430 ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) { 430 ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
431 String pathInSandbox(String relPath) { 431 String pathInSandbox(String relPath) {
432 return path.join(path.absolute(sandboxDir), relPath); 432 return path.join(path.absolute(sandboxDir), relPath);
433 } 433 }
434 434
435 ensureDir(pathInSandbox(appPath)); 435 ensureDir(pathInSandbox(appPath));
436 436
437 // Find a Dart executable we can use to spawn. Use the same one that was 437 // Find a Dart executable we can use to spawn. Use the same one that was
438 // used to run this script itself. 438 // used to run this script itself.
439 var dartBin = new Options().executable; 439 var dartBin = Platform.executable;
440 440
441 // If the executable looks like a path, get its full path. That way we 441 // If the executable looks like a path, get its full path. That way we
442 // can still find it when we spawn it with a different working directory. 442 // can still find it when we spawn it with a different working directory.
443 if (dartBin.contains(Platform.pathSeparator)) { 443 if (dartBin.contains(Platform.pathSeparator)) {
444 dartBin = path.absolute(dartBin); 444 dartBin = path.absolute(dartBin);
445 } 445 }
446 446
447 // Find the main pub entrypoint. 447 // Find the main pub entrypoint.
448 var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart'); 448 var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart');
449 449
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 _stderr = pair.first; 548 _stderr = pair.first;
549 return pair.last; 549 return pair.last;
550 } 550 }
551 } 551 }
552 552
553 // TODO(nweiz): use the built-in mechanism for accessing this once it exists 553 // TODO(nweiz): use the built-in mechanism for accessing this once it exists
554 // (issue 9119). 554 // (issue 9119).
555 /// The path to the `packages` directory from which pub loads its dependencies. 555 /// The path to the `packages` directory from which pub loads its dependencies.
556 String get _packageRoot { 556 String get _packageRoot {
557 return path.absolute(path.join( 557 return path.absolute(path.join(
558 path.dirname(new Options().executable), '..', '..', 'packages')); 558 path.dirname(Platform.executable), '..', '..', 'packages'));
559 } 559 }
560 560
561 /// Skips the current test if Git is not installed. This validates that the 561 /// Skips the current test if Git is not installed. This validates that the
562 /// current test is running on a buildbot in which case we expect git to be 562 /// current test is running on a buildbot in which case we expect git to be
563 /// installed. If we are not running on the buildbot, we will instead see if 563 /// installed. If we are not running on the buildbot, we will instead see if
564 /// git is installed and skip the test if not. This way, users don't need to 564 /// git is installed and skip the test if not. This way, users don't need to
565 /// have git installed to run the tests locally (unless they actually care 565 /// have git installed to run the tests locally (unless they actually care
566 /// about the pub git tests). 566 /// about the pub git tests).
567 /// 567 ///
568 /// This will also increase the [Schedule] timeout to 30 seconds on Windows, 568 /// This will also increase the [Schedule] timeout to 30 seconds on Windows,
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 bool matches(item, Map matchState) { 794 bool matches(item, Map matchState) {
795 if (item is! Pair) return false; 795 if (item is! Pair) return false;
796 return _firstMatcher.matches(item.first, matchState) && 796 return _firstMatcher.matches(item.first, matchState) &&
797 _lastMatcher.matches(item.last, matchState); 797 _lastMatcher.matches(item.last, matchState);
798 } 798 }
799 799
800 Description describe(Description description) { 800 Description describe(Description description) {
801 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 801 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
802 } 802 }
803 } 803 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/sdk.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698