Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Fix OS X tests device name displayed in reporter events.
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremeMan committed Oct 24, 2015
1 parent 33b7275 commit 0bc5dfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xctool/xctool-tests/FakeTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ static void writeAll(int fildes, const void *buf, size_t nbyte) {
}
}

// method defined in otest-shim.
void __exit(int code);

@interface FakeTask ()
@property (atomic, assign, readwrite) int terminationStatus;
@end
Expand Down Expand Up @@ -166,9 +169,8 @@ - (void)launch
writeAll(standardErrorWriteFd, pretendStandardErrorBytes, pretendStandardErrorLength);
}

// When the process exits, the last open handles to the write side of the
// stdout/stderr pipes will be 'widowed' and the other side will see EOFs.
exit(0);
// call directly to interposed in otest-shim exit.
__exit(0);
} else {
// If we're working with pipes, we need to make sure we close the
// write side in the host process - otherwise the pipe never becomes
Expand Down
4 changes: 4 additions & 0 deletions xctool/xctool/SimulatorWrapper/SimulatorInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ - (NSString *)simulatedDeviceInfoName
return _deviceName;
}

if ([_buildSettings[Xcode_SDK_NAME] hasPrefix:@"macosx"]) {
return @"My Mac";
}

switch ([[self simulatedDeviceFamily] integerValue]) {
case KProductTypeIphone:
if ([self simulatedCpuType] == CPU_TYPE_I386) {
Expand Down

0 comments on commit 0bc5dfe

Please sign in to comment.