Commit e601181d by Jamie Madill Committed by Commit Bot

Allow specifying GPU config on expectation check.

When we load the expectations we can now specify the config at a later point. This will make it easier to run test suites that use multiple APIs, like angle_end2end_tests. We can instead specify the config when we check the expectation. Bug: angleproject:5951 Change-Id: I9607db093e4a459550a7cd6864b17adfa55e17f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2892273 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent c5e344b1
...@@ -330,7 +330,7 @@ inline bool GetGPUTestSystemInfo(SystemInfo **sysInfo) ...@@ -330,7 +330,7 @@ inline bool GetGPUTestSystemInfo(SystemInfo **sysInfo)
sSystemInfo = new SystemInfo; sSystemInfo = new SystemInfo;
if (!GetSystemInfo(sSystemInfo)) if (!GetSystemInfo(sSystemInfo))
{ {
std::cout << "Error populating SystemInfo for dEQP tests." << std::endl; std::cout << "Error populating SystemInfo." << std::endl;
} }
else else
{ {
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "common/debug.h" #include "common/debug.h"
#include "common/string_utils.h" #include "common/string_utils.h"
#include "GPUTestConfig.h"
namespace angle namespace angle
{ {
...@@ -272,7 +270,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() ...@@ -272,7 +270,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser()
GPUTestExpectationsParser::~GPUTestExpectationsParser() = default; GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
bool GPUTestExpectationsParser::loadTestExpectations(const GPUTestConfig &config, bool GPUTestExpectationsParser::loadTestExpectationsImpl(const GPUTestConfig *config,
const std::string &data) const std::string &data)
{ {
mEntries.clear(); mEntries.clear();
...@@ -294,7 +292,18 @@ bool GPUTestExpectationsParser::loadTestExpectations(const GPUTestConfig &config ...@@ -294,7 +292,18 @@ bool GPUTestExpectationsParser::loadTestExpectations(const GPUTestConfig &config
return rt; return rt;
} }
bool GPUTestExpectationsParser::loadTestExpectationsFromFile(const GPUTestConfig &config, bool GPUTestExpectationsParser::loadTestExpectations(const GPUTestConfig &config,
const std::string &data)
{
return loadTestExpectationsImpl(&config, data);
}
bool GPUTestExpectationsParser::loadAllTestExpectations(const std::string &data)
{
return loadTestExpectationsImpl(nullptr, data);
}
bool GPUTestExpectationsParser::loadTestExpectationsFromFileImpl(const GPUTestConfig *config,
const std::string &path) const std::string &path)
{ {
mEntries.clear(); mEntries.clear();
...@@ -306,23 +315,50 @@ bool GPUTestExpectationsParser::loadTestExpectationsFromFile(const GPUTestConfig ...@@ -306,23 +315,50 @@ bool GPUTestExpectationsParser::loadTestExpectationsFromFile(const GPUTestConfig
mErrorMessages.push_back(kErrorMessage[kErrorFileIO]); mErrorMessages.push_back(kErrorMessage[kErrorFileIO]);
return false; return false;
} }
return loadTestExpectations(config, data); return loadTestExpectationsImpl(config, data);
} }
int32_t GPUTestExpectationsParser::getTestExpectation(const std::string &testName) bool GPUTestExpectationsParser::loadTestExpectationsFromFile(const GPUTestConfig &config,
const std::string &path)
{
return loadTestExpectationsFromFileImpl(&config, path);
}
bool GPUTestExpectationsParser::loadAllTestExpectationsFromFile(const std::string &path)
{
return loadTestExpectationsFromFileImpl(nullptr, path);
}
int32_t GPUTestExpectationsParser::getTestExpectationImpl(const GPUTestConfig *config,
const std::string &testName)
{ {
size_t maxExpectationLen = 0; size_t maxExpectationLen = 0;
GPUTestExpectationEntry *foundEntry = nullptr; GPUTestExpectationEntry *foundEntry = nullptr;
for (size_t i = 0; i < mEntries.size(); ++i) for (GPUTestExpectationEntry &entry : mEntries)
{ {
if (NamesMatchWithWildcard(mEntries[i].testName.c_str(), testName.c_str())) if (NamesMatchWithWildcard(entry.testName.c_str(), testName.c_str()))
{ {
size_t expectationLen = mEntries[i].testName.length(); size_t expectationLen = entry.testName.length();
// Filter by condition first.
bool satisfiesConditions = true;
if (config)
{
for (size_t condition : entry.conditions)
{
if (!config->getConditions()[condition])
{
satisfiesConditions = false;
break;
}
}
}
// The longest/most specific matching expectation overrides any others. // The longest/most specific matching expectation overrides any others.
if (expectationLen > maxExpectationLen) if (satisfiesConditions && expectationLen > maxExpectationLen)
{ {
maxExpectationLen = expectationLen; maxExpectationLen = expectationLen;
foundEntry = &mEntries[i]; foundEntry = &entry;
} }
} }
} }
...@@ -334,6 +370,17 @@ int32_t GPUTestExpectationsParser::getTestExpectation(const std::string &testNam ...@@ -334,6 +370,17 @@ int32_t GPUTestExpectationsParser::getTestExpectation(const std::string &testNam
return kGpuTestPass; return kGpuTestPass;
} }
int32_t GPUTestExpectationsParser::getTestExpectation(const std::string &testName)
{
return getTestExpectationImpl(nullptr, testName);
}
int32_t GPUTestExpectationsParser::getTestExpectationWithConfig(const GPUTestConfig &config,
const std::string &testName)
{
return getTestExpectationImpl(&config, testName);
}
const std::vector<std::string> &GPUTestExpectationsParser::getErrorMessages() const const std::vector<std::string> &GPUTestExpectationsParser::getErrorMessages() const
{ {
return mErrorMessages; return mErrorMessages;
...@@ -353,7 +400,7 @@ std::vector<std::string> GPUTestExpectationsParser::getUnusedExpectationsMessage ...@@ -353,7 +400,7 @@ std::vector<std::string> GPUTestExpectationsParser::getUnusedExpectationsMessage
return messages; return messages;
} }
bool GPUTestExpectationsParser::parseLine(const GPUTestConfig &config, bool GPUTestExpectationsParser::parseLine(const GPUTestConfig *config,
const std::string &lineData, const std::string &lineData,
size_t lineNumber) size_t lineNumber)
{ {
...@@ -421,10 +468,18 @@ bool GPUTestExpectationsParser::parseLine(const GPUTestConfig &config, ...@@ -421,10 +468,18 @@ bool GPUTestExpectationsParser::parseLine(const GPUTestConfig &config,
} }
{ {
bool err = false; bool err = false;
if (!checkTokenCondition(config, err, token, lineNumber)) if (config)
{
if (!checkTokenCondition(*config, err, token, lineNumber))
{ {
skipLine = true; // Move to the next line without adding this one. skipLine = true; // Move to the next line without adding this one.
} }
}
else
{
// Store the conditions for later comparison if we don't have a config.
entry.conditions[kTokenData[token].condition] = true;
}
if (err) if (err)
{ {
return false; return false;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "GPUTestConfig.h"
namespace angle namespace angle
{ {
...@@ -38,6 +40,8 @@ class GPUTestExpectationsParser ...@@ -38,6 +40,8 @@ class GPUTestExpectationsParser
// Return true if parsing succeeds. // Return true if parsing succeeds.
bool loadTestExpectations(const GPUTestConfig &config, const std::string &data); bool loadTestExpectations(const GPUTestConfig &config, const std::string &data);
bool loadTestExpectationsFromFile(const GPUTestConfig &config, const std::string &path); bool loadTestExpectationsFromFile(const GPUTestConfig &config, const std::string &path);
bool loadAllTestExpectations(const std::string &data);
bool loadAllTestExpectationsFromFile(const std::string &path);
// Query error messages from the last LoadTestExpectations() call. // Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string> &getErrorMessages() const; const std::vector<std::string> &getErrorMessages() const;
...@@ -47,6 +51,7 @@ class GPUTestExpectationsParser ...@@ -47,6 +51,7 @@ class GPUTestExpectationsParser
// Get the test expectation of a given test on a given bot. // Get the test expectation of a given test on a given bot.
int32_t getTestExpectation(const std::string &testName); int32_t getTestExpectation(const std::string &testName);
int32_t getTestExpectationWithConfig(const GPUTestConfig &config, const std::string &testName);
private: private:
struct GPUTestExpectationEntry struct GPUTestExpectationEntry
...@@ -57,11 +62,12 @@ class GPUTestExpectationsParser ...@@ -57,11 +62,12 @@ class GPUTestExpectationsParser
int32_t testExpectation; int32_t testExpectation;
size_t lineNumber; size_t lineNumber;
bool used; bool used;
GPUTestConfig::ConditionArray conditions;
}; };
// Parse a line of text. If we have a valid entry, save it; otherwise, // Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages. // generate error messages.
bool parseLine(const GPUTestConfig &config, const std::string &lineData, size_t lineNumber); bool parseLine(const GPUTestConfig *config, const std::string &lineData, size_t lineNumber);
// Check a the condition assigned to a particular token. // Check a the condition assigned to a particular token.
bool checkTokenCondition(const GPUTestConfig &config, bool checkTokenCondition(const GPUTestConfig &config,
...@@ -82,6 +88,12 @@ class GPUTestExpectationsParser ...@@ -82,6 +88,12 @@ class GPUTestExpectationsParser
size_t entry1LineNumber, size_t entry1LineNumber,
size_t entry2LineNumber); size_t entry2LineNumber);
// Config is optional.
bool loadTestExpectationsFromFileImpl(const GPUTestConfig *config, const std::string &path);
bool loadTestExpectationsImpl(const GPUTestConfig *config, const std::string &data);
int32_t getTestExpectationImpl(const GPUTestConfig *config, const std::string &testName);
std::vector<GPUTestExpectationEntry> mEntries; std::vector<GPUTestExpectationEntry> mEntries;
std::vector<std::string> mErrorMessages; std::vector<std::string> mErrorMessages;
}; };
......
...@@ -14,6 +14,11 @@ using namespace angle; ...@@ -14,6 +14,11 @@ using namespace angle;
namespace namespace
{ {
enum class ConditionTestType
{
OnLoad,
OnGet,
};
class GPUTestConfigTester : public GPUTestConfig class GPUTestConfigTester : public GPUTestConfig
{ {
...@@ -27,156 +32,157 @@ class GPUTestConfigTester : public GPUTestConfig ...@@ -27,156 +32,157 @@ class GPUTestConfigTester : public GPUTestConfig
} }
}; };
class GPUTestExpectationsParserTest : public testing::TestWithParam<ConditionTestType>
{
public:
bool load(const std::string &line)
{
if (GetParam() == ConditionTestType::OnLoad)
{
return parser.loadTestExpectations(config, line);
}
else
{
return parser.loadAllTestExpectations(line);
}
}
int32_t get(const std::string &testName)
{
if (GetParam() == ConditionTestType::OnLoad)
{
return parser.getTestExpectation(testName);
}
else
{
return parser.getTestExpectationWithConfig(config, testName);
}
}
GPUTestConfigTester config;
GPUTestExpectationsParser parser;
};
// A correct entry with a test that's skipped on all platforms should not lead // A correct entry with a test that's skipped on all platforms should not lead
// to any errors, and should properly return the expectation SKIP. // to any errors, and should properly return the expectation SKIP.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSkip) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSkip)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
} }
// A correct entry with a test that's failed on all platforms should not lead // A correct entry with a test that's failed on all platforms should not lead
// to any errors, and should properly return the expectation FAIL. // to any errors, and should properly return the expectation FAIL.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserFail) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserFail)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = FAIL)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = FAIL)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestFail); GPUTestExpectationsParser::kGpuTestFail);
} }
// A correct entry with a test that's passed on all platforms should not lead // A correct entry with a test that's passed on all platforms should not lead
// to any errors, and should properly return the expectation PASS. // to any errors, and should properly return the expectation PASS.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserPass) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserPass)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = PASS)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = PASS)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A correct entry with a test that's timed out on all platforms should not lead // A correct entry with a test that's timed out on all platforms should not lead
// to any errors, and should properly return the expectation TIMEOUT. // to any errors, and should properly return the expectation TIMEOUT.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserTimeout) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserTimeout)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = TIMEOUT)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = TIMEOUT)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestTimeout); GPUTestExpectationsParser::kGpuTestTimeout);
} }
// A correct entry with a test that's flaky on all platforms should not lead // A correct entry with a test that's flaky on all platforms should not lead
// to any errors, and should properly return the expectation FLAKY. // to any errors, and should properly return the expectation FLAKY.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserFlaky) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserFlaky)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = FLAKY)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = FLAKY)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestFlaky); GPUTestExpectationsParser::kGpuTestFlaky);
} }
// A correct entry with a test that's skipped on windows should not lead // A correct entry with a test that's skipped on windows should not lead
// to any errors, and should properly return the expectation SKIP on this // to any errors, and should properly return the expectation SKIP on this
// tester. // tester.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWin) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWin)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 WIN : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 WIN : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
} }
// A correct entry with a test that's skipped on windows/NVIDIA should not lead // A correct entry with a test that's skipped on windows/NVIDIA should not lead
// to any errors, and should properly return the expectation SKIP on this // to any errors, and should properly return the expectation SKIP on this
// tester. // tester.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIA) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIA)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 WIN NVIDIA : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 WIN NVIDIA : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
} }
// A correct entry with a test that's skipped on windows/NVIDIA/D3D11 should not // A correct entry with a test that's skipped on windows/NVIDIA/D3D11 should not
// lead to any errors, and should properly return the expectation SKIP on this // lead to any errors, and should properly return the expectation SKIP on this
// tester. // tester.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 WIN NVIDIA D3D11 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 WIN NVIDIA D3D11 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
} }
// Same as GPUTestExpectationsParserSingleLineWinNVIDIAD3D11, but verifying that the order // Same as GPUTestExpectationsParserSingleLineWinNVIDIAD3D11, but verifying that the order
// of these conditions doesn't matter // of these conditions doesn't matter
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11OtherOrder) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11OtherOrder)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 D3D11 NVIDIA WIN : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 D3D11 NVIDIA WIN : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
} }
// A correct entry with a test that's skipped on mac should not lead // A correct entry with a test that's skipped on mac should not lead
// to any errors, and should default to PASS on this tester (windows). // to any errors, and should default to PASS on this tester (windows).
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineMac) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineMac)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 MAC : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 MAC : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
...@@ -184,159 +190,139 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineMac) ...@@ -184,159 +190,139 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineMac)
// to any errors, and should default to PASS. // to any errors, and should default to PASS.
// (https:anglebug.com/3368) In the future, this condition should cause an // (https:anglebug.com/3368) In the future, this condition should cause an
// error // error
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineConflict) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineConflict)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 WIN MAC : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 WIN MAC : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line without a bug ID should return an error and not add the expectation. // A line without a bug ID should return an error and not add the expectation.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugId) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugId)
{ {
GPUTestConfigTester config;
std::string line = R"( : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; std::string line = R"( : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line without a bug ID should return an error and not add the expectation, (even if // A line without a bug ID should return an error and not add the expectation, (even if
// the line contains conditions that might be mistaken for a bug id) // the line contains conditions that might be mistaken for a bug id)
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugIdWithConditions) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugIdWithConditions)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(WIN D3D11 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(WIN D3D11 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line without a colon should return an error and not add the expectation. // A line without a colon should return an error and not add the expectation.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingColon) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingColon)
{ {
GPUTestConfigTester config;
std::string line = R"(100 dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; std::string line = R"(100 dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A wild character (*) at the end of a line should match any expectations that are a subset of that // A wild character (*) at the end of a line should match any expectations that are a subset of that
// line. It should not greedily match to omany expectations that aren't in that subset. // line. It should not greedily match to omany expectations that aren't in that subset.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserWildChar) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserWildChar)
{ {
GPUTestConfigTester config;
std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP)"; std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
// Also ensure the wild char is not too wild, only covers tests that are more specific // Also ensure the wild char is not too wild, only covers tests that are more specific
EXPECT_EQ(parser.getTestExpectation( EXPECT_EQ(get("dEQP-GLES31.functional.program_interface_query.transform_feedback_varying."
"dEQP-GLES31.functional.program_interface_query.transform_feedback_varying."
"resource_list.vertex_fragment.builtin_gl_position"), "resource_list.vertex_fragment.builtin_gl_position"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line without an equals should return an error and not add the expectation. // A line without an equals should return an error and not add the expectation.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingEquals) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingEquals)
{ {
GPUTestConfigTester config;
std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max SKIP)"; std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max SKIP)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line without an expectation should return an error and not add the expectation. // A line without an expectation should return an error and not add the expectation.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingExpectation) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingExpectation)
{ {
GPUTestConfigTester config;
std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max =)"; std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max =)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A line with an expectation that doesn't exist should return an error and not add the expectation. // A line with an expectation that doesn't exist should return an error and not add the expectation.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserInvalidExpectation) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserInvalidExpectation)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = WRONG)"; R"(100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = WRONG)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format"); EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// ChromeOS is reserved as a token, but doesn't actually check any conditions. Any tokens that // ChromeOS is reserved as a token, but doesn't actually check any conditions. Any tokens that
// do not check conditions should return an error and not add the expectation // do not check conditions should return an error and not add the expectation
// (https://anglebug.com/3363) Remove/update this test when ChromeOS is supported // (https://anglebug.com/3363) Remove/update this test when ChromeOS is supported
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondition) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondition)
{ {
GPUTestConfigTester config; // Does not apply when loading all expectations and not checking the config.
if (GetParam() == ConditionTestType::OnGet)
{
GTEST_SKIP() << "Test does not apply when loading all expectations.";
return;
}
std::string line = std::string line =
R"(100 CHROMEOS : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(100 CHROMEOS : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_FALSE(load(line));
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u); EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1) if (parser.getErrorMessages().size() >= 1)
{ {
...@@ -344,38 +330,31 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondit ...@@ -344,38 +330,31 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondit
"Line 1 : entry invalid, likely unimplemented modifiers"); "Line 1 : entry invalid, likely unimplemented modifiers");
} }
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// If a line starts with a comment, it's ignored and should not be added to the list. // If a line starts with a comment, it's ignored and should not be added to the list.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserComment) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserComment)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(//100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)"; R"(//100 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
} }
// A misspelled expectation should not be matched from getTestExpectation, and should lead to an // A misspelled expectation should not be matched from getTestExpectation, and should lead to an
// unused expectation when later queried. // unused expectation when later queried.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectation) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectation)
{ {
GPUTestConfigTester config;
std::string line = std::string line =
R"(100 : dEQP-GLES31.functionaal.layout_binding.ubo.* = SKIP)"; // "functionaal" R"(100 : dEQP-GLES31.functionaal.layout_binding.ubo.* = SKIP)"; // "functionaal"
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestPass); GPUTestExpectationsParser::kGpuTestPass);
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u); EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
if (parser.getUnusedExpectationsMessages().size() >= 1) if (parser.getUnusedExpectationsMessages().size() >= 1)
...@@ -386,18 +365,15 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectati ...@@ -386,18 +365,15 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectati
// Wild characters that match groups of expectations can be overridden with more specific lines. // Wild characters that match groups of expectations can be overridden with more specific lines.
// The parse should still compute correctly which lines were used and which were unused. // The parse should still compute correctly which lines were used and which were unused.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation)
{ {
GPUTestConfigTester config;
// Fail all layout_binding tests, but skip the layout_binding.ubo subset. // Fail all layout_binding tests, but skip the layout_binding.ubo subset.
std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.* = FAIL std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.* = FAIL
100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP)"; 100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
// The FAIL expectation was unused because it was overridden. // The FAIL expectation was unused because it was overridden.
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u); EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
...@@ -406,25 +382,22 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation ...@@ -406,25 +382,22 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation
EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 1: expectation was unused."); EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 1: expectation was unused.");
} }
// Now try a test that doesn't match the override criteria // Now try a test that doesn't match the override criteria
EXPECT_EQ(parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.image.test"), EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.image.test"),
GPUTestExpectationsParser::kGpuTestFail); GPUTestExpectationsParser::kGpuTestFail);
EXPECT_TRUE(parser.getUnusedExpectationsMessages().empty()); EXPECT_TRUE(parser.getUnusedExpectationsMessages().empty());
} }
// This test is the same as GPUTestExpectationsParserOverrideExpectation, but verifying the order // This test is the same as GPUTestExpectationsParserOverrideExpectation, but verifying the order
// doesn't matter when overriding. // doesn't matter when overriding.
TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectationOtherOrder) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectationOtherOrder)
{ {
GPUTestConfigTester config;
// Fail all layout_binding tests, but skip the layout_binding.ubo subset. // Fail all layout_binding tests, but skip the layout_binding.ubo subset.
std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP std::string line = R"(100 : dEQP-GLES31.functional.layout_binding.ubo.* = SKIP
100 : dEQP-GLES31.functional.layout_binding.* = FAIL)"; 100 : dEQP-GLES31.functional.layout_binding.* = FAIL)";
GPUTestExpectationsParser parser; EXPECT_TRUE(load(line));
EXPECT_TRUE(parser.loadTestExpectations(config, line));
EXPECT_TRUE(parser.getErrorMessages().empty()); EXPECT_TRUE(parser.getErrorMessages().empty());
// Default behavior is to let missing tests pass // Default behavior is to let missing tests pass
EXPECT_EQ( EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
GPUTestExpectationsParser::kGpuTestSkip); GPUTestExpectationsParser::kGpuTestSkip);
// The FAIL expectation was unused because it was overridden. // The FAIL expectation was unused because it was overridden.
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u); EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
...@@ -433,9 +406,25 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation ...@@ -433,9 +406,25 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation
EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 2: expectation was unused."); EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 2: expectation was unused.");
} }
// Now try a test that doesn't match the override criteria // Now try a test that doesn't match the override criteria
EXPECT_EQ(parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.image.test"), EXPECT_EQ(get("dEQP-GLES31.functional.layout_binding.image.test"),
GPUTestExpectationsParser::kGpuTestFail); GPUTestExpectationsParser::kGpuTestFail);
EXPECT_TRUE(parser.getUnusedExpectationsMessages().empty()); EXPECT_TRUE(parser.getUnusedExpectationsMessages().empty());
} }
std::string ConditionTestTypeName(testing::TestParamInfo<ConditionTestType> testParamInfo)
{
if (testParamInfo.param == ConditionTestType::OnLoad)
{
return "OnLoad";
}
else
{
return "OnGet";
}
}
INSTANTIATE_TEST_SUITE_P(,
GPUTestExpectationsParserTest,
testing::Values(ConditionTestType::OnGet, ConditionTestType::OnLoad),
ConditionTestTypeName);
} // 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