diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-02-28 23:29:06 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-02-28 23:29:06 +0000 |
commit | b3ed14ac17f8f1d218a6f8dfaa18d45621cd33ff (patch) | |
tree | f4fe56a2566e52aa7473a00857bc12e4275a8d4b /include | |
parent | 1b89db97058ced81a116d6a03714fec9bd8fc721 (diff) | |
download | googletest-b3ed14ac17f8f1d218a6f8dfaa18d45621cd33ff.tar.gz googletest-b3ed14ac17f8f1d218a6f8dfaa18d45621cd33ff.tar.bz2 googletest-b3ed14ac17f8f1d218a6f8dfaa18d45621cd33ff.zip |
Implements RUN_ALL_TESTS() as a function.
Diffstat (limited to 'include')
-rw-r--r-- | include/gtest/gtest.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h index e53cd9f5..e06082c3 100644 --- a/include/gtest/gtest.h +++ b/include/gtest/gtest.h @@ -2227,15 +2227,20 @@ bool StaticAssertTypeEq() { GTEST_TEST_(test_fixture, test_name, test_fixture, \ ::testing::internal::GetTypeId<test_fixture>()) -// Use this macro in main() to run all tests. It returns 0 if all +} // namespace testing + +// Use this function in main() to run all tests. It returns 0 if all // tests are successful, or 1 otherwise. // // RUN_ALL_TESTS() should be invoked after the command line has been // parsed by InitGoogleTest(). +// +// This function was formerly a macro; thus, it is in the global +// namespace and has an all-caps name. +int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; -#define RUN_ALL_TESTS()\ - (::testing::UnitTest::GetInstance()->Run()) - -} // namespace testing +inline int RUN_ALL_TESTS() { + return ::testing::UnitTest::GetInstance()->Run(); +} #endif // GTEST_INCLUDE_GTEST_GTEST_H_ |