Commit da247005 authored by jmadill's avatar jmadill Committed by Commit bot

Enable command line arguments for GLES2 CTS.

This will enable us to select the back-end renderer for ANGLE.

BUG=380355

Review URL: https://codereview.chromium.org/474523003

Cr-Commit-Position: refs/heads/master@{#292634}
parent 5b9d8148
...@@ -63,7 +63,10 @@ bool RunGLES2ConformTest(const char* path) { ...@@ -63,7 +63,10 @@ bool RunGLES2ConformTest(const char* path) {
base::FilePath program(test_path.Append(FILE_PATH_LITERAL( base::FilePath program(test_path.Append(FILE_PATH_LITERAL(
"gles2_conform_test_windowless"))); "gles2_conform_test_windowless")));
CommandLine* currentCmdLine = CommandLine::ForCurrentProcess();
CommandLine cmdline(program); CommandLine cmdline(program);
cmdline.AppendArguments(*currentCmdLine, false);
cmdline.AppendSwitch(std::string("--"));
cmdline.AppendArg(std::string("-run=") + path); cmdline.AppendArg(std::string("-run=") + path);
std::string output; std::string output;
...@@ -82,6 +85,7 @@ bool RunGLES2ConformTest(const char* path) { ...@@ -82,6 +85,7 @@ bool RunGLES2ConformTest(const char* path) {
int main(int argc, char** argv) { int main(int argc, char** argv) {
base::AtExitManager exit_manager; base::AtExitManager exit_manager;
CommandLine::Init(argc, argv);
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool pool; base::mac::ScopedNSAutoreleasePool pool;
#endif #endif
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsautorelease_pool.h"
#endif #endif
#if defined(OS_WIN)
#include "base/strings/utf_string_conversions.h"
#endif
#include "ui/gl/gl_surface.h" #include "ui/gl/gl_surface.h"
extern "C" { extern "C" {
...@@ -23,10 +26,30 @@ int main(int argc, char *argv[]) { ...@@ -23,10 +26,30 @@ int main(int argc, char *argv[]) {
CommandLine::Init(argc, argv); CommandLine::Init(argc, argv);
base::MessageLoopForUI message_loop; base::MessageLoopForUI message_loop;
CommandLine::StringVector args =
CommandLine::ForCurrentProcess()->GetArgs();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool pool; base::mac::ScopedNSAutoreleasePool pool;
#endif #endif
GTFMain(argc, argv);
scoped_ptr<const char*[]> argsArray(new const char*[args.size()+1]);
argsArray[0] = argv[0];
#if defined(OS_WIN)
std::vector<std::string> argsNonWide(args.size());
for (size_t index = 0; index < args.size(); ++index) {
argsNonWide[index] = base::UTF16ToASCII(args[index]);
argsArray[index+1] = argsNonWide[index].c_str();
}
#else
for (size_t index = 0; index < args.size(); ++index) {
argsArray[index+1] = args[index].c_str();
}
#endif
GTFMain(static_cast<int>(args.size()+1),
const_cast<char**>(argsArray.get()));
return 0; return 0;
} }
......
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