| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 5 #ifndef BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| 6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 extern const char kGTestRepeatFlag[]; | 36 extern const char kGTestRepeatFlag[]; |
| 37 extern const char kGTestRunDisabledTestsFlag[]; | 37 extern const char kGTestRunDisabledTestsFlag[]; |
| 38 extern const char kGTestOutputFlag[]; | 38 extern const char kGTestOutputFlag[]; |
| 39 | 39 |
| 40 // Interface for use with LaunchTests that abstracts away exact details | 40 // Interface for use with LaunchTests that abstracts away exact details |
| 41 // which tests and how are run. | 41 // which tests and how are run. |
| 42 class TestLauncherDelegate { | 42 class TestLauncherDelegate { |
| 43 public: | 43 public: |
| 44 // Called to get names of tests available for running. The delegate | 44 // Called to get names of tests available for running. The delegate |
| 45 // must put the result in |output| and return true on success. | 45 // must put the result in |output| and return true on success. |
| 46 virtual bool GetTests(std::vector<SplitTestName>* output) = 0; | 46 virtual bool GetTests(std::vector<TestIdentifier>* output) = 0; |
| 47 | 47 |
| 48 // Called before a test is considered for running. If it returns false, | 48 // Called before a test is considered for running. If it returns false, |
| 49 // the test is not run. If it returns true, the test will be run provided | 49 // the test is not run. If it returns true, the test will be run provided |
| 50 // it is part of the current shard. | 50 // it is part of the current shard. |
| 51 virtual bool ShouldRunTest(const std::string& test_case_name, | 51 virtual bool ShouldRunTest(const std::string& test_case_name, |
| 52 const std::string& test_name) = 0; | 52 const std::string& test_name) = 0; |
| 53 | 53 |
| 54 // Called to make the delegate run the specified tests. The delegate must | 54 // Called to make the delegate run the specified tests. The delegate must |
| 55 // return the number of actual tests it's going to run (can be smaller, | 55 // return the number of actual tests it's going to run (can be smaller, |
| 56 // equal to, or larger than size of |test_names|). It must also call | 56 // equal to, or larger than size of |test_names|). It must also call |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 int32 total_shards_; // Total number of outer shards, at least one. | 153 int32 total_shards_; // Total number of outer shards, at least one. |
| 154 int32 shard_index_; // Index of shard the launcher is to run. | 154 int32 shard_index_; // Index of shard the launcher is to run. |
| 155 | 155 |
| 156 int cycles_; // Number of remaining test itreations, or -1 for infinite. | 156 int cycles_; // Number of remaining test itreations, or -1 for infinite. |
| 157 | 157 |
| 158 // Test filters (empty means no filter). | 158 // Test filters (empty means no filter). |
| 159 std::vector<std::string> positive_test_filter_; | 159 std::vector<std::string> positive_test_filter_; |
| 160 std::vector<std::string> negative_test_filter_; | 160 std::vector<std::string> negative_test_filter_; |
| 161 | 161 |
| 162 // Tests to use (cached result of TestLauncherDelegate::GetTests). | 162 // Tests to use (cached result of TestLauncherDelegate::GetTests). |
| 163 std::vector<SplitTestName> tests_; | 163 std::vector<TestIdentifier> tests_; |
| 164 | 164 |
| 165 // Number of tests started in this iteration. | 165 // Number of tests started in this iteration. |
| 166 size_t test_started_count_; | 166 size_t test_started_count_; |
| 167 | 167 |
| 168 // Number of tests finished in this iteration. | 168 // Number of tests finished in this iteration. |
| 169 size_t test_finished_count_; | 169 size_t test_finished_count_; |
| 170 | 170 |
| 171 // Number of tests successfully finished in this iteration. | 171 // Number of tests successfully finished in this iteration. |
| 172 size_t test_success_count_; | 172 size_t test_success_count_; |
| 173 | 173 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 201 DISALLOW_COPY_AND_ASSIGN(TestLauncher); | 201 DISALLOW_COPY_AND_ASSIGN(TestLauncher); |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 // Extract part from |full_output| that applies to |result|. | 204 // Extract part from |full_output| that applies to |result|. |
| 205 std::string GetTestOutputSnippet(const TestResult& result, | 205 std::string GetTestOutputSnippet(const TestResult& result, |
| 206 const std::string& full_output); | 206 const std::string& full_output); |
| 207 | 207 |
| 208 } // namespace base | 208 } // namespace base |
| 209 | 209 |
| 210 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 210 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| OLD | NEW |