mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix the warning test by checking stderr (#30997)
Previously, I used the Android emulator for testing and everything seemed to work fine with stdout (if I remember correctly). But our devicelab uses real Android devices and the warnings are routed to stderr. Hence change stdout to stderr in the test.
This commit is contained in:
parent
be5f345f33
commit
b0937a1e89
@ -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<String> _runWithMode(String mode, String deviceId) {
|
||||
return evalFlutter('drive', options: <String>[
|
||||
Future<String> _runWithMode(String mode, String deviceId) async {
|
||||
final StringBuffer stderr = StringBuffer();
|
||||
await evalFlutter('drive', stderr: stderr, options: <String>[
|
||||
mode,
|
||||
'-t',
|
||||
'test_driver/scroll_perf.dart',
|
||||
'-d',
|
||||
deviceId,
|
||||
]);
|
||||
return stderr.toString();
|
||||
}
|
||||
|
||||
Future<TaskResult> run() async {
|
||||
|
@ -303,6 +303,7 @@ Future<String> eval(
|
||||
Map<String, String> 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<String> eval(
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stderr: $line');
|
||||
stderr?.writeln(line);
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
|
||||
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
@ -347,10 +349,11 @@ Future<String> evalFlutter(String command, {
|
||||
List<String> options = const <String>[],
|
||||
bool canFail = false, // as in, whether failures are ok. False means that they are fatal.
|
||||
Map<String, String> environment,
|
||||
StringBuffer stderr, // if not null, the stderr will be written here.
|
||||
}) {
|
||||
final List<String> args = <String>[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 =>
|
||||
|
Loading…
Reference in New Issue
Block a user