diff --git a/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart b/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart index e2f06e0ebc1..78bf7be7b38 100644 --- a/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart +++ b/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart @@ -8,14 +8,16 @@ import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/utils.dart'; -Future _runWithMode(String mode, String deviceId) { - return evalFlutter('drive', options: [ +Future _runWithMode(String mode, String deviceId) async { + final StringBuffer stderr = StringBuffer(); + await evalFlutter('drive', stderr: stderr, options: [ mode, '-t', 'test_driver/scroll_perf.dart', '-d', deviceId, ]); + return stderr.toString(); } Future run() async { diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart index fc99b47cee4..c562a3fd9a5 100644 --- a/dev/devicelab/lib/framework/utils.dart +++ b/dev/devicelab/lib/framework/utils.dart @@ -303,6 +303,7 @@ Future eval( Map environment, bool canFail = false, // as in, whether failures are ok. False means that they are fatal. String workingDirectory, + StringBuffer stderr, // if not null, the stderr will be written here }) async { final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory); @@ -321,6 +322,7 @@ Future eval( .transform(const LineSplitter()) .listen((String line) { print('stderr: $line'); + stderr?.writeln(line); }, onDone: () { stderrDone.complete(); }); await Future.wait(>[stdoutDone.future, stderrDone.future]); @@ -347,10 +349,11 @@ Future evalFlutter(String command, { List options = const [], bool canFail = false, // as in, whether failures are ok. False means that they are fatal. Map environment, + StringBuffer stderr, // if not null, the stderr will be written here. }) { final List args = [command]..addAll(options); return eval(path.join(flutterDirectory.path, 'bin', 'flutter'), args, - canFail: canFail, environment: environment); + canFail: canFail, environment: environment, stderr: stderr); } String get dartBin =>