Git Product home page Git Product logo

Comments (6)

implementation avatar implementation commented on July 21, 2024

Wat?

Why do you mention me?!?!?!
Why don't you mention @octodog for example?!

31.01.12 15:03, letsdev пишет:

Hi,

I found it much easier to create a IntegrationTestAppDelegate that inherits from my apps delegate and add something like this:

#import "IntegrationTestsAppDelegate.h"
#import "MyTestController.h"

@implementation IntegrationTestsAppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [super application:application didFinishLaunchingWithOptions:launchOptions];

    [[MyTestController sharedInstance] startTestingWithCompletionBlock:^{
    // Exit after the tests complete so that CI knows we're done
    exit([[MyTestController sharedInstance] failureCount]);
    }];

    return YES;
    }

@EnD

Doing it this way has the following advantages:

  • Clean separation of the actual apps target and the integration tests target
  • No need for the additional Preprocessor Macro RUN_KIF_TESTS

Disadvantages:

  • You also need to implement a separate main for the Integration Tests that could look like this:
    #import<UIKit/UIKit.h>
    #import<Foundation/Foundation.h>
    #import "IntegrationTestsAppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([IntegrationTestsAppDelegate class]));
}
}

I clearly like this variant better for the sake of the complete separation between tests and production code.

What do you think?


Reply to this email directly or view it on GitHub:
#109

from kif.

octodog avatar octodog commented on July 21, 2024

Wat?

31.01.12 15:05, implementation пишет:

Wat?

Why do you mention me?!?!?!
Why don't you mention @octodog for example?!

31.01.12 15:03, letsdev пишет:

Hi,

I found it much easier to create a IntegrationTestAppDelegate that inherits from my apps delegate and add something like this:

#import "IntegrationTestsAppDelegate.h"
#import "MyTestController.h"

@implementation IntegrationTestsAppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [super application:application didFinishLaunchingWithOptions:launchOptions];

    [[MyTestController sharedInstance] startTestingWithCompletionBlock:^{
    // Exit after the tests complete so that CI knows we're done
    exit([[MyTestController sharedInstance] failureCount]);
    }];

    return YES;
    }

@EnD

Doing it this way has the following advantages:

  • Clean separation of the actual apps target and the integration tests target
  • No need for the additional Preprocessor Macro RUN_KIF_TESTS

Disadvantages:

  • You also need to implement a separate main for the Integration Tests that could look like this:
    #import<UIKit/UIKit.h>
    #import<Foundation/Foundation.h>
    #import "IntegrationTestsAppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([IntegrationTestsAppDelegate class]));
}
}

I clearly like this variant better for the sake of the complete separation between tests and production code.

What do you think?


Reply to this email directly or view it on GitHub:

#109

Reply to this email directly or view it on GitHub:
#109 (comment)

from kif.

 avatar commented on July 21, 2024

Wat?! I never intended to mention one of you guys. All the @ things in my post are just source code.

Very nice user name :D So you always get a mail when ANYONE on github posts objective-c code in an issue? Great :D

from kif.

octodog avatar octodog commented on July 21, 2024

It was a joke ;)
Use triple backticks to highlight code properly.

Like this

31.01.12 15:27, letsdev пишет:

Wat?! I never mentioned one of you guys. No idea what you're talking bout. All the @ things in my post are just source code.


Reply to this email directly or view it on GitHub:
#109 (comment)

from kif.

 avatar commented on July 21, 2024

ok: you just get messages if a stupid github noob like me posts objective-c code :)

from kif.

bnickel avatar bnickel commented on July 21, 2024

That's a clever solution. I can't believe I never saw it before.

Anyway, this issue is out of date due to KIF not using this runner approach anymore. Closing.

from kif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.