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

Side by Side Diff: lib/src/runner/configuration.dart

Issue 2184543002: Use the package_resolver package. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | lib/src/runner/configuration/args.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:boolean_selector/boolean_selector.dart'; 7 import 'package:boolean_selector/boolean_selector.dart';
8 import 'package:collection/collection.dart'; 8 import 'package:collection/collection.dart';
9 import 'package:glob/glob.dart'; 9 import 'package:glob/glob.dart';
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /// The selector indicating which platforms the tests support. 61 /// The selector indicating which platforms the tests support.
62 /// 62 ///
63 /// When [merge]d, this is intersected with the other configuration's 63 /// When [merge]d, this is intersected with the other configuration's
64 /// supported platforms. 64 /// supported platforms.
65 final PlatformSelector testOn; 65 final PlatformSelector testOn;
66 66
67 /// Whether to pause for debugging after loading each test suite. 67 /// Whether to pause for debugging after loading each test suite.
68 bool get pauseAfterLoad => _pauseAfterLoad ?? false; 68 bool get pauseAfterLoad => _pauseAfterLoad ?? false;
69 final bool _pauseAfterLoad; 69 final bool _pauseAfterLoad;
70 70
71 /// The package root for resolving "package:" URLs.
72 String get packageRoot => _packageRoot ?? p.join(p.current, 'packages');
73 final String _packageRoot;
74
75 /// The path to dart2js. 71 /// The path to dart2js.
76 String get dart2jsPath => _dart2jsPath ?? p.join(sdkDir, 'bin', 'dart2js'); 72 String get dart2jsPath => _dart2jsPath ?? p.join(sdkDir, 'bin', 'dart2js');
77 final String _dart2jsPath; 73 final String _dart2jsPath;
78 74
79 /// Additional arguments to pass to dart2js. 75 /// Additional arguments to pass to dart2js.
80 final List<String> dart2jsArgs; 76 final List<String> dart2jsArgs;
81 77
82 /// The path to a mirror of this package containing precompiled JS. 78 /// The path to a mirror of this package containing precompiled JS.
83 /// 79 ///
84 /// This is used by the internal Google test runner so that test compilation 80 /// This is used by the internal Google test runner so that test compilation
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bool help, 272 bool help,
277 bool version, 273 bool version,
278 bool verboseTrace, 274 bool verboseTrace,
279 bool jsTrace, 275 bool jsTrace,
280 bool skip, 276 bool skip,
281 String skipReason, 277 String skipReason,
282 bool runSkipped, 278 bool runSkipped,
283 PlatformSelector testOn, 279 PlatformSelector testOn,
284 bool pauseAfterLoad, 280 bool pauseAfterLoad,
285 bool color, 281 bool color,
286 String packageRoot,
287 String dart2jsPath, 282 String dart2jsPath,
288 Iterable<String> dart2jsArgs, 283 Iterable<String> dart2jsArgs,
289 String precompiledPath, 284 String precompiledPath,
290 String reporter, 285 String reporter,
291 int pubServePort, 286 int pubServePort,
292 int concurrency, 287 int concurrency,
293 int shardIndex, 288 int shardIndex,
294 int totalShards, 289 int totalShards,
295 Timeout timeout, 290 Timeout timeout,
296 Iterable<Pattern> patterns, 291 Iterable<Pattern> patterns,
(...skipping 11 matching lines...) Expand all
308 help: help, 303 help: help,
309 version: version, 304 version: version,
310 verboseTrace: verboseTrace, 305 verboseTrace: verboseTrace,
311 jsTrace: jsTrace, 306 jsTrace: jsTrace,
312 skip: skip, 307 skip: skip,
313 skipReason: skipReason, 308 skipReason: skipReason,
314 runSkipped: runSkipped, 309 runSkipped: runSkipped,
315 testOn: testOn, 310 testOn: testOn,
316 pauseAfterLoad: pauseAfterLoad, 311 pauseAfterLoad: pauseAfterLoad,
317 color: color, 312 color: color,
318 packageRoot: packageRoot,
319 dart2jsPath: dart2jsPath, 313 dart2jsPath: dart2jsPath,
320 dart2jsArgs: dart2jsArgs, 314 dart2jsArgs: dart2jsArgs,
321 precompiledPath: precompiledPath, 315 precompiledPath: precompiledPath,
322 reporter: reporter, 316 reporter: reporter,
323 pubServePort: pubServePort, 317 pubServePort: pubServePort,
324 concurrency: concurrency, 318 concurrency: concurrency,
325 shardIndex: shardIndex, 319 shardIndex: shardIndex,
326 totalShards: totalShards, 320 totalShards: totalShards,
327 timeout: timeout, 321 timeout: timeout,
328 patterns: patterns, 322 patterns: patterns,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 bool help, 373 bool help,
380 bool version, 374 bool version,
381 bool verboseTrace, 375 bool verboseTrace,
382 bool jsTrace, 376 bool jsTrace,
383 bool skip, 377 bool skip,
384 this.skipReason, 378 this.skipReason,
385 bool runSkipped, 379 bool runSkipped,
386 PlatformSelector testOn, 380 PlatformSelector testOn,
387 bool pauseAfterLoad, 381 bool pauseAfterLoad,
388 bool color, 382 bool color,
389 String packageRoot,
390 String dart2jsPath, 383 String dart2jsPath,
391 Iterable<String> dart2jsArgs, 384 Iterable<String> dart2jsArgs,
392 this.precompiledPath, 385 this.precompiledPath,
393 String reporter, 386 String reporter,
394 int pubServePort, 387 int pubServePort,
395 int concurrency, 388 int concurrency,
396 this.shardIndex, 389 this.shardIndex,
397 this.totalShards, 390 this.totalShards,
398 Timeout timeout, 391 Timeout timeout,
399 Iterable<Pattern> patterns, 392 Iterable<Pattern> patterns,
400 Iterable<TestPlatform> platforms, 393 Iterable<TestPlatform> platforms,
401 Iterable<String> paths, 394 Iterable<String> paths,
402 Glob filename, 395 Glob filename,
403 Iterable<String> chosenPresets, 396 Iterable<String> chosenPresets,
404 BooleanSelector includeTags, 397 BooleanSelector includeTags,
405 BooleanSelector excludeTags, 398 BooleanSelector excludeTags,
406 Iterable<String> addTags, 399 Iterable<String> addTags,
407 Map<BooleanSelector, Configuration> tags, 400 Map<BooleanSelector, Configuration> tags,
408 Map<PlatformSelector, Configuration> onPlatform, 401 Map<PlatformSelector, Configuration> onPlatform,
409 Map<String, Configuration> presets}) 402 Map<String, Configuration> presets})
410 : _help = help, 403 : _help = help,
411 _version = version, 404 _version = version,
412 _verboseTrace = verboseTrace, 405 _verboseTrace = verboseTrace,
413 _jsTrace = jsTrace, 406 _jsTrace = jsTrace,
414 _skip = skip, 407 _skip = skip,
415 _runSkipped = runSkipped, 408 _runSkipped = runSkipped,
416 testOn = testOn ?? PlatformSelector.all, 409 testOn = testOn ?? PlatformSelector.all,
417 _pauseAfterLoad = pauseAfterLoad, 410 _pauseAfterLoad = pauseAfterLoad,
418 _color = color, 411 _color = color,
419 _packageRoot = packageRoot,
420 _dart2jsPath = dart2jsPath, 412 _dart2jsPath = dart2jsPath,
421 dart2jsArgs = dart2jsArgs?.toList() ?? [], 413 dart2jsArgs = dart2jsArgs?.toList() ?? [],
422 _reporter = reporter, 414 _reporter = reporter,
423 pubServeUrl = pubServePort == null 415 pubServeUrl = pubServePort == null
424 ? null 416 ? null
425 : Uri.parse("http://localhost:$pubServePort"), 417 : Uri.parse("http://localhost:$pubServePort"),
426 _concurrency = concurrency, 418 _concurrency = concurrency,
427 timeout = (pauseAfterLoad ?? false) 419 timeout = (pauseAfterLoad ?? false)
428 ? Timeout.none 420 ? Timeout.none
429 : (timeout == null ? new Timeout.factor(1) : timeout), 421 : (timeout == null ? new Timeout.factor(1) : timeout),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 help: other._help ?? _help, 476 help: other._help ?? _help,
485 version: other._version ?? _version, 477 version: other._version ?? _version,
486 verboseTrace: other._verboseTrace ?? _verboseTrace, 478 verboseTrace: other._verboseTrace ?? _verboseTrace,
487 jsTrace: other._jsTrace ?? _jsTrace, 479 jsTrace: other._jsTrace ?? _jsTrace,
488 skip: other._skip ?? _skip, 480 skip: other._skip ?? _skip,
489 skipReason: other.skipReason ?? skipReason, 481 skipReason: other.skipReason ?? skipReason,
490 runSkipped: other._runSkipped ?? _runSkipped, 482 runSkipped: other._runSkipped ?? _runSkipped,
491 testOn: testOn.intersection(other.testOn), 483 testOn: testOn.intersection(other.testOn),
492 pauseAfterLoad: other._pauseAfterLoad ?? _pauseAfterLoad, 484 pauseAfterLoad: other._pauseAfterLoad ?? _pauseAfterLoad,
493 color: other._color ?? _color, 485 color: other._color ?? _color,
494 packageRoot: other._packageRoot ?? _packageRoot,
495 dart2jsPath: other._dart2jsPath ?? _dart2jsPath, 486 dart2jsPath: other._dart2jsPath ?? _dart2jsPath,
496 dart2jsArgs: dart2jsArgs.toList()..addAll(other.dart2jsArgs), 487 dart2jsArgs: dart2jsArgs.toList()..addAll(other.dart2jsArgs),
497 precompiledPath: other.precompiledPath ?? precompiledPath, 488 precompiledPath: other.precompiledPath ?? precompiledPath,
498 reporter: other._reporter ?? _reporter, 489 reporter: other._reporter ?? _reporter,
499 pubServePort: (other.pubServeUrl ?? pubServeUrl)?.port, 490 pubServePort: (other.pubServeUrl ?? pubServeUrl)?.port,
500 concurrency: other._concurrency ?? _concurrency, 491 concurrency: other._concurrency ?? _concurrency,
501 shardIndex: other.shardIndex ?? shardIndex, 492 shardIndex: other.shardIndex ?? shardIndex,
502 totalShards: other.totalShards ?? totalShards, 493 totalShards: other.totalShards ?? totalShards,
503 timeout: timeout.merge(other.timeout), 494 timeout: timeout.merge(other.timeout),
504 patterns: patterns.union(other.patterns), 495 patterns: patterns.union(other.patterns),
(...skipping 22 matching lines...) Expand all
527 bool help, 518 bool help,
528 bool version, 519 bool version,
529 bool verboseTrace, 520 bool verboseTrace,
530 bool jsTrace, 521 bool jsTrace,
531 bool skip, 522 bool skip,
532 String skipReason, 523 String skipReason,
533 bool runSkipped, 524 bool runSkipped,
534 PlatformSelector testOn, 525 PlatformSelector testOn,
535 bool pauseAfterLoad, 526 bool pauseAfterLoad,
536 bool color, 527 bool color,
537 String packageRoot,
538 String dart2jsPath, 528 String dart2jsPath,
539 Iterable<String> dart2jsArgs, 529 Iterable<String> dart2jsArgs,
540 String precompiledPath, 530 String precompiledPath,
541 String reporter, 531 String reporter,
542 int pubServePort, 532 int pubServePort,
543 int concurrency, 533 int concurrency,
544 int shardIndex, 534 int shardIndex,
545 int totalShards, 535 int totalShards,
546 Timeout timeout, 536 Timeout timeout,
547 Iterable<Pattern> patterns, 537 Iterable<Pattern> patterns,
(...skipping 11 matching lines...) Expand all
559 help: help ?? _help, 549 help: help ?? _help,
560 version: version ?? _version, 550 version: version ?? _version,
561 verboseTrace: verboseTrace ?? _verboseTrace, 551 verboseTrace: verboseTrace ?? _verboseTrace,
562 jsTrace: jsTrace ?? _jsTrace, 552 jsTrace: jsTrace ?? _jsTrace,
563 skip: skip ?? _skip, 553 skip: skip ?? _skip,
564 skipReason: skipReason ?? this.skipReason, 554 skipReason: skipReason ?? this.skipReason,
565 runSkipped: runSkipped ?? _runSkipped, 555 runSkipped: runSkipped ?? _runSkipped,
566 testOn: testOn ?? this.testOn, 556 testOn: testOn ?? this.testOn,
567 pauseAfterLoad: pauseAfterLoad ?? _pauseAfterLoad, 557 pauseAfterLoad: pauseAfterLoad ?? _pauseAfterLoad,
568 color: color ?? _color, 558 color: color ?? _color,
569 packageRoot: packageRoot ?? _packageRoot,
570 dart2jsPath: dart2jsPath ?? _dart2jsPath, 559 dart2jsPath: dart2jsPath ?? _dart2jsPath,
571 dart2jsArgs: dart2jsArgs?.toList() ?? this.dart2jsArgs, 560 dart2jsArgs: dart2jsArgs?.toList() ?? this.dart2jsArgs,
572 precompiledPath: precompiledPath ?? this.precompiledPath, 561 precompiledPath: precompiledPath ?? this.precompiledPath,
573 reporter: reporter ?? _reporter, 562 reporter: reporter ?? _reporter,
574 pubServePort: pubServePort ?? pubServeUrl?.port, 563 pubServePort: pubServePort ?? pubServeUrl?.port,
575 concurrency: concurrency ?? _concurrency, 564 concurrency: concurrency ?? _concurrency,
576 shardIndex: shardIndex ?? this.shardIndex, 565 shardIndex: shardIndex ?? this.shardIndex,
577 totalShards: totalShards ?? this.totalShards, 566 totalShards: totalShards ?? this.totalShards,
578 timeout: timeout ?? this.timeout, 567 timeout: timeout ?? this.timeout,
579 patterns: patterns ?? this.patterns, 568 patterns: patterns ?? this.patterns,
(...skipping 11 matching lines...) Expand all
591 580
592 /// Merges two maps whose values are [Configuration]s. 581 /// Merges two maps whose values are [Configuration]s.
593 /// 582 ///
594 /// Any overlapping keys in the maps have their configurations merged in the 583 /// Any overlapping keys in the maps have their configurations merged in the
595 /// returned map. 584 /// returned map.
596 Map<Object, Configuration> _mergeConfigMaps(Map<Object, Configuration> map1, 585 Map<Object, Configuration> _mergeConfigMaps(Map<Object, Configuration> map1,
597 Map<Object, Configuration> map2) => 586 Map<Object, Configuration> map2) =>
598 mergeMaps(map1, map2, 587 mergeMaps(map1, map2,
599 value: (config1, config2) => config1.merge(config2)); 588 value: (config1, config2) => config1.merge(config2));
600 } 589 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | lib/src/runner/configuration/args.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698