Question

With the earlier KIF, I can add testcontroller header file in appdelegate's didFinishLaunching method and my CI would work.

testcontroller.h

#import <Foundation/Foundation.h>
#import "KIFTestController.h"

@interface testcontroller : KIFTestController

@end

testcontroller.m

#import "KIFTestScenario.h"

@implementation testcontroller

- (void)initializeScenarios;
{
    [self addScenario:[KIFTestScenario scenarioToTest]];
}

@end

And my app delegate would be,

#ifdef RUN_KIF_TESTS
//DebugLog(@"%d",testsAreRunning);
if (!testsAreRunning){
    //DebugLog(@"Run KIF Tests");
    [[testcontroller sharedInstance] startTestingWithCompletionBlock:^{
        // Exit after the tests complete so that CI knows we're done
        exit([[testcontroller sharedInstance] failureCount]);
    }];
    testsAreRunning=YES;
}

#endif

With new KIf (KIF-next) I don't know how to do that, because there is no controller file.

Does anyone one how to group tests in controller for new KIF structure ?

Was it helpful?

Solution

You have to execute the application test target on the continuous integration server. For example, section "The solution" of the Setting Up Jenkins CI for iOS Development explains how you can configure pre Xcode 5 to execute the tests. Alternatively, take a look at section "Running Kiwi Specs from the Command Line" of Continuous Integration of iOS Projects using Jenkins, CocoaPods, and Kiwi. Although they describe the solution for executing Kiwi tests instead of kif tests, they basically solve the same problem, namely executing an application test target using Jenkins.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top