OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SUITE_H_ | 5 #ifndef BASE_TEST_SUITE_H_ |
6 #define BASE_TEST_SUITE_H_ | 6 #define BASE_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 23 matching lines...) Expand all Loading... |
34 #include <gtk/gtk.h> | 34 #include <gtk/gtk.h> |
35 #endif | 35 #endif |
36 | 36 |
37 class TestSuite { | 37 class TestSuite { |
38 public: | 38 public: |
39 TestSuite(int argc, char** argv) { | 39 TestSuite(int argc, char** argv) { |
40 base::EnableTerminationOnHeapCorruption(); | 40 base::EnableTerminationOnHeapCorruption(); |
41 CommandLine::Init(argc, argv); | 41 CommandLine::Init(argc, argv); |
42 testing::InitGoogleTest(&argc, argv); | 42 testing::InitGoogleTest(&argc, argv); |
43 #if defined(OS_LINUX) | 43 #if defined(OS_LINUX) |
44 g_thread_init(NULL); | |
45 gtk_init_check(&argc, &argv); | 44 gtk_init_check(&argc, &argv); |
46 #endif | 45 #endif |
47 // Don't add additional code to this constructor. Instead add it to | 46 // Don't add additional code to this constructor. Instead add it to |
48 // Initialize(). See bug 6436. | 47 // Initialize(). See bug 6436. |
49 } | 48 } |
50 | 49 |
51 virtual ~TestSuite() { | 50 virtual ~TestSuite() { |
52 CommandLine::Terminate(); | 51 CommandLine::Terminate(); |
53 } | 52 } |
54 | 53 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 148 |
150 virtual void Shutdown() { | 149 virtual void Shutdown() { |
151 } | 150 } |
152 | 151 |
153 // Make sure that we setup an AtExitManager so Singleton objects will be | 152 // Make sure that we setup an AtExitManager so Singleton objects will be |
154 // destroyed. | 153 // destroyed. |
155 base::AtExitManager at_exit_manager_; | 154 base::AtExitManager at_exit_manager_; |
156 }; | 155 }; |
157 | 156 |
158 #endif // BASE_TEST_SUITE_H_ | 157 #endif // BASE_TEST_SUITE_H_ |
OLD | NEW |