Gtests can be run on another source tree
The gtest executable accepts a --test-root option to specify a root directory for test files. It defaults to the Test directory in the source tree from which the executable is built. For example, this lets us run test exectuables built with MinGW on Linux on a Windows machine with its own copy of the source tree.
This commit is contained in:
@@ -36,6 +36,16 @@
|
||||
|
||||
namespace glslangtest {
|
||||
|
||||
GTestSettings GlobalTestSettings = {nullptr, false};
|
||||
// We need CMake to provide us the absolute path to the directory containing
|
||||
// test files, so we are certain to find those files no matter where the test
|
||||
// harness binary is generated. This provides out-of-source build capability.
|
||||
// This will be used as the default test root, but can be overridden with
|
||||
// the --test-root argument.
|
||||
#ifndef GLSLANG_TEST_DIRECTORY
|
||||
#error \
|
||||
"GLSLANG_TEST_DIRECTORY needs to be defined for gtest to locate test files."
|
||||
#endif
|
||||
|
||||
GTestSettings GlobalTestSettings = {nullptr, false, GLSLANG_TEST_DIRECTORY};
|
||||
|
||||
} // namespace glslangtest
|
||||
|
||||
Reference in New Issue
Block a user