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

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

Issue 315403006: Convert installer_util_unittests, sbox_integration_tests, sbox_validation_tests, sbox_unittests to … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 6 years, 6 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 | « base/test/launcher/unit_test_launcher.cc ('k') | base/test/test_suite.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 (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 11 matching lines...) Expand all
22 22
23 // Instantiates TestSuite, runs it and returns exit code. 23 // Instantiates TestSuite, runs it and returns exit code.
24 int RunUnitTestsUsingBaseTestSuite(int argc, char **argv); 24 int RunUnitTestsUsingBaseTestSuite(int argc, char **argv);
25 25
26 class TestSuite { 26 class TestSuite {
27 public: 27 public:
28 // Match function used by the GetTestCount method. 28 // Match function used by the GetTestCount method.
29 typedef bool (*TestMatch)(const testing::TestInfo&); 29 typedef bool (*TestMatch)(const testing::TestInfo&);
30 30
31 TestSuite(int argc, char** argv); 31 TestSuite(int argc, char** argv);
32 #if defined(OS_WIN)
33 TestSuite(int argc, wchar_t** argv);
34 #endif // defined(OS_WIN)
32 virtual ~TestSuite(); 35 virtual ~TestSuite();
33 36
34 // Returns true if the test is marked as "MAYBE_". 37 // Returns true if the test is marked as "MAYBE_".
35 // When using different prefixes depending on platform, we use MAYBE_ and 38 // When using different prefixes depending on platform, we use MAYBE_ and
36 // preprocessor directives to replace MAYBE_ with the target prefix. 39 // preprocessor directives to replace MAYBE_ with the target prefix.
37 static bool IsMarkedMaybe(const testing::TestInfo& test); 40 static bool IsMarkedMaybe(const testing::TestInfo& test);
38 41
39 void CatchMaybeTests(); 42 void CatchMaybeTests();
40 43
41 void ResetCommandLine(); 44 void ResetCommandLine();
(...skipping 20 matching lines...) Expand all
62 // instead of putting complex code in your constructor/destructor. 65 // instead of putting complex code in your constructor/destructor.
63 66
64 virtual void Initialize(); 67 virtual void Initialize();
65 virtual void Shutdown(); 68 virtual void Shutdown();
66 69
67 // Make sure that we setup an AtExitManager so Singleton objects will be 70 // Make sure that we setup an AtExitManager so Singleton objects will be
68 // destroyed. 71 // destroyed.
69 scoped_ptr<base::AtExitManager> at_exit_manager_; 72 scoped_ptr<base::AtExitManager> at_exit_manager_;
70 73
71 private: 74 private:
75 void InitializeFromCommandLine(int argc, char** argv);
76 #if defined(OS_WIN)
77 void InitializeFromCommandLine(int argc, wchar_t** argv);
78 #endif // defined(OS_WIN)
79
72 // Basic initialization for the test suite happens here. 80 // Basic initialization for the test suite happens here.
73 void PreInitialize(int argc, char** argv, bool create_at_exit_manager); 81 void PreInitialize(bool create_at_exit_manager);
74 82
75 bool initialized_command_line_; 83 bool initialized_command_line_;
76 84
77 DISALLOW_COPY_AND_ASSIGN(TestSuite); 85 DISALLOW_COPY_AND_ASSIGN(TestSuite);
78 }; 86 };
79 87
80 } // namespace base 88 } // namespace base
81 89
82 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile 90 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile
83 // until we can update it to use "base::" (preventing a two-sided patch). 91 // until we can update it to use "base::" (preventing a two-sided patch).
84 using base::TestSuite; 92 using base::TestSuite;
85 93
86 #endif // BASE_TEST_TEST_SUITE_H_ 94 #endif // BASE_TEST_TEST_SUITE_H_
OLDNEW
« no previous file with comments | « base/test/launcher/unit_test_launcher.cc ('k') | base/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698