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:
@@ -55,7 +55,7 @@ TEST_P(LinkTest, FromFile)
|
||||
std::vector<std::unique_ptr<glslang::TShader>> shaders;
|
||||
for (size_t i = 0; i < fileCount; ++i) {
|
||||
std::string contents;
|
||||
tryLoadFile(GLSLANG_TEST_DIRECTORY "/" + fileNames[i],
|
||||
tryLoadFile(GlobalTestSettings.testRoot + "/" + fileNames[i],
|
||||
"input", &contents);
|
||||
shaders.emplace_back(
|
||||
new glslang::TShader(GetShaderStage(GetSuffix(fileNames[i]))));
|
||||
@@ -77,7 +77,7 @@ TEST_P(LinkTest, FromFile)
|
||||
|
||||
// Check with expected results.
|
||||
const std::string expectedOutputFname =
|
||||
GLSLANG_TEST_DIRECTORY "/baseResults/" + fileNames.front() + ".out";
|
||||
GlobalTestSettings.testRoot + "/baseResults/" + fileNames.front() + ".out";
|
||||
std::string expectedOutput;
|
||||
tryLoadFile(expectedOutputFname, "expected output", &expectedOutput);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user