iljaiwas / objc-run

A shell script that makes it easy to use Objective-C files for shell script-like tasks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use XCTest

onmyway133 opened this issue · comments

commented

I'm writing a simple test file to use XCTest

file.m

#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>

int main()
{
    NSLog(@"file running");
    XCTAssert(YES, @"Pass");

    return 0;
}

When I run objc-run file.m, I get

'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
        ^
1 error generated.
objc-run: clang returned with error

As far as I can recall, there is no functionality built-in to link against other library then Foundation. You are more than welcome to add such a feature.

Also, objc-run is to built small command line tools. I'm not sure that you could use iOS APIs here.

commented

@iljaiwas thanks, I think we should use Swift now