@@ -23,7 +23,10 @@ final argParser = ArgParser()
23
23
..addOption ('build-args' ,
24
24
help: 'Args to pass to the build runner process.\n '
25
25
'Run "dart run build_runner build -h -v" to see all available '
26
- 'options.' );
26
+ 'options.' )
27
+ ..addOption ('test-args' ,
28
+ help: 'Args to pass to the dart test process.\n '
29
+ 'Run "dart test -h" to see all available options.' );
27
30
28
31
enum Mode {
29
32
// Print build and test args separated by `--`
@@ -62,6 +65,7 @@ void main(List<String> args) async {
62
65
63
66
final bool ? release = parsed['release' ];
64
67
final String ? buildArgs = parsed['build-args' ];
68
+ final String ? testArgs = parsed['test-args' ];
65
69
66
70
buildAggregateTestYaml (mode, userBuildArgs: buildArgs);
67
71
final testPaths = parseAggregateTestPaths (mode);
@@ -70,7 +74,8 @@ void main(List<String> args) async {
70
74
} else if (mode == Mode .build) {
71
75
await buildTests (testPaths, release: release, userBuildArgs: buildArgs);
72
76
} else {
73
- await runTests (testPaths, release: release, userBuildArgs: buildArgs);
77
+ await runTests (testPaths,
78
+ release: release, userBuildArgs: buildArgs, userTestArgs: testArgs);
74
79
}
75
80
}
76
81
@@ -187,7 +192,7 @@ Future<void> buildTests(List<String> testPaths,
187
192
///
188
193
/// Includes `--release` if [release] is true.
189
194
Future <void > runTests (List <String > testPaths,
190
- {bool ? release, String ? userBuildArgs}) async {
195
+ {bool ? release, String ? userBuildArgs, String ? userTestArgs }) async {
191
196
final executable = 'dart' ;
192
197
final args = [
193
198
'run' ,
@@ -196,6 +201,7 @@ Future<void> runTests(List<String> testPaths,
196
201
...buildRunnerBuildArgs (testPaths,
197
202
release: release, userBuildArgs: userBuildArgs),
198
203
'--' ,
204
+ ...? userTestArgs? .split (' ' ),
199
205
testPreset,
200
206
];
201
207
stdout
0 commit comments