Skip to content

Instantly share code, notes, and snippets.

@ddribin
Created September 12, 2009 16:57
Show Gist options
  • Save ddribin/185897 to your computer and use it in GitHub Desktop.
Save ddribin/185897 to your computer and use it in GitHub Desktop.
main.m
//
// main.m
// Testing
//
// Created by Dave Dribin on 9/12/09.
// Copyright 2009 Bit Maki, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int DDTestApplicationMain(int argc, const char ** argv)
{
BOOL testMode = (getenv("TEST_HOST") != NULL);
if (!testMode) {
return NSApplicationMain(argc, argv);
} else {
fprintf(stderr, "***** Running Run Loop for testing *****\n");
[[NSRunLoop currentRunLoop] run];
fprintf(stderr,"***** Done *****\n");
return 0;
}
}
int main(int argc, char *argv[])
{
return DDTestApplicationMain(argc, (const char **)argv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment