Importing XCTest into a framework target

Is it by design that we are not able to succesfully load the XCTest framework into our own framework targets?


I can add it to my framework target's list of linked frameworks, and import it into a source code file, and even build my project successfully, but after it's built, Xcode will display a red error inline at the import site with the message "Failed to load module 'XCTest'". My framework target even builds if I refer to an XCTest type in my code.


I got to this point because I was trying to use XCTPerformanceMetric(rawValue: ""). The call works in my test target, but in a framework target it tells me the rawValue version of the constructor does not exist.


Of course, as i type this, I'm still receiving the load module error, but now the compiler doesn't complain if I use the rawValue constructor.


Can anyone enlighten me? Thanks.

Really frustrated that no team has yet replied to this problem that so many of us are facing out here.
having the same issue and is already in production. How did you all test your software without xctest??
Importing XCTest into a framework target
 
 
Q