Xcode 4.5 command line unit testing

后端 未结 4 697
长发绾君心
长发绾君心 2020-12-07 10:51

Having an issue since updating to Xcode 4.5 when running my unit tests via command line. The following is the output i\'m seeing when i try to run my tests

U         


        
4条回答
  •  眼角桃花
    2020-12-07 11:12

    Also there's little hack that can help to run command-line tests on iOS6.0 simulator SDK

    I'm Using Cedar and this tweak helped me :

    First, you need to update your main file a little:

      // Faking up that workspace port
      CFMessagePortCreateLocal(NULL, (CFStringRef) @"PurpleWorkspacePort", NULL, NULL,NULL);
      return UIApplicationMain(argc, argv, nil, @"CedarApplicationDelegate");
    

    Second, you need to add category to UIWindow:

    @implementation UIWindow (Private)
    - (void)_createContext {
       // Doing nothing here. Just for crash avoidance
    }
    @end
    

    Cedar Unittest will run fine, with some runtime warnings, but, at least they'll be able to run :)

提交回复
热议问题