Skip to content

Commit 804c6bb

Browse files
osa1Commit Queue
authored andcommitted
[test_runner] Remove duplicate "allowed values" help, use package:args's allowed value help feature
`tools/test.py --help` output before: (only relevant parts) ``` -c, --compiler How the Dart code should be compiled or statically processed. dart2js: Compile to JavaScript using dart2js. dart2analyzer: Perform static analysis on Dart code using the analyzer. compare_analyzer_cfe: Compare analyzer and common front end representations. ddc: Compile to JavaScript using dartdevc. app_jitk: Compile the Dart code into Kernel and then into an app snapshot. dartk: Compile the Dart code into Kernel before running test. dartkp: Compile the Dart code into Kernel and then Kernel into AOT snapshot before running the test. spec_parser: Parse Dart code using the specification parser. fasta: Compile using CFE for errors, but do not run. [dart2js, dart2analyzer, dart2wasm, ddc, app_jitk, dartk, dartkp, spec_parser, fasta, dart2bytecode] -r, --runtime Where the tests should be run. vm: Run Dart code on the standalone Dart VM. dart_precompiled: Run a precompiled snapshot on the VM without a JIT. d8: Run JavaScript from the command line using Chrome's v8. jsc: Run JavaScript from the command line using Safari/WebKit's jsc. jsshell: Run JavaScript from the command line using Firefox's js-shell. firefox: chrome: safari: chromeOnAndroid: Run JavaScript in the specified browser. none: No runtime, compile only. [vm, flutter, dart_precompiled, d8, jsc, jsshell, firefox, chrome, safari, edge, chromeOnAndroid, none] ... -p, --progress Progress indication mode. Allowed values are: compact, color, line, verbose, silent, status [compact (default), color, line, verbose, silent, status] ... --nnbd Which set of non-nullable type features to use. Allowed values are: legacy, weak, strong [legacy, weak, strong (default)] ``` After: ``` -c, --compiler How the Dart code should be compiled or statically processed. [dart2js] Compile to JavaScript using dart2js. [dart2analyzer] Perform static analysis on Dart code using the analyzer. [compare_analyzer_cfe] Compare analyzer and common front end representations. [ddc] Compile to JavaScript using dartdevc. [app_jitk] Compile the Dart code into Kernel and then into an app snapshot. [dartk] Compile the Dart code into Kernel before running test. [dartkp] Compile the Dart code into Kernel and then Kernel into AOT snapshot before running the test. [spec_parser] Parse Dart code using the specification parser. [fasta] Compile using CFE for errors, but do not run. -r, --runtime Where the tests should be run. [vm] Run Dart code on the standalone Dart VM. [dart_precompiled] Run a precompiled snapshot on the VM without a JIT. [d8] Run JavaScript from the command line using Chrome's v8. [jsc] Run JavaScript from the command line using Safari/WebKit's jsc. [jsshell] Run JavaScript from the command line using Firefox's js-shell. [firefox] Run JavaScript in Firefox. [chrome] Run JavaScript in Chrome. [safari] Run JavaScript in Safari. [chromeOnAndroid] Run JavaScript in Chrome on Android. [none] No runtime, compile only. ... -p, --progress Progress indication mode. [compact (default), color, line, verbose, silent, status] --nnbd Which set of non-nullable type features to use. [legacy, weak, strong (default)] ``` Changes: - Duplicate "allowed values are ..." phrases removed. - With `package:args`'s `allowedHelp` messages, allowed values documentations are now consistent with the rest of the ecosystem. Change-Id: I25d5e310e7dd38e0e94622815d9773ec84ab8fb3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431860 Reviewed-by: Bob Nystrom <[email protected]> Commit-Queue: Ömer Ağacan <[email protected]>
1 parent 5dec261 commit 804c6bb

File tree

1 file changed

+35
-40
lines changed

1 file changed

+35
-40
lines changed

pkg/test_runner/lib/src/options.dart

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -69,47 +69,47 @@ class OptionsParser {
6969
..addMultiOption('compiler',
7070
abbr: 'c',
7171
allowed: Compiler.names,
72-
help: '''How the Dart code should be compiled or statically processed.
73-
dart2js: Compile to JavaScript using dart2js.
74-
dart2analyzer: Perform static analysis on Dart code using the analyzer.
75-
compare_analyzer_cfe: Compare analyzer and common front end representations.
76-
ddc: Compile to JavaScript using dartdevc.
77-
app_jitk: Compile the Dart code into Kernel and then into an app
78-
snapshot.
79-
dartk: Compile the Dart code into Kernel before running test.
80-
dartkp: Compile the Dart code into Kernel and then Kernel into
81-
AOT snapshot before running the test.
82-
spec_parser: Parse Dart code using the specification parser.
83-
fasta: Compile using CFE for errors, but do not run.
84-
''')
72+
allowedHelp: {
73+
'dart2js': 'Compile to JavaScript using dart2js.',
74+
'dart2analyzer':
75+
'Perform static analysis on Dart code using the analyzer.',
76+
'compare_analyzer_cfe':
77+
'Compare analyzer and common front end representations.',
78+
'ddc': 'Compile to JavaScript using dartdevc.',
79+
'app_jitk': 'Compile the Dart code into Kernel and then into '
80+
'an app snapshot.',
81+
'dartk': 'Compile the Dart code into Kernel before running test.',
82+
'dartkp': 'Compile the Dart code into Kernel and then Kernel into '
83+
'AOT snapshot before running the test.',
84+
'spec_parser': 'Parse Dart code using the specification parser.',
85+
'fasta': 'Compile using CFE for errors, but do not run.',
86+
},
87+
help: 'How the Dart code should be compiled or statically processed.')
8588
..addMultiOption('runtime',
8689
abbr: 'r',
8790
allowed: Runtime.names,
88-
help: '''Where the tests should be run.
89-
vm: Run Dart code on the standalone Dart VM.
90-
dart_precompiled: Run a precompiled snapshot on the VM without a JIT.
91-
d8: Run JavaScript from the command line using Chrome's v8.
92-
jsc: Run JavaScript from the command line using Safari/WebKit's jsc.
93-
jsshell: Run JavaScript from the command line using Firefox's js-shell.
94-
95-
firefox:
96-
chrome:
97-
safari:
98-
chromeOnAndroid: Run JavaScript in the specified browser.
99-
100-
none: No runtime, compile only.''')
91+
allowedHelp: {
92+
'vm': 'Run Dart code on the standalone Dart VM.',
93+
'dart_precompiled':
94+
'Run a precompiled snapshot on the VM without a JIT.',
95+
'd8': "Run JavaScript from the command line using Chrome's v8.",
96+
'jsc':
97+
"Run JavaScript from the command line using Safari/WebKit's jsc.",
98+
'jsshell':
99+
"Run JavaScript from the command line using Firefox's js-shell.",
100+
'firefox': 'Run JavaScript in Firefox.',
101+
'chrome': 'Run JavaScript in Chrome.',
102+
'safari': 'Run JavaScript in Safari.',
103+
'chromeOnAndroid': 'Run JavaScript in Chrome on Android.',
104+
'none': 'No runtime, compile only.',
105+
},
106+
help: 'Where the tests should be run.')
101107
..addMultiOption('arch',
102108
abbr: 'a',
103109
allowed: ['all', ...Architecture.names],
104110
defaultsTo: [Architecture.host.name],
105111
hide: true,
106-
help: '''The architecture to run tests for.
107-
108-
Allowed values are:
109-
all
110-
ia32, x64
111-
arm, arm64, simarm, simarm64, arm_x64
112-
riscv32, riscv64, simriscv32, simriscv64''')
112+
help: 'The architecture to run tests for.')
113113
..addOption('system',
114114
abbr: 's',
115115
allowed: ['all', ...System.names],
@@ -183,10 +183,7 @@ test options, specifying how tests should be run.''')
183183
defaultsTo: stdioType(stdout) == StdioType.terminal
184184
? Progress.compact.name
185185
: Progress.line.name,
186-
help: '''Progress indication mode.
187-
188-
Allowed values are:
189-
compact, color, line, verbose, silent, status''')
186+
help: 'Progress indication mode.')
190187
..addFlag('report',
191188
hide: true,
192189
help: 'Print a summary report of the number of tests, by expectation.')
@@ -256,9 +253,7 @@ compact, color, line, verbose, silent, status''')
256253
..addOption('nnbd',
257254
allowed: NnbdMode.names,
258255
defaultsTo: NnbdMode.strong.name,
259-
help: '''Which set of non-nullable type features to use.
260-
261-
Allowed values are: legacy, weak, strong''')
256+
help: 'Which set of non-nullable type features to use.')
262257
..addOption('output-directory',
263258
aliases: ['output_directory'],
264259
defaultsTo: "logs",

0 commit comments

Comments
 (0)