Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode iOS testsuite NSLog output missing

I'm developing an iOS app using Xcode 6 and am trying to run a test suite in Xcode. I can run the test but I don't see where my NSLog statements output. They are not in the output panel.

How do I find the output?

@interface ISTest : XCTestCase
@end

@implement ISTest
- (void) setUp {
    [super setUp];
}

- (void) tearDown {
    [super tearDown];
}

- (void) testExample {
    NSLog(@"Where does this go???");
}

- (void) testPerformanceExample {
    [self measureBlock^{
    }];
}
@end
like image 637
user1165560 Avatar asked Nov 05 '14 23:11

user1165560


1 Answers

Check console in the debugging area (the lower view) in Xcode. To open this view, click the square button with the blue rectangle on the bottom in the top-right corner of Xcode.

Edit: Why the downvote? Log statements appear in the debugging area for me.

Test:

- (void)testLoginViewControllerViewExists {
    NSLog(@"Testing Login View Controller");
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Login" bundle:nil];
    CSLoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:
                                      @"loginVC"];
    XCTAssertNotNil([loginVC view], @"loginVC should contain a view");
}

Output:

Test Case '-[AppTests testLoginViewControllerViewExists]' started.
2014-11-06 15:52:00.175 App[14870:2071450] Testing Login View Controller
Test Case '-[AppTests testLoginViewControllerViewExists]' passed (0.001 seconds).
like image 64
JAL Avatar answered Sep 20 '22 15:09

JAL