mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[CP-stable]Change flutter_build_with_compilation_error_test to check stdout or stderr (#153116)
### Issue Link: https://github.com/flutter/flutter/issues/151553 ### Changelog Description: Make a flutter_tools test pass on Xcode 16 beta. ### Impact Description: When we update our CI to Xcode 16 after it releases (likely in September), all tests should pass. ### Workaround: Turning off the test. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: - Install Xcode 15 and run the test (this is happening in CI now). - Install Xcode 16 latest beta and run the test. Part of https://github.com/flutter/flutter/issues/148959
This commit is contained in:
parent
80c2e84975
commit
dcc1f06039
@ -63,14 +63,16 @@ int x = 'String';
|
||||
'--no-codesign',
|
||||
], workingDirectory: projectRoot.path);
|
||||
|
||||
expect(
|
||||
result,
|
||||
const ProcessResultMatcher(
|
||||
exitCode: 1,
|
||||
stderrPattern: "A value of type 'String' can't be assigned to a variable of type 'int'.",
|
||||
),
|
||||
);
|
||||
const String errorMessage = "A value of type 'String' can't be assigned to a variable of type 'int'.";
|
||||
|
||||
// Xcode 16 moved the xcodebuild error details from stderr to stdout.
|
||||
// Check that it's contained in one or the other.
|
||||
final bool matchStdout = result.stdout.toString().contains(errorMessage);
|
||||
final bool matchStderr = result.stderr.toString().contains(errorMessage);
|
||||
|
||||
expect(matchStdout || matchStderr, isTrue);
|
||||
expect(result.stderr, isNot(contains("Warning: The 'dart2js' entrypoint script is deprecated")));
|
||||
expect(result.stdout, isNot(contains("Warning: The 'dart2js' entrypoint script is deprecated")));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user