Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: gpu/gles2_conform_support/gles2_conform_test.cc

Issue 1277253002: Apply the bot config api based on the command line arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failure Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/gles2_conform_support/gles2_conform_test_expectations.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/gles2_conform_support/gles2_conform_test.cc
diff --git a/gpu/gles2_conform_support/gles2_conform_test.cc b/gpu/gles2_conform_support/gles2_conform_test.cc
index 906e1af2754a28efdbd5f642373d1a80209742d1..42964e41ada6f074aa0516253fd9ae1b52befc9b 100644
--- a/gpu/gles2_conform_support/gles2_conform_test.cc
+++ b/gpu/gles2_conform_support/gles2_conform_test.cc
@@ -44,6 +44,36 @@ bool RunGLES2ConformTest(const char* path) {
LOG(ERROR) << "Fail to load bot configuration";
return false;
}
+
+ // Set the bot config api based on the OS and command line
+ base::CommandLine* current_cmd_line = base::CommandLine::ForCurrentProcess();
+ int32 config_os = bot_config.os();
+ if ((config_os & gpu::GPUTestConfig::kOsWin) != 0) {
+ std::string angle_renderer =
+ current_cmd_line->HasSwitch("use-angle")
+ ? current_cmd_line->GetSwitchValueASCII("use-angle")
+ : "d3d11";
+ if (angle_renderer == "d3d11") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPID3D11);
+ } else if (angle_renderer == "d3d9") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPID3D9);
+ } else if (angle_renderer == "gl") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLDesktop);
+ } else if (angle_renderer == "gles") {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLES);
+ } else {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIUnknown);
+ }
+ } else if ((config_os & gpu::GPUTestConfig::kOsMac) != 0 ||
+ config_os == gpu::GPUTestConfig::kOsLinux) {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLDesktop);
+ } else if (config_os == gpu::GPUTestConfig::kOsChromeOS ||
+ config_os == gpu::GPUTestConfig::kOsAndroid) {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIGLES);
+ } else {
+ bot_config.set_api(gpu::GPUTestConfig::kAPIUnknown);
+ }
+
if (!bot_config.IsValid()) {
LOG(ERROR) << "Invalid bot configuration";
return false;
@@ -63,14 +93,13 @@ bool RunGLES2ConformTest(const char* path) {
base::FilePath program(test_path.Append(FILE_PATH_LITERAL(
"gles2_conform_test_windowless")));
- base::CommandLine* currentCmdLine = base::CommandLine::ForCurrentProcess();
- base::CommandLine cmdline(program);
- cmdline.AppendArguments(*currentCmdLine, false);
- cmdline.AppendSwitch(std::string("--"));
- cmdline.AppendArg(std::string("-run=") + path);
+ base::CommandLine cmd_line(program);
+ cmd_line.AppendArguments(*current_cmd_line, false);
+ cmd_line.AppendSwitch(std::string("--"));
+ cmd_line.AppendArg(std::string("-run=") + path);
std::string output;
- bool success = base::GetAppOutput(cmdline, &output);
+ bool success = base::GetAppOutput(cmd_line, &output);
if (success) {
size_t success_index = output.find("Conformance PASSED all");
size_t failed_index = output.find("FAILED");
« no previous file with comments | « no previous file | gpu/gles2_conform_support/gles2_conform_test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698