OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_GPU_GPU_TEST_EXPECTATIONS_PARSER_H_ | 5 #ifndef GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ |
6 #define CONTENT_TEST_GPU_GPU_TEST_EXPECTATIONS_PARSER_H_ | 6 #define GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "content/test/gpu/gpu_test_config.h" | 13 #include "gpu/config/gpu_test_config.h" |
| 14 #include "gpu/gpu_export.h" |
14 | 15 |
15 class GPUTestExpectationsParser { | 16 namespace gpu { |
| 17 |
| 18 class GPU_EXPORT GPUTestExpectationsParser { |
16 public: | 19 public: |
17 enum GPUTestExpectation { | 20 enum GPUTestExpectation { |
18 kGpuTestPass = 1 << 0, | 21 kGpuTestPass = 1 << 0, |
19 kGpuTestFail = 1 << 1, | 22 kGpuTestFail = 1 << 1, |
20 kGpuTestFlaky = 1 << 2, | 23 kGpuTestFlaky = 1 << 2, |
21 kGpuTestTimeout = 1 << 3, | 24 kGpuTestTimeout = 1 << 3, |
22 kGpuTestSkip = 1 << 4, | 25 kGpuTestSkip = 1 << 4, |
23 }; | 26 }; |
24 | 27 |
25 enum GPUTestProfile { | |
26 kWebGLConformanceTest, | |
27 }; | |
28 | |
29 GPUTestExpectationsParser(); | 28 GPUTestExpectationsParser(); |
30 ~GPUTestExpectationsParser(); | 29 ~GPUTestExpectationsParser(); |
31 | 30 |
32 // Parse the text expectations, and if no error is encountered, | 31 // Parse the text expectations, and if no error is encountered, |
33 // save all the entries. Otherwise, generate error messages. | 32 // save all the entries. Otherwise, generate error messages. |
34 // Return true if parsing succeeds. | 33 // Return true if parsing succeeds. |
35 bool LoadTestExpectations(const std::string& data); | 34 bool LoadTestExpectations(const std::string& data); |
36 bool LoadTestExpectations(const base::FilePath& path); | 35 bool LoadTestExpectations(const base::FilePath& path); |
37 bool LoadTestExpectations(GPUTestProfile profile); | |
38 | 36 |
39 // Query error messages from the last LoadTestExpectations() call. | 37 // Query error messages from the last LoadTestExpectations() call. |
40 const std::vector<std::string>& GetErrorMessages() const; | 38 const std::vector<std::string>& GetErrorMessages() const; |
41 | 39 |
42 // Get the test expectation of a given test on a given bot. | 40 // Get the test expectation of a given test on a given bot. |
43 int32 GetTestExpectation(const std::string& test_name, | 41 int32 GetTestExpectation(const std::string& test_name, |
44 const GPUTestBotConfig& bot_config) const; | 42 const GPUTestBotConfig& bot_config) const; |
45 | 43 |
46 // Parse a list of config modifiers. If we have a valid entry with no | 44 // Parse a list of config modifiers. If we have a valid entry with no |
47 // conflicts, | config | stores it, and the function returns true. | 45 // conflicts, | config | stores it, and the function returns true. |
(...skipping 25 matching lines...) Expand all Loading... |
73 // Check if two entries' config overlap with each other. May generate an | 71 // Check if two entries' config overlap with each other. May generate an |
74 // error message. | 72 // error message. |
75 bool DetectConflictsBetweenEntries(); | 73 bool DetectConflictsBetweenEntries(); |
76 | 74 |
77 // Save an error message, which can be queried later. | 75 // Save an error message, which can be queried later. |
78 void PushErrorMessage(const std::string& message, size_t line_number); | 76 void PushErrorMessage(const std::string& message, size_t line_number); |
79 void PushErrorMessage(const std::string& message, | 77 void PushErrorMessage(const std::string& message, |
80 size_t entry1_line_number, | 78 size_t entry1_line_number, |
81 size_t entry2_line_number); | 79 size_t entry2_line_number); |
82 | 80 |
83 // Return false if an error occurs or the path does not exist. | |
84 static bool GetExpectationsPath(GPUTestProfile profile, | |
85 base::FilePath* path); | |
86 | |
87 std::vector<GPUTestExpectationEntry> entries_; | 81 std::vector<GPUTestExpectationEntry> entries_; |
88 std::vector<std::string> error_messages_; | 82 std::vector<std::string> error_messages_; |
89 }; | 83 }; |
90 | 84 |
91 #endif // CONTENT_TEST_GPU_GPU_TEST_EXPECTATIONS_PARSER_H_ | 85 } // namespace gpu |
92 | 86 |
| 87 #endif // GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ |
| 88 |
OLD | NEW |