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

Unified Diff: tools/testing/dart/test_options.dart

Issue 2361813003: Fix test.py and tests to use an explicit --packages flag. (Closed)
Patch Set: Handle case where only observatory_ui tests are run. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_options.dart
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 917e23644d7166d4611e3429d945b7c2ace9eeb1..936bb39a05bec776f6c7cf70d3a1c496d1e65b37 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -808,6 +808,40 @@ Note: currently only implemented for dart2js.''',
configuration['selectors'] = selectorMap;
}
+ // Put observatory_ui in a configuration with its own packages override.
+ // Only one value in the configuration map is mutable:
+ selectors = configuration['selectors'];
+ if (selectors.containsKey('observatory_ui')) {
+ if (selectors.length == 1) {
+ configuration['packages'] = TestUtils.dartDirUri
+ .resolve('runtime/observatory/.packages').toFilePath();
+ } else {
+ // Make a new configuration whose selectors map only contains
+ // observatory_ui, and remove the key from the original selectors.
+ // The only mutable value in the map is the selectors, so a
+ // shallow copy is safe.
+ var observatoryConfiguration = new Map.from(configuration);
+ observatoryConfiguration['selectors'] =
+ {'observatory_ui': selectors['observatory_ui']};
+ selectors.remove('observatory_ui');
+
+ // Set the packages flag.
+ observatoryConfiguration['packages'] = TestUtils.dartDirUri
+ .resolve('runtime/observatory/.packages').toFilePath();
+
+ // Return the expansions of both configurations. Neither will reach
+ // this line in the recursive call to _expandConfigurations.
+ return _expandConfigurations(configuration)
+ ..addAll(_expandConfigurations(observatoryConfiguration));
+ }
+ }
+ // Set the default package spec explicitly.
+ if (configuration['package_root'] == null &&
+ configuration['packages'] == null) {
+ configuration['packages'] =
+ TestUtils.dartDirUri.resolve('.packages').toFilePath();
+ }
+
// Expand the architectures.
if (configuration['arch'].contains(',')) {
return _expandHelper('arch', configuration);
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698