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

Unified Diff: lib/src/executable.dart

Issue 1782473005: Add support for configuration presets. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 9 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 | « lib/src/backend/metadata.dart ('k') | lib/src/runner/configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/executable.dart
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index 8dd546ec7bbcb36777e12f944e3bf3128ccc77af..8c82c47d9302b6ebe624cfba4cac8d13fcb9ab95 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -104,6 +104,17 @@ main(List<String> args) async {
return;
}
+ var undefinedPresets =
+ configuration.chosenPresets
+ .where((preset) => !configuration.knownPresets.contains(preset))
+ .toList();
+ if (undefinedPresets.isNotEmpty) {
+ _printUsage("Undefined ${pluralize('preset', undefinedPresets.length)} "
+ "${toSentence(undefinedPresets.map((preset) => '"$preset"'))}.");
+ exitCode = exit_codes.usage;
+ return;
+ }
+
if (configuration.pubServeUrl != null && !_usesTransformer) {
stderr.write('''
When using --pub-serve, you must include the "test/pub_serve" transformer in
@@ -169,7 +180,7 @@ void _printUsage([String error]) {
output = stderr;
}
- output.write("""$message
+ output.write("""${wordWrap(message)}
Usage: pub run test:test [files or directories...]
« no previous file with comments | « lib/src/backend/metadata.dart ('k') | lib/src/runner/configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698