Added the machine's architecture to macos doctor results. (#65978)
This commit is contained in:
parent
fd0554ba89
commit
fa646339d6
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user