The GoogleTest lit format accepts two parameters to its constructor: a subdirectory to find test binaries, and a required suffix for the test filenames. Typically, the config should look like this:
config.test_format = lit.formats.GoogleTest('.', 'Tests')
This will search the current directory for filenames ending with 'Tests', and run the matching binaries it finds as GoogleTests. It appears that several lit configs pass a different value for the subdirectory, however. They use "config.llvm_build_mode", which would be set by @LLVM_BUILD_MODE@, but never is. Fortunately, this means that the Python lookup passes and finds an empty string, which means that lit searches the current directory.
I can imagine cases where looking for a build-specific subdirectory might have worked in the paste, but I suspect it is no longer the right behaviour to check with cmake. So, I'm removing the (somewhat confusing) LLVM_BUILD_MODE logic altogether.