Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: base/test/launcher/test_launcher.h

Issue 133653002: Clean up TestLauncherDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 extern const char kGTestHelpFlag[]; 34 extern const char kGTestHelpFlag[];
35 extern const char kGTestListTestsFlag[]; 35 extern const char kGTestListTestsFlag[];
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 at the start of each test iteration.
45 virtual void OnTestIterationStarting() = 0;
46
47 // Called to get a test name for filtering purposes. Usually it's
48 // test case's name and test's name joined by a dot (e.g.
49 // "TestCaseName.TestName").
50 // TODO(phajdan.jr): Remove after transitioning away from run_test_cases.py,
51 // http://crbug.com/236893 .
52 virtual std::string GetTestNameForFiltering(
53 const testing::TestCase* test_case,
54 const testing::TestInfo* test_info) = 0;
55
56 // Called before a test is considered for running. If it returns false, 44 // Called before a test is considered for running. If it returns false,
57 // the test is not run. If it returns true, the test will be run provided 45 // the test is not run. If it returns true, the test will be run provided
58 // it is part of the current shard. 46 // it is part of the current shard.
59 virtual bool ShouldRunTest(const testing::TestCase* test_case, 47 virtual bool ShouldRunTest(const testing::TestCase* test_case,
60 const testing::TestInfo* test_info) = 0; 48 const testing::TestInfo* test_info) = 0;
61 49
62 // Called to make the delegate run the specified tests. The delegate must 50 // Called to make the delegate run the specified tests. The delegate must
63 // return the number of actual tests it's going to run (can be smaller, 51 // return the number of actual tests it's going to run (can be smaller,
64 // equal to, or larger than size of |test_names|). It must also call 52 // equal to, or larger than size of |test_names|). It must also call
65 // |test_launcher|'s OnTestFinished method once per every run test, 53 // |test_launcher|'s OnTestFinished method once per every run test,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // running after |timeout|, it is terminated and |*was_timeout| is set to true. 203 // running after |timeout|, it is terminated and |*was_timeout| is set to true.
216 // Returns exit code of the process. 204 // Returns exit code of the process.
217 int LaunchChildTestProcessWithOptions(const CommandLine& command_line, 205 int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
218 const LaunchOptions& options, 206 const LaunchOptions& options,
219 base::TimeDelta timeout, 207 base::TimeDelta timeout,
220 bool* was_timeout); 208 bool* was_timeout);
221 209
222 } // namespace base 210 } // namespace base
223 211
224 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ 212 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698