Problems testing with Xcode build

I have been told that the --xcode build isn't recommended for running tests, but I would like to know whether this is a defect or something that simply isn't supposed to work.

Running lit for an Xcode build (.../lit.py -sv .../test-macosx-x86_64) ends in seconds with the following message:

  Unsupported Tests  : 107
  Unresolved Tests   : 3797

17 warning(s) in tests.

Running absolutely the same command for the same folder in a ninja build starts the test and shows a progress bar as expected.

I prefer developing with Xcode and the only workaround I see right now is having 2 builds: a ninja for testing and an Xcode for developing.

It is actually possible to run the tests with the Xcode build, it's just less convenient to run the entire suite.
For the unit tests there should be a target in Xcode and for the lit-based tests (which are most) use swift/utils/run-test --build-dir path/to/eg/build/Xcode-DebugAssert. It just doesn't support building all targets necessary for those tests so you would need to make sure they are up-to-date. If you don't know what might be necessary, just build ALL_BUILD though it may take some while.

1 Like

Thanks! I did suspect so. Anyways, I ultimately switched to using a ninja build and I just keep the old Xcode one to edit.