Commit 02f98029 by Corentin Wallez Committed by Jamie Madill

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. Reland, enabling the named tests only in standalone. BUG=angleproject:1153 Change-Id: I1336d38425c19305fae8279a42d4931cc516215c Reviewed-on: https://chromium-review.googlesource.com/304171Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 08528e17
......@@ -148,7 +148,7 @@ void dEQPCaseList::initialize()
if (inString.substr(0, 4) == "TEST")
{
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(), '.', '_');
// Occurs in some luminance tests
......@@ -172,6 +172,12 @@ class dEQPTest : public testing::TestWithParam<size_t>
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 dEQPCaseList sCaseList(TestModuleIndex);
......@@ -210,32 +216,36 @@ class dEQP_EGL : public dEQPTest<2>
{
};
#ifdef ANGLE_DEQP_GLES2_TESTS
// TODO(jmadill): add different platform configs, or ability to choose platform
TEST_P(dEQP_GLES2, Default)
{
runTest();
}
#if defined(ANGLE_STANDALONE_BUILD)
#define ANGLE_INSTANTIATE_DEQP_TEST_CASE(DEQP_TEST) \
TEST_P(DEQP_TEST, Default) { runTest(); } \
\
INSTANTIATE_TEST_CASE_P(, DEQP_TEST, DEQP_TEST::GetTestingRange(), \
[](const testing::TestParamInfo<size_t> &info) \
{ \
return DEQP_TEST::GetCaseGTestName(info.param); \
})
#else // defined(ANGLE_STANDALONE_BUILD)
#define ANGLE_INSTANTIATE_DEQP_TEST_CASE(DEQP_TEST) \
TEST_P(DEQP_TEST, Default) { runTest(); } \
INSTANTIATE_TEST_CASE_P(, DEQP_TEST, DEQP_TEST::GetTestingRange())
INSTANTIATE_TEST_CASE_P(, dEQP_GLES2, dEQP_GLES2::GetTestingRange());
#endif // defined(ANGLE_STANDALONE_BUILD)
#ifdef ANGLE_DEQP_GLES2_TESTS
ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_GLES2);
#endif
#ifdef ANGLE_DEQP_GLES3_TESTS
TEST_P(dEQP_GLES3, Default)
{
runTest();
}
INSTANTIATE_TEST_CASE_P(, dEQP_GLES3, dEQP_GLES3::GetTestingRange());
ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_GLES3);
#endif
#ifdef ANGLE_DEQP_EGL_TESTS
TEST_P(dEQP_EGL, Default)
{
runTest();
}
INSTANTIATE_TEST_CASE_P(, dEQP_EGL, dEQP_EGL::GetTestingRange());
ANGLE_INSTANTIATE_DEQP_TEST_CASE(dEQP_EGL);
#endif
} // 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