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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 cmdline(program); | 66 CommandLine cmdline(program); |
67 cmdline.AppendSwitch(std::string("-run=") + path); | 67 cmdline.AppendArg(std::string("-run=") + path); |
68 | 68 |
69 std::string output; | 69 std::string output; |
70 bool success = base::GetAppOutput(cmdline, &output); | 70 bool success = base::GetAppOutput(cmdline, &output); |
71 if (success) { | 71 if (success) { |
72 size_t success_index = output.find("Conformance PASSED all"); | 72 size_t success_index = output.find("Conformance PASSED all"); |
73 size_t failed_index = output.find("FAILED"); | 73 size_t failed_index = output.find("FAILED"); |
74 success = (success_index != std::string::npos) && | 74 success = (success_index != std::string::npos) && |
75 (failed_index == std::string::npos); | 75 (failed_index == std::string::npos); |
76 } | 76 } |
77 if (!success) { | 77 if (!success) { |
78 LOG(ERROR) << output; | 78 LOG(ERROR) << output; |
79 } | 79 } |
80 return success; | 80 return success; |
81 } | 81 } |
82 | 82 |
83 int main(int argc, char** argv) { | 83 int main(int argc, char** argv) { |
84 base::AtExitManager exit_manager; | 84 base::AtExitManager exit_manager; |
85 #if defined(OS_MACOSX) | 85 #if defined(OS_MACOSX) |
86 base::mac::ScopedNSAutoreleasePool pool; | 86 base::mac::ScopedNSAutoreleasePool pool; |
87 #endif | 87 #endif |
88 ::testing::InitGoogleTest(&argc, argv); | 88 ::testing::InitGoogleTest(&argc, argv); |
89 return RUN_ALL_TESTS(); | 89 return RUN_ALL_TESTS(); |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 | 93 |
OLD | NEW |