Commit b36f7a25 by Kevin Schoedel Committed by Commit Bot

Update gpu_test_expectations

Sync with chromium, primarily to shave the kOsFuchsia yak. Bug: angleproject:2475 Change-Id: I76ce607095d02e805a41f63315b4237e57f1cc4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497392 Commit-Queue: Jamie Madill <jmadill@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@google.com>
parent e3981cf7
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define DCHECK_NE(A, B) ASSERT((A) != (B)) #define DCHECK_NE(A, B) ASSERT((A) != (B))
#define DCHECK(X) ASSERT(X) #define DCHECK(X) ASSERT(X)
#define DLOG(X) std::cerr #define DLOG(X) std::cerr
#define DVLOG(X) std::cerr
#define LOG(X) std::cerr #define LOG(X) std::cerr
#define GPU_EXPORT #define GPU_EXPORT
...@@ -48,6 +49,7 @@ class Size ...@@ -48,6 +49,7 @@ class Size
public: public:
int width() const { return 0; } int width() const { return 0; }
int height() const { return 0; } int height() const { return 0; }
std::string ToString() const { return "0x0"; }
}; };
} // namespace gfx } // namespace gfx
...@@ -64,6 +66,8 @@ struct DxDiagNode ...@@ -64,6 +66,8 @@ struct DxDiagNode
# define OS_LINUX # define OS_LINUX
#elif defined(__APPLE__) #elif defined(__APPLE__)
# define OS_MACOSX # define OS_MACOSX
#elif defined(__Fuchsia__)
# define OS_FUCHSIA
#else #else
# error "Unsupported platform" # error "Unsupported platform"
#endif #endif
......
...@@ -99,32 +99,36 @@ GPUTestConfig::OS GetCurrentOS() { ...@@ -99,32 +99,36 @@ GPUTestConfig::OS GetCurrentOS() {
return GPUTestConfig::kOsMacSierra; return GPUTestConfig::kOsMacSierra;
case 13: case 13:
return GPUTestConfig::kOsMacHighSierra; return GPUTestConfig::kOsMacHighSierra;
case 14:
return GPUTestConfig::kOsMacMojave;
} }
} }
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
return GPUTestConfig::kOsAndroid; return GPUTestConfig::kOsAndroid;
#elif defined(OS_FUCHSIA)
return GPUTestConfig::kOsFuchsia;
#endif #endif
return GPUTestConfig::kOsUnknown; return GPUTestConfig::kOsUnknown;
} }
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
angle::SystemInfo info; angle::SystemInfo info;
if (!angle::GetSystemInfo(&info)) { if (!angle::GetSystemInfo(&info)) {
return kCollectInfoFatalFailure; return false;
} }
const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex]; const angle::GPUDeviceInfo& gpu = info.gpus[info.primaryGPUIndex];
gpu_info->gpu.vendor_id = gpu.vendorId; gpu_info->gpu.vendor_id = gpu.vendorId;
gpu_info->gpu.device_id = gpu.deviceId; gpu_info->gpu.device_id = gpu.deviceId;
gpu_info->gpu.active = true; gpu_info->gpu.active = true;
return kCollectInfoSuccess; return true;
} }
#else #else
CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
gpu_info->gpu.vendor_id = 0; gpu_info->gpu.vendor_id = 0;
gpu_info->gpu.device_id = 0; gpu_info->gpu.device_id = 0;
gpu_info->gpu.active = true; gpu_info->gpu.active = true;
return kCollectInfoNonFatalFailure; return false;
} }
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} // namespace anonymous } // namespace anonymous
...@@ -138,11 +142,11 @@ GPUTestConfig::GPUTestConfig() ...@@ -138,11 +142,11 @@ GPUTestConfig::GPUTestConfig()
GPUTestConfig::GPUTestConfig(const GPUTestConfig& other) = default; GPUTestConfig::GPUTestConfig(const GPUTestConfig& other) = default;
GPUTestConfig::~GPUTestConfig() { GPUTestConfig::~GPUTestConfig() = default;
}
void GPUTestConfig::set_os(int32_t os) { void GPUTestConfig::set_os(int32_t os) {
DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS)); DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS |
kOsFuchsia));
os_ = os; os_ = os;
} }
...@@ -202,7 +206,7 @@ bool GPUTestConfig::OverlapsWith(const GPUTestConfig& config) const { ...@@ -202,7 +206,7 @@ bool GPUTestConfig::OverlapsWith(const GPUTestConfig& config) const {
(build_type_ & config.build_type_) == 0) (build_type_ & config.build_type_) == 0)
return false; return false;
if (config.api() != kAPIUnknown && api_ != kAPIUnknown && api_ != config.api_) if (config.api() != kAPIUnknown && api_ != kAPIUnknown && api_ != config.api_)
return false; return false;
return true; return true;
} }
...@@ -214,8 +218,7 @@ void GPUTestConfig::ClearGPUVendor() { ...@@ -214,8 +218,7 @@ void GPUTestConfig::ClearGPUVendor() {
gpu_vendor_.clear(); gpu_vendor_.clear();
} }
GPUTestBotConfig::~GPUTestBotConfig() { GPUTestBotConfig::~GPUTestBotConfig() = default;
}
void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) { void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) {
DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size()); DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size());
...@@ -248,9 +251,11 @@ bool GPUTestBotConfig::IsValid() const { ...@@ -248,9 +251,11 @@ bool GPUTestBotConfig::IsValid() const {
case kOsMacElCapitan: case kOsMacElCapitan:
case kOsMacSierra: case kOsMacSierra:
case kOsMacHighSierra: case kOsMacHighSierra:
case kOsMacMojave:
case kOsLinux: case kOsLinux:
case kOsChromeOS: case kOsChromeOS:
case kOsAndroid: case kOsAndroid:
case kOsFuchsia:
break; break;
default: default:
return false; return false;
...@@ -309,10 +314,9 @@ bool GPUTestBotConfig::Matches(const std::string& config_data) const { ...@@ -309,10 +314,9 @@ bool GPUTestBotConfig::Matches(const std::string& config_data) const {
bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
bool rt; bool rt;
if (gpu_info == NULL) { if (!gpu_info) {
GPUInfo my_gpu_info; GPUInfo my_gpu_info;
CollectInfoResult result = CollectBasicGraphicsInfo(&my_gpu_info); if (!CollectBasicGraphicsInfo(&my_gpu_info)) {
if (result != kCollectInfoSuccess) {
LOG(ERROR) << "Fail to identify GPU\n"; LOG(ERROR) << "Fail to identify GPU\n";
DisableGPUInfoValidation(); DisableGPUInfoValidation();
rt = true; rt = true;
...@@ -338,7 +342,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) { ...@@ -338,7 +342,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo* gpu_info) {
// static // static
bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
GPUTestBotConfig my_config; GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL)) if (!my_config.LoadCurrentConfig(nullptr))
return false; return false;
return my_config.Matches(config_data); return my_config.Matches(config_data);
} }
...@@ -347,7 +351,7 @@ bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) { ...@@ -347,7 +351,7 @@ bool GPUTestBotConfig::CurrentConfigMatches(const std::string& config_data) {
bool GPUTestBotConfig::CurrentConfigMatches( bool GPUTestBotConfig::CurrentConfigMatches(
const std::vector<std::string>& configs) { const std::vector<std::string>& configs) {
GPUTestBotConfig my_config; GPUTestBotConfig my_config;
if (!my_config.LoadCurrentConfig(NULL)) if (!my_config.LoadCurrentConfig(nullptr))
return false; return false;
for (size_t i = 0 ; i < configs.size(); ++i) { for (size_t i = 0 ; i < configs.size(); ++i) {
if (my_config.Matches(configs[i])) if (my_config.Matches(configs[i]))
...@@ -362,4 +366,3 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() { ...@@ -362,4 +366,3 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() {
} }
} // namespace gpu } // namespace gpu
...@@ -12,143 +12,140 @@ ...@@ -12,143 +12,140 @@
#include "angle_config.h" #include "angle_config.h"
namespace gpu namespace gpu {
{
struct GPUInfo; struct GPUInfo;
class GPU_EXPORT GPUTestConfig class GPU_EXPORT GPUTestConfig {
{ public:
public: enum OS {
enum OS kOsUnknown = 0,
{ kOsWinXP = 1 << 0,
kOsUnknown = 0, kOsWinVista = 1 << 1,
kOsWinXP = 1 << 0, kOsWin7 = 1 << 2,
kOsWinVista = 1 << 1, kOsWin8 = 1 << 3,
kOsWin7 = 1 << 2, kOsMacLeopard = 1 << 4,
kOsWin8 = 1 << 3, kOsMacSnowLeopard = 1 << 5,
kOsMacLeopard = 1 << 4, kOsMacLion = 1 << 6,
kOsMacSnowLeopard = 1 << 5, kOsMacMountainLion = 1 << 7,
kOsMacLion = 1 << 6, kOsMacMavericks = 1 << 8,
kOsMacMountainLion = 1 << 7, kOsMacYosemite = 1 << 9,
kOsMacMavericks = 1 << 8, kOsMacElCapitan = 1 << 10,
kOsMacYosemite = 1 << 9, kOsMacSierra = 1 << 11,
kOsMacElCapitan = 1 << 10, kOsMacHighSierra = 1 << 12,
kOsMacSierra = 1 << 11, kOsMacMojave = 1 << 13,
kOsMacHighSierra = 1 << 12, kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion |
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion | kOsMacMountainLion | kOsMacMountainLion | kOsMacMavericks | kOsMacYosemite |
kOsMacMavericks | kOsMacYosemite | kOsMacElCapitan | kOsMacSierra | kOsMacElCapitan | kOsMacSierra | kOsMacHighSierra | kOsMacMojave,
kOsMacHighSierra, kOsLinux = 1 << 14,
kOsLinux = 1 << 13, kOsChromeOS = 1 << 15,
kOsChromeOS = 1 << 14, kOsAndroid = 1 << 16,
kOsAndroid = 1 << 15, kOsWin10 = 1 << 17,
kOsWin10 = 1 << 16, kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10, kOsFuchsia = 1 << 18,
}; };
enum BuildType enum BuildType {
{ kBuildTypeUnknown = 0,
kBuildTypeUnknown = 0, kBuildTypeRelease = 1 << 0,
kBuildTypeRelease = 1 << 0, kBuildTypeDebug = 1 << 1,
kBuildTypeDebug = 1 << 1, };
};
enum API {
enum API kAPIUnknown = 0,
{ kAPID3D9 = 1 << 0,
kAPIUnknown = 0, kAPID3D11 = 1 << 1,
kAPID3D9 = 1 << 0, kAPIGLDesktop = 1 << 2,
kAPID3D11 = 1 << 1, kAPIGLES = 1 << 3,
kAPIGLDesktop = 1 << 2, kAPIVulkan = 1 << 4,
kAPIGLES = 1 << 3, };
kAPIVulkan = 1 << 4,
}; GPUTestConfig();
GPUTestConfig(const GPUTestConfig& other);
GPUTestConfig(); virtual ~GPUTestConfig();
GPUTestConfig(const GPUTestConfig &other);
virtual ~GPUTestConfig(); void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_os(int32_t os); void set_build_type(int32_t build_type);
void set_gpu_device_id(uint32_t id); void set_api(int32_t api);
void set_build_type(int32_t build_type);
void set_api(int32_t api); virtual void AddGPUVendor(uint32_t gpu_vendor);
virtual void AddGPUVendor(uint32_t gpu_vendor); int32_t os() const { return os_; }
const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; }
int32_t os() const { return os_; } uint32_t gpu_device_id() const { return gpu_device_id_; }
const std::vector<uint32_t> &gpu_vendor() const { return gpu_vendor_; } int32_t build_type() const { return build_type_; }
uint32_t gpu_device_id() const { return gpu_device_id_; } int32_t api() const { return api_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; } // Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
// Check if the config is valid. For example, if gpu_device_id_ is set, but virtual bool IsValid() const;
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const; // Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
// Check if two configs overlap, i.e., if there exists a config that matches bool OverlapsWith(const GPUTestConfig& config) const;
// both configs.
bool OverlapsWith(const GPUTestConfig &config) const; // Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation(); protected:
void ClearGPUVendor();
protected:
void ClearGPUVendor(); // Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
// Indicates that the OS has the notion of a numeric GPU vendor and device id bool validate_gpu_info_;
// and this data should be validated.
bool validate_gpu_info_; private:
// operating system.
private: int32_t os_;
// operating system.
int32_t os_; // GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_; // GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_; // Release or Debug.
int32_t build_type_;
// Release or Debug.
int32_t build_type_; // Back-end rendering APIs.
int32_t api_;
// Back-end rendering APIs.
int32_t api_;
}; };
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
{ public:
public: GPUTestBotConfig() = default;
GPUTestBotConfig() {} ~GPUTestBotConfig() override;
~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added. // This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override; void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id. // Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo &gpu_info); bool SetGPUInfo(const GPUInfo& gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot // Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one // environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid. // fully defined OS, then it's valid.
bool IsValid() const override; bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a // Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config. // superset of the bot config.
bool Matches(const GPUTestConfig &config) const; bool Matches(const GPUTestConfig& config) const;
bool Matches(const std::string &config_data) const; bool Matches(const std::string& config_data) const;
// Setup the config with the current gpu testing environment. // Setup the config with the current gpu testing environment.
// If gpu_info is NULL, collect GPUInfo first. // If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo *gpu_info); bool LoadCurrentConfig(const GPUInfo* gpu_info);
// Check if this bot's config matches |config_data| or any of the |configs|. // Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string &config_data); static bool CurrentConfigMatches(const std::string& config_data);
static bool CurrentConfigMatches(const std::vector<std::string> &configs); static bool CurrentConfigMatches(const std::vector<std::string>& configs);
// Check if the bot has blacklisted all GPU features. // Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot(); static bool GpuBlacklistedOnBot();
}; };
} // namespace gpu } // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_ #endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
...@@ -75,6 +75,7 @@ enum Token { ...@@ -75,6 +75,7 @@ enum Token {
kConfigMacElCapitan, kConfigMacElCapitan,
kConfigMacSierra, kConfigMacSierra,
kConfigMacHighSierra, kConfigMacHighSierra,
kConfigMacMojave,
kConfigMac, kConfigMac,
kConfigLinux, kConfigLinux,
kConfigChromeOS, kConfigChromeOS,
...@@ -132,6 +133,7 @@ const TokenInfo kTokenData[] = { ...@@ -132,6 +133,7 @@ const TokenInfo kTokenData[] = {
{"elcapitan", GPUTestConfig::kOsMacElCapitan}, {"elcapitan", GPUTestConfig::kOsMacElCapitan},
{"sierra", GPUTestConfig::kOsMacSierra}, {"sierra", GPUTestConfig::kOsMacSierra},
{"highsierra", GPUTestConfig::kOsMacHighSierra}, {"highsierra", GPUTestConfig::kOsMacHighSierra},
{"mojave", GPUTestConfig::kOsMacMojave},
{"mac", GPUTestConfig::kOsMac}, {"mac", GPUTestConfig::kOsMac},
{"linux", GPUTestConfig::kOsLinux}, {"linux", GPUTestConfig::kOsLinux},
{"chromeos", GPUTestConfig::kOsChromeOS}, {"chromeos", GPUTestConfig::kOsChromeOS},
...@@ -221,8 +223,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() { ...@@ -221,8 +223,7 @@ GPUTestExpectationsParser::GPUTestExpectationsParser() {
sizeof(kErrorMessage) / sizeof(kErrorMessage[0])); sizeof(kErrorMessage) / sizeof(kErrorMessage[0]));
} }
GPUTestExpectationsParser::~GPUTestExpectationsParser() { GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
}
bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) { bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
entries_.clear(); entries_.clear();
...@@ -297,6 +298,7 @@ bool GPUTestExpectationsParser::ParseConfig( ...@@ -297,6 +298,7 @@ bool GPUTestExpectationsParser::ParseConfig(
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
...@@ -359,6 +361,7 @@ bool GPUTestExpectationsParser::ParseLine( ...@@ -359,6 +361,7 @@ bool GPUTestExpectationsParser::ParseLine(
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
...@@ -484,6 +487,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig* config, ...@@ -484,6 +487,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig* config,
case kConfigMacElCapitan: case kConfigMacElCapitan:
case kConfigMacSierra: case kConfigMacSierra:
case kConfigMacHighSierra: case kConfigMacHighSierra:
case kConfigMacMojave:
case kConfigMac: case kConfigMac:
case kConfigLinux: case kConfigLinux:
case kConfigChromeOS: case kConfigChromeOS:
......
...@@ -14,78 +14,77 @@ ...@@ -14,78 +14,77 @@
#include "angle_config.h" #include "angle_config.h"
#include "gpu_test_config.h" #include "gpu_test_config.h"
namespace gpu namespace gpu {
{
class GPU_EXPORT GPUTestExpectationsParser {
class GPU_EXPORT GPUTestExpectationsParser public:
{ enum GPUTestExpectation {
public: kGpuTestPass = 1 << 0,
enum GPUTestExpectation kGpuTestFail = 1 << 1,
{ kGpuTestFlaky = 1 << 2,
kGpuTestPass = 1 << 0, kGpuTestTimeout = 1 << 3,
kGpuTestFail = 1 << 1, kGpuTestSkip = 1 << 4,
kGpuTestFlaky = 1 << 2, };
kGpuTestTimeout = 1 << 3,
kGpuTestSkip = 1 << 4, GPUTestExpectationsParser();
}; ~GPUTestExpectationsParser();
GPUTestExpectationsParser(); // Parse the text expectations, and if no error is encountered,
~GPUTestExpectationsParser(); // save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
// Parse the text expectations, and if no error is encountered, bool LoadTestExpectations(const std::string& data);
// save all the entries. Otherwise, generate error messages. bool LoadTestExpectationsFromFile(const std::string& path);
// Return true if parsing succeeds.
bool LoadTestExpectations(const std::string &data); // Query error messages from the last LoadTestExpectations() call.
bool LoadTestExpectationsFromFile(const std::string &path); const std::vector<std::string>& GetErrorMessages() const;
// Query error messages from the last LoadTestExpectations() call. // Get the test expectation of a given test on a given bot.
const std::vector<std::string> &GetErrorMessages() const; int32_t GetTestExpectation(const std::string& test_name,
const GPUTestBotConfig& bot_config) const;
// Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string &test_name, // Parse a list of config modifiers. If we have a valid entry with no
const GPUTestBotConfig &bot_config) const; // conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string& config_data, GPUTestConfig* config);
// Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true. private:
bool ParseConfig(const std::string &config_data, GPUTestConfig *config); struct GPUTestExpectationEntry {
GPUTestExpectationEntry();
private:
struct GPUTestExpectationEntry std::string test_name;
{ GPUTestConfig test_config;
GPUTestExpectationEntry(); int32_t test_expectation;
size_t line_number;
std::string test_name; };
GPUTestConfig test_config;
int32_t test_expectation; // Parse a line of text. If we have a valid entry, save it; otherwise,
size_t line_number; // generate error messages.
}; bool ParseLine(const std::string& line_data, size_t line_number);
// Parse a line of text. If we have a valid entry, save it; otherwise, // Update OS/GPUVendor/BuildType modifiers. May generate an error message.
// generate error messages. bool UpdateTestConfig(GPUTestConfig* config,
bool ParseLine(const std::string &line_data, size_t line_number); int32_t token,
size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config, int32_t token, size_t line_number); // Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig* config,
// Update GPUDeviceID modifier. May generate an error message. const std::string & gpu_device_id,
bool UpdateTestConfig(GPUTestConfig *config, size_t line_number);
const std::string &gpu_device_id,
size_t line_number); // Check if two entries' config overlap with each other. May generate an
// error message.
// Check if two entries' config overlap with each other. May generate an bool DetectConflictsBetweenEntries();
// error message.
bool DetectConflictsBetweenEntries(); // Save an error message, which can be queried later.
void PushErrorMessage(const std::string& message, size_t line_number);
// Save an error message, which can be queried later. void PushErrorMessage(const std::string& message,
void PushErrorMessage(const std::string &message, size_t line_number); size_t entry1_line_number,
void PushErrorMessage(const std::string &message, size_t entry2_line_number);
size_t entry1_line_number,
size_t entry2_line_number); std::vector<GPUTestExpectationEntry> entries_;
std::vector<std::string> error_messages_;
std::vector<GPUTestExpectationEntry> entries_;
std::vector<std::string> error_messages_;
}; };
} // namespace gpu } // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ #endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_
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