Send q once (#149767)

The previous expression `success || line.contains('--- TEST FAILED ---')` made it such that as soon as success is reported, the test would send "q" on every line of stdout, which is wrong. This fixes the condition such that "q" is sent once, only when `--- TEST SUCCEEDED ---` or `--- TEST FAILED ---` is printed.
This commit is contained in:
Yegor
2024-06-05 15:44:01 -07:00
committed by GitHub
parent 0708f3c8bc
commit ff0ab6ba45

View File

@@ -521,6 +521,7 @@ class WebTestsSuite {
flutter,
<String>[
'run',
'--verbose',
'--debug',
'-d',
'chrome',
@@ -533,10 +534,15 @@ class WebTestsSuite {
],
outputMode: OutputMode.capture,
outputListener: (String line, Process process) {
bool shutdownFlutterTool = false;
if (line.contains('--- TEST SUCCEEDED ---')) {
success = true;
shutdownFlutterTool = true;
}
if (success || line.contains('--- TEST FAILED ---')) {
if (line.contains('--- TEST FAILED ---')) {
shutdownFlutterTool = true;
}
if (shutdownFlutterTool) {
process.stdin.add('q'.codeUnits);
}
},