Add test cases for XCTest to cover output directory selection
This issue is split out from !5786 (comment 900116). In the Tests/RunCMake/XcodeProject
tests, we currently have very simple "can I find XCTest" test cases, but nothing tests the functionality that was added in !5786 (merged). We don't need to actually run the built code to verify that the code does what we expect, we just need to configure things and check that they ended up with the directory structure we expect.
In some tests, we don't actually build the generated Xcode project, we instead check the generated project file and confirm that it contains the things we expect it to. This comes down to regular expression matching, but relies on being able to come up with expressions that don't give false positives or false negatives. If the conditions are clear enough, it is an effective strategy that avoids the (quite high) cost of doing an actual build. See the various *-check.cmake
files in the Tests/RunCMake/XcodeProject
directory for examples of varying complexity. If we can use this method to avoid doing builds, that would be desirable.
Checking LIBRARY_OUTPUT_DIRECTORY
should be enough, as noted in the comment below by @Khnykin.