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

Side by Side Diff: base/test/test_suite.h

Issue 26883002: Introduce base::TestSuite::DisableTests(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/test_suite.cc » ('j') | base/test/test_suite.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 BASE_TEST_TEST_SUITE_H_ 5 #ifndef BASE_TEST_TEST_SUITE_H_
6 #define BASE_TEST_TEST_SUITE_H_ 6 #define BASE_TEST_TEST_SUITE_H_
7 7
8 // Defines a basic test suite framework for running gtest based tests. You can 8 // Defines a basic test suite framework for running gtest based tests. You can
9 // instantiate this class in your main function and call its Run method to run 9 // instantiate this class in your main function and call its Run method to run
10 // any gtest based tests that are linked into your executable. 10 // any gtest based tests that are linked into your executable.
(...skipping 17 matching lines...) Expand all
28 TestSuite(int argc, char** argv); 28 TestSuite(int argc, char** argv);
29 virtual ~TestSuite(); 29 virtual ~TestSuite();
30 30
31 // Returns true if the test is marked as "MAYBE_". 31 // Returns true if the test is marked as "MAYBE_".
32 // When using different prefixes depending on platform, we use MAYBE_ and 32 // When using different prefixes depending on platform, we use MAYBE_ and
33 // preprocessor directives to replace MAYBE_ with the target prefix. 33 // preprocessor directives to replace MAYBE_ with the target prefix.
34 static bool IsMarkedMaybe(const testing::TestInfo& test); 34 static bool IsMarkedMaybe(const testing::TestInfo& test);
35 35
36 void CatchMaybeTests(); 36 void CatchMaybeTests();
37 37
38 // Disables tests that match the |filter|. This gives the test suite an
39 // opportunity to disable tests at runtime. Must be called before Run()
40 // to take effect.
41 //
42 // For example, to disable "FooTest" when IsFooSupported() is false:
43 // if (!IsFooSupported())
44 // DisableTests("FooTest.*");
45 // Run();
46 void DisableTests(const std::string& filter);
47
38 void ResetCommandLine(); 48 void ResetCommandLine();
39 49
40 void AddTestLauncherResultPrinter(); 50 void AddTestLauncherResultPrinter();
41 51
42 int Run(); 52 int Run();
43 53
44 protected: 54 protected:
45 // This constructor is only accessible to specialized test suite 55 // This constructor is only accessible to specialized test suite
46 // implementations which need to control the creation of an AtExitManager 56 // implementations which need to control the creation of an AtExitManager
47 // instance for the duration of the test. 57 // instance for the duration of the test.
(...skipping 26 matching lines...) Expand all
74 DISALLOW_COPY_AND_ASSIGN(TestSuite); 84 DISALLOW_COPY_AND_ASSIGN(TestSuite);
75 }; 85 };
76 86
77 } // namespace base 87 } // namespace base
78 88
79 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile 89 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile
80 // until we can update it to use "base::" (preventing a two-sided patch). 90 // until we can update it to use "base::" (preventing a two-sided patch).
81 using base::TestSuite; 91 using base::TestSuite;
82 92
83 #endif // BASE_TEST_TEST_SUITE_H_ 93 #endif // BASE_TEST_TEST_SUITE_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/test_suite.cc » ('j') | base/test/test_suite.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698