Commit a78d12c5 by Corentin Wallez

Make the dEQP GTEST initialization failures red on swarming.

On swarming the dEQP GTEST initialization failures would show as green because the FAIL GTEST macro was called outside of a test. Use exit(-1) instead that shows up as red on the bots. BUG=580045 Change-Id: Icf82a8593a11fe7e992778ffd8c682f6738c39a6 Reviewed-on: https://chromium-review.googlesource.com/326690Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 3f16afd3
...@@ -41,7 +41,15 @@ const char *g_TestExpectationsFiles[] = ...@@ -41,7 +41,15 @@ const char *g_TestExpectationsFiles[] =
"deqp_egl_test_expectations.txt", "deqp_egl_test_expectations.txt",
}; };
Optional<std::string> FindTestExpectationsPath(const std::string &exeDir, size_t testModuleIndex) // During the CaseList initialization we cannot use the GTEST FAIL macro to quit the program because
// the initialization is called outside of tests the first time.
void Die()
{
exit(EXIT_FAILURE);
}
Optional<std::string> FindTestExpectationsPath(const std::string &exeDir,
size_t testModuleIndex)
{ {
for (const char *testPath : g_TestExpectationsSearchPaths) for (const char *testPath : g_TestExpectationsSearchPaths)
{ {
...@@ -128,7 +136,8 @@ void dEQPCaseList::initialize() ...@@ -128,7 +136,8 @@ void dEQPCaseList::initialize()
Optional<std::string> testExpectationsPath = FindTestExpectationsPath(exeDir, mTestModuleIndex); Optional<std::string> testExpectationsPath = FindTestExpectationsPath(exeDir, mTestModuleIndex);
if (!testExpectationsPath.valid()) if (!testExpectationsPath.valid())
{ {
FAIL() << "Failed to find test expectations file."; std::cerr << "Failed to find test expectations file." << std::endl;
Die();
} }
if (!mTestExpectationsParser.LoadTestExpectationsFromFile(testExpectationsPath.value())) if (!mTestExpectationsParser.LoadTestExpectationsFromFile(testExpectationsPath.value()))
...@@ -139,18 +148,21 @@ void dEQPCaseList::initialize() ...@@ -139,18 +148,21 @@ void dEQPCaseList::initialize()
errorMsgStream << std::endl << " " << message; errorMsgStream << std::endl << " " << message;
} }
FAIL() << "Failed to load test expectations." << errorMsgStream.str(); std::cerr << "Failed to load test expectations." << errorMsgStream.str() << std::endl;
Die();
} }
if (!mTestConfig.LoadCurrentConfig(nullptr)) if (!mTestConfig.LoadCurrentConfig(nullptr))
{ {
FAIL() << "Failed to load test configuration."; std::cerr << "Failed to load test configuration." << std::endl;
Die();
} }
std::ifstream caseListStream(caseListPath); std::ifstream caseListStream(caseListPath);
if (caseListStream.fail()) if (caseListStream.fail())
{ {
FAIL() << "Failed to load the case list."; std::cerr << "Failed to load the case list." << std::endl;
Die();
} }
while (!caseListStream.eof()) while (!caseListStream.eof())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment