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

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

Issue 10582012: For unit tests, track additions to AtExitManager and warn. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back off to a warning. Created 8 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
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 #pragma once 7 #pragma once
8 8
9 // Defines a basic test suite framework for running gtest based tests. You can 9 // Defines a basic test suite framework for running gtest based tests. You can
10 // instantiate this class in your main function and call its Run method to run 10 // instantiate this class in your main function and call its Run method to run
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Returns true if the test failed and the failure shouldn't be ignored. 46 // Returns true if the test failed and the failure shouldn't be ignored.
47 static bool NonIgnoredFailures(const testing::TestInfo& test); 47 static bool NonIgnoredFailures(const testing::TestInfo& test);
48 48
49 // Returns the number of tests where the match function returns true. 49 // Returns the number of tests where the match function returns true.
50 int GetTestCount(TestMatch test_match); 50 int GetTestCount(TestMatch test_match);
51 51
52 void CatchMaybeTests(); 52 void CatchMaybeTests();
53 53
54 void ResetCommandLine(); 54 void ResetCommandLine();
55 55
56 void WatchAtExitManager();
57
56 int Run(); 58 int Run();
57 59
58 // A command-line flag that makes a test failure always result in a non-zero 60 // A command-line flag that makes a test failure always result in a non-zero
59 // process exit code. 61 // process exit code.
60 static const char kStrictFailureHandling[]; 62 static const char kStrictFailureHandling[];
61 63
62 protected: 64 protected:
63 // This constructor is only accessible to specialized test suite 65 // This constructor is only accessible to specialized test suite
64 // implementations which need to control the creation of an AtExitManager 66 // implementations which need to control the creation of an AtExitManager
65 // instance for the duration of the test. 67 // instance for the duration of the test.
(...skipping 26 matching lines...) Expand all
92 DISALLOW_COPY_AND_ASSIGN(TestSuite); 94 DISALLOW_COPY_AND_ASSIGN(TestSuite);
93 }; 95 };
94 96
95 } // namespace base 97 } // namespace base
96 98
97 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile 99 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile
98 // until we can update it to use "base::" (preventing a two-sided patch). 100 // until we can update it to use "base::" (preventing a two-sided patch).
99 using base::TestSuite; 101 using base::TestSuite;
100 102
101 #endif // BASE_TEST_TEST_SUITE_H_ 103 #endif // BASE_TEST_TEST_SUITE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698