Running unit tests on iOS using CTest and GoogleTest

Are there any resources out there for running iOS unit tests using CTest? Is it even possible to i.e. run a headless binary containing tests on the simulator?

How do you people approach this?

1 Like

I’ve also been wondering this. It seems that Apple doesn’t support creating command-line executables for iOS, so the recommendation seems to be to use XCTest, which CMake does provide a module for, but it is light on details and examples.

From what I can gather, it seems that you have to put your code into a MacOS bundle, then create a “tester bundle”, which can then be registered with CTest through XCTest.

I’m not currently creating MacOS bundles, I’ve currently got “regular” static libraries. This brings up the question, is it impossible to test a “regular library” on iOS?