From 425bd5a821c58bf78e6da67a9da784983de16785 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Sat, 9 Dec 2017 00:49:29 +0100 Subject: [PATCH] Make it possible to specify multiple test arguments in test.dart (#13383) This removes the FLUTTER_TEST_ARGS environment variable handling. --- dev/bots/test.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dev/bots/test.dart b/dev/bots/test.dart index dbfc795edc2..c5c5cf7e436 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -15,7 +15,7 @@ final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutt final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Platform.isWindows ? 'dart.exe' : 'dart'); final String pub = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Platform.isWindows ? 'pub.bat' : 'pub'); final String pubCache = path.join(flutterRoot, '.pub-cache'); -final String flutterTestArgs = Platform.environment['FLUTTER_TEST_ARGS']; +final List flutterTestArgs = []; final bool hasColor = stdout.supportsAnsiEscapes; final String bold = hasColor ? '\x1B[1m' : ''; @@ -32,17 +32,19 @@ const Map _kShards = const { 'coverage': _runCoverage, }; -/// When you call this, you can set FLUTTER_TEST_ARGS to pass custom +/// When you call this, you can pass additional arguments to pass custom /// arguments to flutter test. For example, you might want to call this -/// script using FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt to +/// script with the parameter --local-engine=host_debug_unopt to /// use your own build of the engine. /// /// To run the analysis part, run it with SHARD=analyze /// /// For example: /// SHARD=analyze bin/cache/dart-sdk/bin/dart dev/bots/test.dart -/// FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt bin/cache/dart-sdk/bin/dart dev/bots/test.dart -Future main() async { +/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt +Future main(List args) async { + flutterTestArgs.addAll(args); + final String shard = Platform.environment['SHARD'] ?? 'tests'; if (!_kShards.containsKey(shard)) throw new ArgumentError('Invalid shard: $shard'); @@ -317,7 +319,7 @@ Future _runFlutterTest(String workingDirectory, { }) { final List args = ['test']..addAll(options); if (flutterTestArgs != null && flutterTestArgs.isNotEmpty) - args.add(flutterTestArgs); + args.addAll(flutterTestArgs); if (script != null) args.add(script); return _runCommand(flutter, args,