Why can't I find XCTest / XCTest.h?

I am trying to get started with tdd inside Xcode and follow a very nice tutorial .

Everything went well. However, when I want to create a command-line application (in c) in Xcode, a separate test folder was not created.

I want to build a random graph implementation, and my project graph consists of main.c, graph.h and graph.c. I decided to add a test file (object file of test file C).

Here I have an import of XCTest / XCTest.h, but when I start (Product-> run) I get an error that XCTest / XCTest.h was not found. I also can not start the test mode (Product-test).

Why is this header file not found? and how to fix it?

+4
source share
1 answer

XCTest / XCTest.h will work only for testTarget, but not for other purposes, try to delete the targets for your xxxtest.m file. you can do this by removing its compileSources form for this purpose

+11
source

Source: https://habr.com/ru/post/1533962/


All Articles