Tests/CTestTest*: Detect compiler from environment

Three of these tests were still using the compiler selected for building
CMake itself.  In general our test suite is supposed to let each test
select the compiler from the environment.  This is particularly
important on macOS where CMake might be built with compilers inside
Xcode, which require an explicit `CMAKE_OSX_SYSROOT`.
3 files changed