Fix tests so that they may work properly under earlier versions of CMake, and so that they do not modify the source tree.