Unverified Commit fa646339 authored by gaaclarke's avatar gaaclarke Committed by GitHub

Added the machine's architecture to macos doctor results. (#65978)

parent fd0554ba
......@@ -253,10 +253,11 @@ class _PosixUtils extends OperatingSystemUtils {
_processUtils.runSync(<String>['sw_vers', '-productName']),
_processUtils.runSync(<String>['sw_vers', '-productVersion']),
_processUtils.runSync(<String>['sw_vers', '-buildVersion']),
_processUtils.runSync(<String>['uname', '-m']),
];
if (results.every((RunResult result) => result.exitCode == 0)) {
_name = '${results[0].stdout.trim()} ${results[1].stdout
.trim()} ${results[2].stdout.trim()}';
.trim()} ${results[2].stdout.trim()} ${results[3].stdout.trim()}';
}
}
_name ??= super.name;
......
......@@ -95,6 +95,29 @@ void main() {
});
});
testWithoutContext('macos name', () async {
when(mockProcessManager.runSync(
<String>['sw_vers', '-productName'],
)).thenReturn(ProcessResult(0, 0, 'product', ''));
when(mockProcessManager.runSync(
<String>['sw_vers', '-productVersion'],
)).thenReturn(ProcessResult(0, 0, 'version', ''));
when(mockProcessManager.runSync(
<String>['sw_vers', '-buildVersion'],
)).thenReturn(ProcessResult(0, 0, 'build', ''));
when(mockProcessManager.runSync(
<String>['uname', '-m'],
)).thenReturn(ProcessResult(0, 0, 'arch', ''));
final MockFileSystem fileSystem = MockFileSystem();
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(operatingSystem: 'macos'),
processManager: mockProcessManager,
);
expect(utils.name, 'product version build arch');
});
testWithoutContext('If unzip fails, include stderr in exception text', () {
const String exceptionMessage = 'Something really bad happened.';
when(mockProcessManager.runSync(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment