OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/gles2_conform_support/gles2_conform_test.h" | 5 #include "gpu/gles2_conform_support/gles2_conform_test.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (expectation != gpu::GPUTestExpectationsParser::kGpuTestPass) { | 56 if (expectation != gpu::GPUTestExpectationsParser::kGpuTestPass) { |
57 LOG(WARNING) << "Test " << test_name << " is bypassed"; | 57 LOG(WARNING) << "Test " << test_name << " is bypassed"; |
58 return true; | 58 return true; |
59 } | 59 } |
60 | 60 |
61 base::FilePath test_path; | 61 base::FilePath test_path; |
62 PathService::Get(base::DIR_EXE, &test_path); | 62 PathService::Get(base::DIR_EXE, &test_path); |
63 base::FilePath program(test_path.Append(FILE_PATH_LITERAL( | 63 base::FilePath program(test_path.Append(FILE_PATH_LITERAL( |
64 "gles2_conform_test_windowless"))); | 64 "gles2_conform_test_windowless"))); |
65 | 65 |
66 CommandLine* currentCmdLine = CommandLine::ForCurrentProcess(); | 66 base::CommandLine* currentCmdLine = base::CommandLine::ForCurrentProcess(); |
67 CommandLine cmdline(program); | 67 base::CommandLine cmdline(program); |
68 cmdline.AppendArguments(*currentCmdLine, false); | 68 cmdline.AppendArguments(*currentCmdLine, false); |
69 cmdline.AppendSwitch(std::string("--")); | 69 cmdline.AppendSwitch(std::string("--")); |
70 cmdline.AppendArg(std::string("-run=") + path); | 70 cmdline.AppendArg(std::string("-run=") + path); |
71 | 71 |
72 std::string output; | 72 std::string output; |
73 bool success = base::GetAppOutput(cmdline, &output); | 73 bool success = base::GetAppOutput(cmdline, &output); |
74 if (success) { | 74 if (success) { |
75 size_t success_index = output.find("Conformance PASSED all"); | 75 size_t success_index = output.find("Conformance PASSED all"); |
76 size_t failed_index = output.find("FAILED"); | 76 size_t failed_index = output.find("FAILED"); |
77 success = (success_index != std::string::npos) && | 77 success = (success_index != std::string::npos) && |
78 (failed_index == std::string::npos); | 78 (failed_index == std::string::npos); |
79 } | 79 } |
80 if (!success) { | 80 if (!success) { |
81 LOG(ERROR) << output; | 81 LOG(ERROR) << output; |
82 } | 82 } |
83 return success; | 83 return success; |
84 } | 84 } |
85 | 85 |
86 int main(int argc, char** argv) { | 86 int main(int argc, char** argv) { |
87 base::AtExitManager exit_manager; | 87 base::AtExitManager exit_manager; |
88 CommandLine::Init(argc, argv); | 88 base::CommandLine::Init(argc, argv); |
89 #if defined(OS_MACOSX) | 89 #if defined(OS_MACOSX) |
90 base::mac::ScopedNSAutoreleasePool pool; | 90 base::mac::ScopedNSAutoreleasePool pool; |
91 #endif | 91 #endif |
92 ::testing::InitGoogleTest(&argc, argv); | 92 ::testing::InitGoogleTest(&argc, argv); |
93 return RUN_ALL_TESTS(); | 93 return RUN_ALL_TESTS(); |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 | 97 |
OLD | NEW |