Commit 0db7b155 by Corentin Wallez

Use named value-parameterized tests for dEQP gtests

This replace the non-descriptive digit at the end of the test name by the name of the dEQP test being run. BUG=angleproject:1153 Change-Id: Ibc9e5fbf46ffbf3a8c783807161b2bdc63119f54 Reviewed-on: https://chromium-review.googlesource.com/296686Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org>
parent 6b10ddbf
...@@ -148,7 +148,7 @@ void dEQPCaseList::initialize() ...@@ -148,7 +148,7 @@ void dEQPCaseList::initialize()
if (inString.substr(0, 4) == "TEST") if (inString.substr(0, 4) == "TEST")
{ {
std::string dEQPName = inString.substr(6); std::string dEQPName = inString.substr(6);
std::string gTestName = dEQPName.substr(11); std::string gTestName = dEQPName.substr(dEQPName.find('.') + 1);
std::replace(gTestName.begin(), gTestName.end(), '.', '_'); std::replace(gTestName.begin(), gTestName.end(), '.', '_');
// Occurs in some luminance tests // Occurs in some luminance tests
...@@ -172,6 +172,12 @@ class dEQPTest : public testing::TestWithParam<size_t> ...@@ -172,6 +172,12 @@ class dEQPTest : public testing::TestWithParam<size_t>
return testing::Range<size_t>(0, GetCaseList().numCases()); return testing::Range<size_t>(0, GetCaseList().numCases());
} }
static std::string GetCaseGTestName(size_t caseIndex)
{
const auto &caseInfo = GetCaseList().getCaseInfo(caseIndex);
return caseInfo.mGTestName;
}
static const dEQPCaseList &GetCaseList() static const dEQPCaseList &GetCaseList()
{ {
static dEQPCaseList sCaseList(TestModuleIndex); static dEQPCaseList sCaseList(TestModuleIndex);
...@@ -210,32 +216,26 @@ class dEQP_EGL : public dEQPTest<2> ...@@ -210,32 +216,26 @@ class dEQP_EGL : public dEQPTest<2>
{ {
}; };
#ifdef ANGLE_DEQP_GLES2_TESTS
// TODO(jmadill): add different platform configs, or ability to choose platform // TODO(jmadill): add different platform configs, or ability to choose platform
TEST_P(dEQP_GLES2, Default) #define ANGLE_INSTANTIATE_DEQP_TEST_CASE(DEQP_TEST) \
{ TEST_P(DEQP_TEST, Default) { runTest(); } \
runTest(); \
} INSTANTIATE_TEST_CASE_P(, DEQP_TEST, DEQP_TEST::GetTestingRange(), \
[](const testing::TestParamInfo<size_t> &info) \
{ \
return DEQP_TEST::GetCaseGTestName(info.param); \
})
INSTANTIATE_TEST_CASE_P(, dEQP_GLES2, dEQP_GLES2::GetTestingRange()); #ifdef ANGLE_DEQP_GLES2_TESTS
ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_GLES2);
#endif #endif
#ifdef ANGLE_DEQP_GLES3_TESTS #ifdef ANGLE_DEQP_GLES3_TESTS
TEST_P(dEQP_GLES3, Default) ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_GLES3);
{
runTest();
}
INSTANTIATE_TEST_CASE_P(, dEQP_GLES3, dEQP_GLES3::GetTestingRange());
#endif #endif
#ifdef ANGLE_DEQP_EGL_TESTS #ifdef ANGLE_DEQP_EGL_TESTS
TEST_P(dEQP_EGL, Default) ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_EGL);
{
runTest();
}
INSTANTIATE_TEST_CASE_P(, dEQP_EGL, dEQP_EGL::GetTestingRange());
#endif #endif
} // anonymous namespace } // anonymous namespace
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