Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Shims/Shimulator/TestCrashShim/TestCrashShim.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void PrintProcessInfo(void)
FBDebugLog(@"Environment %@", processInfo.environment);
}

__attribute__((constructor)) static void EntryPoint()
__attribute__((constructor)) static void EntryPoint(void)
{
NSLog(@"Start of Shimulator");

Expand Down
8 changes: 4 additions & 4 deletions Shims/Shimulator/TestLoadingShim/FBXCTestMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#import <AppKit/AppKit.h>
#endif

__attribute__((constructor)) static void XCTestMainEntryPoint()
__attribute__((constructor)) static void XCTestMainEntryPoint(void)
{
FBDebugLog(@"[XCTestMainEntryPoint] Running inside: %@", [[NSBundle mainBundle] bundleIdentifier]);
if (!NSProcessInfo.processInfo.environment[kEnv_ShimStartXCTest]) {
Expand All @@ -45,7 +45,7 @@
FBDebugLog(@"[XCTestMainEntryPoint] End of XCTestMainEntryPoint");
}

BOOL FBLoadXCTestIfNeeded()
BOOL FBLoadXCTestIfNeeded(void)
{
FBDebugLog(@"Env: %@", [NSProcessInfo processInfo].environment);

Expand Down Expand Up @@ -84,7 +84,7 @@ BOOL FBLoadXCTestIfNeeded()
return NO;
}

void FBDeployBlockWhenAppLoads(void(^mainBlock)()) {
void FBDeployBlockWhenAppLoads(void(^mainBlock)(void)) {
#if TARGET_OS_IPHONE
NSString *notification = UIApplicationDidFinishLaunchingNotification;
#elif TARGET_OS_MAC
Expand Down Expand Up @@ -113,7 +113,7 @@ static id XCTestCase__xctTestIdentifier(id self, SEL sel)
return [[XCTTestIdentifier_class alloc] initWithStringRepresentation:[NSString stringWithFormat:@"%@/%@", classNameOut, methodNameOut] preserveModulePrefix:YES];
}

BOOL FBXCTestMain()
BOOL FBXCTestMain(void)
{
if (!FBLoadXCTestIfNeeded()) {
exit(TestShimExitCodeXCTestFailedLoading);
Expand Down
25 changes: 7 additions & 18 deletions Shims/Shimulator/TestReporterShim/XCTestReporterShim.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

static NSString *const XCTestFilterArg = @"XCTest";
static NSString *const XCTestFrameworkName = @"XCTest";
static NSString *const XCTestProbeClassName = @"XCTestProbe";
static NSString *const XCTestSuiteClassName = @"XCTestSuite";

static FILE *__stdout;
Expand Down Expand Up @@ -64,16 +63,6 @@
return tests;
}

// Key used by objc_setAssociatedObject
static int TestDescriptionKey;

static NSString *TestCase_nameOrDescription(id self, SEL cmd)
{
id description = objc_getAssociatedObject(self, &TestDescriptionKey);
NSCAssert(description != nil, @"Value for `TestNameKey` wasn't set.");
return description;
}

static char *const kEventQueueLabel = "xctool.events";

@interface XCToolAssertionHandler : NSAssertionHandler
Expand All @@ -98,7 +87,7 @@ - (void)handleFailureInFunction:(NSString *)functionName

@end

static dispatch_queue_t EventQueue()
static dispatch_queue_t EventQueue(void)
{
static dispatch_queue_t eventQueue = {0};
static dispatch_once_t onceToken;
Expand Down Expand Up @@ -355,7 +344,7 @@ static void XCPerformTestWithSuppressedExpectedAssertionFailures(id self, SEL or
[currentThreadDict removeObjectForKey:NSAssertionHandlerKey];
}

static void XCWaitForDebuggerIfNeeded()
static void XCWaitForDebuggerIfNeeded(void)
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Expand Down Expand Up @@ -428,7 +417,7 @@ static BOOL XCTestCase__enableSymbolication(id self, SEL sel)
* to the pipe reader. Printing "\n" should be safe because reader is skipping
* empty lines.
*/
static void PrintNewlineAndCloseFDs()
static void PrintNewlineAndCloseFDs(void)
{
if (__stdout == NULL) {
return;
Expand All @@ -440,7 +429,7 @@ static void PrintNewlineAndCloseFDs()

#pragma mark - Entry

static void SwizzleXCTestMethodsIfAvailable()
static void SwizzleXCTestMethodsIfAvailable(void)
{
if ([[[NSBundle mainBundle] bundleIdentifier] hasPrefix:@"com.apple.dt.xctest"]) {
// Start from Xcode 11.1, XCTest will try to connect to testmanagerd service
Expand Down Expand Up @@ -685,7 +674,7 @@ static id SimServiceContext_deviceSetWithPath_error(id cls, SEL sel, NSString *p
return msgsend(cls, originalSelector, simDeviceSetPath, error);
}

static void SwizzleXcodebuildMethods()
static void SwizzleXcodebuildMethods(void)
{
static dispatch_once_t token;
dispatch_once(&token, ^{
Expand All @@ -706,7 +695,7 @@ static void SwizzleXcodebuildMethods()
});
}

__attribute__((constructor)) static void EntryPoint()
__attribute__((constructor)) static void EntryPoint(void)
{
// Unset so we don't cascade into any other process that might be spawned.
unsetenv("DYLD_INSERT_LIBRARIES");
Expand Down Expand Up @@ -753,7 +742,7 @@ static void SwizzleXcodebuildMethods()
}
}

__attribute__((destructor)) static void ExitPoint()
__attribute__((destructor)) static void ExitPoint(void)
{
PrintNewlineAndCloseFDs();
}
Expand Down