Commit 0599a7b8 by misterg Committed by Gennadiy Civil

Googletest export

Change tests to use new Test Suite API PiperOrigin-RevId: 228908894
parent 2edadced
...@@ -89,9 +89,9 @@ if SUPPORTS_SEH_EXCEPTIONS: ...@@ -89,9 +89,9 @@ if SUPPORTS_SEH_EXCEPTIONS:
self.assert_('SEH exception with code 0x2a thrown ' self.assert_('SEH exception with code 0x2a thrown '
'in the test fixture\'s destructor' 'in the test fixture\'s destructor'
in test_output) in test_output)
self.assert_('SEH exception with code 0x2a thrown in SetUpTestCase()' self.assert_('SEH exception with code 0x2a thrown in SetUpTestSuite()'
in test_output) in test_output)
self.assert_('SEH exception with code 0x2a thrown in TearDownTestCase()' self.assert_('SEH exception with code 0x2a thrown in TearDownTestSuite()'
in test_output) in test_output)
self.assert_('SEH exception with code 0x2a thrown in SetUp()' self.assert_('SEH exception with code 0x2a thrown in SetUp()'
in test_output) in test_output)
...@@ -134,29 +134,29 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase): ...@@ -134,29 +134,29 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
'"Standard C++ exception" thrown ' '"Standard C++ exception" thrown '
'in the test fixture\'s destructor' 'in the test fixture\'s destructor'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInDestructorTest::TearDownTestCase() ' self.assert_('CxxExceptionInDestructorTest::TearDownTestSuite() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
def testCatchesCxxExceptionsInSetUpTestCase(self): def testCatchesCxxExceptionsInSetUpTestCase(self):
self.assert_('C++ exception with description "Standard C++ exception"' self.assert_('C++ exception with description "Standard C++ exception"'
' thrown in SetUpTestSuite()' in EX_BINARY_OUTPUT) ' thrown in SetUpTestSuite()' in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInConstructorTest::TearDownTestCase() ' self.assert_('CxxExceptionInConstructorTest::TearDownTestSuite() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTestCaseTest constructor ' self.assert_('CxxExceptionInSetUpTestSuiteTest constructor '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTestCaseTest destructor ' self.assert_('CxxExceptionInSetUpTestSuiteTest destructor '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTestCaseTest::SetUp() ' self.assert_('CxxExceptionInSetUpTestSuiteTest::SetUp() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTestCaseTest::TearDown() ' self.assert_('CxxExceptionInSetUpTestSuiteTest::TearDown() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTestCaseTest test body ' self.assert_('CxxExceptionInSetUpTestSuiteTest test body '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
...@@ -168,7 +168,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase): ...@@ -168,7 +168,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
self.assert_('C++ exception with description "Standard C++ exception"' self.assert_('C++ exception with description "Standard C++ exception"'
' thrown in SetUp()' ' thrown in SetUp()'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTest::TearDownTestCase() ' self.assert_('CxxExceptionInSetUpTest::TearDownTestSuite() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInSetUpTest destructor ' self.assert_('CxxExceptionInSetUpTest destructor '
...@@ -186,7 +186,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase): ...@@ -186,7 +186,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
self.assert_('C++ exception with description "Standard C++ exception"' self.assert_('C++ exception with description "Standard C++ exception"'
' thrown in TearDown()' ' thrown in TearDown()'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInTearDownTest::TearDownTestCase() ' self.assert_('CxxExceptionInTearDownTest::TearDownTestSuite() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInTearDownTest destructor ' self.assert_('CxxExceptionInTearDownTest destructor '
...@@ -197,7 +197,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase): ...@@ -197,7 +197,7 @@ class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
self.assert_('C++ exception with description "Standard C++ exception"' self.assert_('C++ exception with description "Standard C++ exception"'
' thrown in the test body' ' thrown in the test body'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInTestBodyTest::TearDownTestCase() ' self.assert_('CxxExceptionInTestBodyTest::TearDownTestSuite() '
'called as expected.' 'called as expected.'
in EX_BINARY_OUTPUT) in EX_BINARY_OUTPUT)
self.assert_('CxxExceptionInTestBodyTest destructor ' self.assert_('CxxExceptionInTestBodyTest destructor '
......
...@@ -64,19 +64,20 @@ class SehExceptionInDestructorTest : public Test { ...@@ -64,19 +64,20 @@ class SehExceptionInDestructorTest : public Test {
TEST_F(SehExceptionInDestructorTest, ThrowsExceptionInDestructor) {} TEST_F(SehExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
class SehExceptionInSetUpTestCaseTest : public Test { class SehExceptionInSetUpTestSuiteTest : public Test {
public: public:
static void SetUpTestCase() { RaiseException(42, 0, 0, NULL); } static void SetUpTestSuite() { RaiseException(42, 0, 0, NULL); }
}; };
TEST_F(SehExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) {} TEST_F(SehExceptionInSetUpTestSuiteTest, ThrowsExceptionInSetUpTestSuite) {}
class SehExceptionInTearDownTestCaseTest : public Test { class SehExceptionInTearDownTestSuiteTest : public Test {
public: public:
static void TearDownTestCase() { RaiseException(42, 0, 0, NULL); } static void TearDownTestSuite() { RaiseException(42, 0, 0, NULL); }
}; };
TEST_F(SehExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {} TEST_F(SehExceptionInTearDownTestSuiteTest,
ThrowsExceptionInTearDownTestSuite) {}
class SehExceptionInSetUpTest : public Test { class SehExceptionInSetUpTest : public Test {
protected: protected:
...@@ -109,9 +110,9 @@ class CxxExceptionInConstructorTest : public Test { ...@@ -109,9 +110,9 @@ class CxxExceptionInConstructorTest : public Test {
throw std::runtime_error("Standard C++ exception")); throw std::runtime_error("Standard C++ exception"));
} }
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("%s", printf("%s",
"CxxExceptionInConstructorTest::TearDownTestCase() " "CxxExceptionInConstructorTest::TearDownTestSuite() "
"called as expected.\n"); "called as expected.\n");
} }
...@@ -137,65 +138,65 @@ TEST_F(CxxExceptionInConstructorTest, ThrowsExceptionInConstructor) { ...@@ -137,65 +138,65 @@ TEST_F(CxxExceptionInConstructorTest, ThrowsExceptionInConstructor) {
<< "called unexpectedly."; << "called unexpectedly.";
} }
class CxxExceptionInSetUpTestSuiteTest : public Test {
class CxxExceptionInSetUpTestCaseTest : public Test {
public: public:
CxxExceptionInSetUpTestCaseTest() { CxxExceptionInSetUpTestSuiteTest() {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest constructor " "CxxExceptionInSetUpTestSuiteTest constructor "
"called as expected.\n"); "called as expected.\n");
} }
static void SetUpTestCase() { static void SetUpTestSuite() {
throw std::runtime_error("Standard C++ exception"); throw std::runtime_error("Standard C++ exception");
} }
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest::TearDownTestCase() " "CxxExceptionInSetUpTestSuiteTest::TearDownTestSuite() "
"called as expected.\n"); "called as expected.\n");
} }
protected: protected:
~CxxExceptionInSetUpTestCaseTest() override { ~CxxExceptionInSetUpTestSuiteTest() override {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest destructor " "CxxExceptionInSetUpTestSuiteTest destructor "
"called as expected.\n"); "called as expected.\n");
} }
void SetUp() override { void SetUp() override {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest::SetUp() " "CxxExceptionInSetUpTestSuiteTest::SetUp() "
"called as expected.\n"); "called as expected.\n");
} }
void TearDown() override { void TearDown() override {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest::TearDown() " "CxxExceptionInSetUpTestSuiteTest::TearDown() "
"called as expected.\n"); "called as expected.\n");
} }
}; };
TEST_F(CxxExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) { TEST_F(CxxExceptionInSetUpTestSuiteTest, ThrowsExceptionInSetUpTestSuite) {
printf("%s", printf("%s",
"CxxExceptionInSetUpTestCaseTest test body " "CxxExceptionInSetUpTestSuiteTest test body "
"called as expected.\n"); "called as expected.\n");
} }
class CxxExceptionInTearDownTestCaseTest : public Test { class CxxExceptionInTearDownTestSuiteTest : public Test {
public: public:
static void TearDownTestCase() { static void TearDownTestSuite() {
throw std::runtime_error("Standard C++ exception"); throw std::runtime_error("Standard C++ exception");
} }
}; };
TEST_F(CxxExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {} TEST_F(CxxExceptionInTearDownTestSuiteTest,
ThrowsExceptionInTearDownTestSuite) {}
class CxxExceptionInSetUpTest : public Test { class CxxExceptionInSetUpTest : public Test {
public: public:
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("%s", printf("%s",
"CxxExceptionInSetUpTest::TearDownTestCase() " "CxxExceptionInSetUpTest::TearDownTestSuite() "
"called as expected.\n"); "called as expected.\n");
} }
...@@ -222,9 +223,9 @@ TEST_F(CxxExceptionInSetUpTest, ThrowsExceptionInSetUp) { ...@@ -222,9 +223,9 @@ TEST_F(CxxExceptionInSetUpTest, ThrowsExceptionInSetUp) {
class CxxExceptionInTearDownTest : public Test { class CxxExceptionInTearDownTest : public Test {
public: public:
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("%s", printf("%s",
"CxxExceptionInTearDownTest::TearDownTestCase() " "CxxExceptionInTearDownTest::TearDownTestSuite() "
"called as expected.\n"); "called as expected.\n");
} }
...@@ -244,9 +245,9 @@ TEST_F(CxxExceptionInTearDownTest, ThrowsExceptionInTearDown) {} ...@@ -244,9 +245,9 @@ TEST_F(CxxExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
class CxxExceptionInTestBodyTest : public Test { class CxxExceptionInTestBodyTest : public Test {
public: public:
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("%s", printf("%s",
"CxxExceptionInTestBodyTest::TearDownTestCase() " "CxxExceptionInTestBodyTest::TearDownTestSuite() "
"called as expected.\n"); "called as expected.\n");
} }
......
...@@ -1017,12 +1017,12 @@ class MacroLogicDeathTest : public testing::Test { ...@@ -1017,12 +1017,12 @@ class MacroLogicDeathTest : public testing::Test {
static testing::internal::ReplaceDeathTestFactory* replacer_; static testing::internal::ReplaceDeathTestFactory* replacer_;
static MockDeathTestFactory* factory_; static MockDeathTestFactory* factory_;
static void SetUpTestCase() { static void SetUpTestSuite() {
factory_ = new MockDeathTestFactory; factory_ = new MockDeathTestFactory;
replacer_ = new testing::internal::ReplaceDeathTestFactory(factory_); replacer_ = new testing::internal::ReplaceDeathTestFactory(factory_);
} }
static void TearDownTestCase() { static void TearDownTestSuite() {
delete replacer_; delete replacer_;
replacer_ = nullptr; replacer_ = nullptr;
delete factory_; delete factory_;
......
...@@ -125,8 +125,8 @@ TEST_P(ParamTest, TestX) { ...@@ -125,8 +125,8 @@ TEST_P(ParamTest, TestX) {
TEST_P(ParamTest, TestY) { TEST_P(ParamTest, TestY) {
} }
INSTANTIATE_TEST_CASE_P(SeqP, ParamTest, testing::Values(1, 2)); INSTANTIATE_TEST_SUITE_P(SeqP, ParamTest, testing::Values(1, 2));
INSTANTIATE_TEST_CASE_P(SeqQ, ParamTest, testing::Values(5, 6)); INSTANTIATE_TEST_SUITE_P(SeqQ, ParamTest, testing::Values(5, 6));
} // namespace } // namespace
......
...@@ -241,8 +241,8 @@ EXPECTED_NON_EMPTY = { ...@@ -241,8 +241,8 @@ EXPECTED_NON_EMPTY = {
u'disabled': 0, u'disabled': 0,
u'errors': 0, u'errors': 0,
u'time': u'*', u'time': u'*',
u'SetUpTestCase': u'yes', u'SetUpTestSuite': u'yes',
u'TearDownTestCase': u'aye', u'TearDownTestSuite': u'aye',
u'testsuite': [ u'testsuite': [
{ {
u'name': u'OneProperty', u'name': u'OneProperty',
...@@ -343,7 +343,7 @@ EXPECTED_NON_EMPTY = { ...@@ -343,7 +343,7 @@ EXPECTED_NON_EMPTY = {
] ]
}, },
{ {
u'name': u'Single/TypeParameterizedTestCase/0', u'name': u'Single/TypeParameterizedTestSuite/0',
u'tests': 1, u'tests': 1,
u'failures': 0, u'failures': 0,
u'disabled': 0, u'disabled': 0,
...@@ -355,12 +355,12 @@ EXPECTED_NON_EMPTY = { ...@@ -355,12 +355,12 @@ EXPECTED_NON_EMPTY = {
u'type_param': u'int', u'type_param': u'int',
u'status': u'RUN', u'status': u'RUN',
u'time': u'*', u'time': u'*',
u'classname': u'Single/TypeParameterizedTestCase/0' u'classname': u'Single/TypeParameterizedTestSuite/0'
} }
] ]
}, },
{ {
u'name': u'Single/TypeParameterizedTestCase/1', u'name': u'Single/TypeParameterizedTestSuite/1',
u'tests': 1, u'tests': 1,
u'failures': 0, u'failures': 0,
u'disabled': 0, u'disabled': 0,
...@@ -372,7 +372,7 @@ EXPECTED_NON_EMPTY = { ...@@ -372,7 +372,7 @@ EXPECTED_NON_EMPTY = {
u'type_param': u'long', u'type_param': u'long',
u'status': u'RUN', u'status': u'RUN',
u'time': u'*', u'time': u'*',
u'classname': u'Single/TypeParameterizedTestCase/1' u'classname': u'Single/TypeParameterizedTestSuite/1'
} }
] ]
}, },
......
...@@ -99,7 +99,7 @@ TEST_P(ValueParamTest, TestA) { ...@@ -99,7 +99,7 @@ TEST_P(ValueParamTest, TestA) {
TEST_P(ValueParamTest, TestB) { TEST_P(ValueParamTest, TestB) {
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MyInstantiation, ValueParamTest, MyInstantiation, ValueParamTest,
testing::Values(MyType("one line"), testing::Values(MyType("one line"),
MyType("two\nlines"), MyType("two\nlines"),
...@@ -123,7 +123,7 @@ class MyArray { ...@@ -123,7 +123,7 @@ class MyArray {
typedef testing::Types<VeryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogName, // NOLINT typedef testing::Types<VeryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogName, // NOLINT
int*, MyArray<bool, 42> > MyTypes; int*, MyArray<bool, 42> > MyTypes;
TYPED_TEST_CASE(TypedTest, MyTypes); TYPED_TEST_SUITE(TypedTest, MyTypes);
TYPED_TEST(TypedTest, TestA) { TYPED_TEST(TypedTest, TestA) {
} }
...@@ -137,7 +137,7 @@ template <typename T> ...@@ -137,7 +137,7 @@ template <typename T>
class TypeParamTest : public testing::Test { class TypeParamTest : public testing::Test {
}; };
TYPED_TEST_CASE_P(TypeParamTest); TYPED_TEST_SUITE_P(TypeParamTest);
TYPED_TEST_P(TypeParamTest, TestA) { TYPED_TEST_P(TypeParamTest, TestA) {
} }
...@@ -145,9 +145,9 @@ TYPED_TEST_P(TypeParamTest, TestA) { ...@@ -145,9 +145,9 @@ TYPED_TEST_P(TypeParamTest, TestA) {
TYPED_TEST_P(TypeParamTest, TestB) { TYPED_TEST_P(TypeParamTest, TestB) {
} }
REGISTER_TYPED_TEST_CASE_P(TypeParamTest, TestA, TestB); REGISTER_TYPED_TEST_SUITE_P(TypeParamTest, TestA, TestB);
INSTANTIATE_TYPED_TEST_CASE_P(My, TypeParamTest, MyTypes); INSTANTIATE_TYPED_TEST_SUITE_P(My, TypeParamTest, MyTypes);
int main(int argc, char **argv) { int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
......
...@@ -40,7 +40,7 @@ using ::testing::AddGlobalTestEnvironment; ...@@ -40,7 +40,7 @@ using ::testing::AddGlobalTestEnvironment;
using ::testing::Environment; using ::testing::Environment;
using ::testing::InitGoogleTest; using ::testing::InitGoogleTest;
using ::testing::Test; using ::testing::Test;
using ::testing::TestCase; using ::testing::TestSuite;
using ::testing::TestEventListener; using ::testing::TestEventListener;
using ::testing::TestInfo; using ::testing::TestInfo;
using ::testing::TestPartResult; using ::testing::TestPartResult;
...@@ -206,12 +206,12 @@ class EnvironmentInvocationCatcher : public Environment { ...@@ -206,12 +206,12 @@ class EnvironmentInvocationCatcher : public Environment {
class ListenerTest : public Test { class ListenerTest : public Test {
protected: protected:
static void SetUpTestCase() { static void SetUpTestSuite() {
g_events->push_back("ListenerTest::SetUpTestCase"); g_events->push_back("ListenerTest::SetUpTestSuite");
} }
static void TearDownTestCase() { static void TearDownTestSuite() {
g_events->push_back("ListenerTest::TearDownTestCase"); g_events->push_back("ListenerTest::TearDownTestSuite");
} }
void SetUp() override { g_events->push_back("ListenerTest::SetUp"); } void SetUp() override { g_events->push_back("ListenerTest::SetUp"); }
...@@ -299,7 +299,7 @@ int main(int argc, char **argv) { ...@@ -299,7 +299,7 @@ int main(int argc, char **argv) {
"3rd.OnTestSuiteStart", "3rd.OnTestSuiteStart",
"1st.OnTestCaseStart", "1st.OnTestCaseStart",
"2nd.OnTestCaseStart", "2nd.OnTestCaseStart",
"ListenerTest::SetUpTestCase", "ListenerTest::SetUpTestSuite",
"1st.OnTestStart", "1st.OnTestStart",
"2nd.OnTestStart", "2nd.OnTestStart",
"3rd.OnTestStart", "3rd.OnTestStart",
...@@ -324,7 +324,7 @@ int main(int argc, char **argv) { ...@@ -324,7 +324,7 @@ int main(int argc, char **argv) {
"3rd.OnTestEnd", "3rd.OnTestEnd",
"2nd.OnTestEnd", "2nd.OnTestEnd",
"1st.OnTestEnd", "1st.OnTestEnd",
"ListenerTest::TearDownTestCase", "ListenerTest::TearDownTestSuite",
"3rd.OnTestSuiteEnd", "3rd.OnTestSuiteEnd",
"2nd.OnTestCaseEnd", "2nd.OnTestCaseEnd",
"1st.OnTestCaseEnd", "1st.OnTestCaseEnd",
...@@ -351,7 +351,7 @@ int main(int argc, char **argv) { ...@@ -351,7 +351,7 @@ int main(int argc, char **argv) {
"3rd.OnTestSuiteStart", "3rd.OnTestSuiteStart",
"1st.OnTestCaseStart", "1st.OnTestCaseStart",
"2nd.OnTestCaseStart", "2nd.OnTestCaseStart",
"ListenerTest::SetUpTestCase", "ListenerTest::SetUpTestSuite",
"1st.OnTestStart", "1st.OnTestStart",
"2nd.OnTestStart", "2nd.OnTestStart",
"3rd.OnTestStart", "3rd.OnTestStart",
...@@ -376,7 +376,7 @@ int main(int argc, char **argv) { ...@@ -376,7 +376,7 @@ int main(int argc, char **argv) {
"3rd.OnTestEnd", "3rd.OnTestEnd",
"2nd.OnTestEnd", "2nd.OnTestEnd",
"1st.OnTestEnd", "1st.OnTestEnd",
"ListenerTest::TearDownTestCase", "ListenerTest::TearDownTestSuite",
"3rd.OnTestSuiteEnd", "3rd.OnTestSuiteEnd",
"2nd.OnTestCaseEnd", "2nd.OnTestCaseEnd",
"1st.OnTestCaseEnd", "1st.OnTestCaseEnd",
......
...@@ -384,16 +384,16 @@ Expected failure in foo.cc ...@@ -384,16 +384,16 @@ Expected failure in foo.cc
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber [ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
[----------] 4 tests from MixedUpTestCaseTest [----------] 4 tests from MixedUpTestSuiteTest
[ RUN ] MixedUpTestCaseTest.FirstTestFromNamespaceFoo [ RUN ] MixedUpTestSuiteTest.FirstTestFromNamespaceFoo
[ OK ] MixedUpTestCaseTest.FirstTestFromNamespaceFoo [ OK ] MixedUpTestSuiteTest.FirstTestFromNamespaceFoo
[ RUN ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo [ RUN ] MixedUpTestSuiteTest.SecondTestFromNamespaceFoo
[ OK ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo [ OK ] MixedUpTestSuiteTest.SecondTestFromNamespaceFoo
[ RUN ] MixedUpTestCaseTest.ThisShouldFail [ RUN ] MixedUpTestSuiteTest.ThisShouldFail
gtest.cc:#: Failure gtest.cc:#: Failure
Failed Failed
All tests in the same test suite must use the same test fixture All tests in the same test suite must use the same test fixture
class. However, in test suite MixedUpTestCaseTest, class. However, in test suite MixedUpTestSuiteTest,
you defined test FirstTestFromNamespaceFoo and test ThisShouldFail you defined test FirstTestFromNamespaceFoo and test ThisShouldFail
using two different test fixture classes. This can happen if using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation the two classes are from different namespaces or translation
...@@ -401,12 +401,12 @@ units and have the same name. You should probably rename one ...@@ -401,12 +401,12 @@ units and have the same name. You should probably rename one
of the classes to put the tests into different test suites. of the classes to put the tests into different test suites.
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] MixedUpTestCaseTest.ThisShouldFail [ FAILED ] MixedUpTestSuiteTest.ThisShouldFail
[ RUN ] MixedUpTestCaseTest.ThisShouldFailToo [ RUN ] MixedUpTestSuiteTest.ThisShouldFailToo
gtest.cc:#: Failure gtest.cc:#: Failure
Failed Failed
All tests in the same test suite must use the same test fixture All tests in the same test suite must use the same test fixture
class. However, in test suite MixedUpTestCaseTest, class. However, in test suite MixedUpTestSuiteTest,
you defined test FirstTestFromNamespaceFoo and test ThisShouldFailToo you defined test FirstTestFromNamespaceFoo and test ThisShouldFailToo
using two different test fixture classes. This can happen if using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation the two classes are from different namespaces or translation
...@@ -414,15 +414,15 @@ units and have the same name. You should probably rename one ...@@ -414,15 +414,15 @@ units and have the same name. You should probably rename one
of the classes to put the tests into different test suites. of the classes to put the tests into different test suites.
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] MixedUpTestCaseTest.ThisShouldFailToo [ FAILED ] MixedUpTestSuiteTest.ThisShouldFailToo
[----------] 2 tests from MixedUpTestCaseWithSameTestNameTest [----------] 2 tests from MixedUpTestSuiteWithSameTestNameTest
[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail [ RUN ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[ OK ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail [ OK ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail [ RUN ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
gtest.cc:#: Failure gtest.cc:#: Failure
Failed Failed
All tests in the same test suite must use the same test fixture All tests in the same test suite must use the same test fixture
class. However, in test suite MixedUpTestCaseWithSameTestNameTest, class. However, in test suite MixedUpTestSuiteWithSameTestNameTest,
you defined test TheSecondTestWithThisNameShouldFail and test TheSecondTestWithThisNameShouldFail you defined test TheSecondTestWithThisNameShouldFail and test TheSecondTestWithThisNameShouldFail
using two different test fixture classes. This can happen if using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation the two classes are from different namespaces or translation
...@@ -430,7 +430,7 @@ units and have the same name. You should probably rename one ...@@ -430,7 +430,7 @@ units and have the same name. You should probably rename one
of the classes to put the tests into different test suites. of the classes to put the tests into different test suites.
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail [ FAILED ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[----------] 2 tests from TEST_F_before_TEST_in_same_test_case [----------] 2 tests from TEST_F_before_TEST_in_same_test_case
[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F [ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
[ OK ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F [ OK ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
...@@ -871,7 +871,7 @@ Stack trace: (omitted) ...@@ -871,7 +871,7 @@ Stack trace: (omitted)
[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread [ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[----------] 2 tests from DynamicFixture [----------] 2 tests from DynamicFixture
DynamicFixture::SetUpTestCase DynamicFixture::SetUpTestSuite
[ RUN ] DynamicFixture.DynamicTestPass [ RUN ] DynamicFixture.DynamicTestPass
DynamicFixture() DynamicFixture()
DynamicFixture::SetUp DynamicFixture::SetUp
...@@ -890,18 +890,18 @@ Stack trace: (omitted) ...@@ -890,18 +890,18 @@ Stack trace: (omitted)
DynamicFixture::TearDown DynamicFixture::TearDown
~DynamicFixture() ~DynamicFixture()
[ FAILED ] DynamicFixture.DynamicTestFail [ FAILED ] DynamicFixture.DynamicTestFail
DynamicFixture::TearDownTestCase DynamicFixture::TearDownTestSuite
[----------] 1 test from DynamicFixtureAnotherName [----------] 1 test from DynamicFixtureAnotherName
DynamicFixture::SetUpTestCase DynamicFixture::SetUpTestSuite
[ RUN ] DynamicFixtureAnotherName.DynamicTestPass [ RUN ] DynamicFixtureAnotherName.DynamicTestPass
DynamicFixture() DynamicFixture()
DynamicFixture::SetUp DynamicFixture::SetUp
DynamicFixture::TearDown DynamicFixture::TearDown
~DynamicFixture() ~DynamicFixture()
[ OK ] DynamicFixtureAnotherName.DynamicTestPass [ OK ] DynamicFixtureAnotherName.DynamicTestPass
DynamicFixture::TearDownTestCase DynamicFixture::TearDownTestSuite
[----------] 2 tests from BadDynamicFixture1 [----------] 2 tests from BadDynamicFixture1
DynamicFixture::SetUpTestCase DynamicFixture::SetUpTestSuite
[ RUN ] BadDynamicFixture1.FixtureBase [ RUN ] BadDynamicFixture1.FixtureBase
DynamicFixture() DynamicFixture()
DynamicFixture::SetUp DynamicFixture::SetUp
...@@ -923,9 +923,9 @@ Stack trace: (omitted) ...@@ -923,9 +923,9 @@ Stack trace: (omitted)
~DynamicFixture() ~DynamicFixture()
[ FAILED ] BadDynamicFixture1.TestBase [ FAILED ] BadDynamicFixture1.TestBase
DynamicFixture::TearDownTestCase DynamicFixture::TearDownTestSuite
[----------] 2 tests from BadDynamicFixture2 [----------] 2 tests from BadDynamicFixture2
DynamicFixture::SetUpTestCase DynamicFixture::SetUpTestSuite
[ RUN ] BadDynamicFixture2.FixtureBase [ RUN ] BadDynamicFixture2.FixtureBase
DynamicFixture() DynamicFixture()
DynamicFixture::SetUp DynamicFixture::SetUp
...@@ -947,7 +947,7 @@ Stack trace: (omitted) ...@@ -947,7 +947,7 @@ Stack trace: (omitted)
~DynamicFixture() ~DynamicFixture()
[ FAILED ] BadDynamicFixture2.Derived [ FAILED ] BadDynamicFixture2.Derived
DynamicFixture::TearDownTestCase DynamicFixture::TearDownTestSuite
[----------] 1 test from PrintingFailingParams/FailingParamTest [----------] 1 test from PrintingFailingParams/FailingParamTest
[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0 [ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
googletest-output-test_.cc:#: Failure googletest-output-test_.cc:#: Failure
...@@ -1006,9 +1006,9 @@ Stack trace: (omitted) ...@@ -1006,9 +1006,9 @@ Stack trace: (omitted)
[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp [ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp [ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber [ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
[ FAILED ] MixedUpTestCaseTest.ThisShouldFail [ FAILED ] MixedUpTestSuiteTest.ThisShouldFail
[ FAILED ] MixedUpTestCaseTest.ThisShouldFailToo [ FAILED ] MixedUpTestSuiteTest.ThisShouldFailToo
[ FAILED ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail [ FAILED ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail [ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail [ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure [ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
......
...@@ -92,9 +92,9 @@ TEST_P(FailingParamTest, Fails) { ...@@ -92,9 +92,9 @@ TEST_P(FailingParamTest, Fails) {
// This generates a test which will fail. Google Test is expected to print // This generates a test which will fail. Google Test is expected to print
// its parameter when it outputs the list of all failed tests. // its parameter when it outputs the list of all failed tests.
INSTANTIATE_TEST_CASE_P(PrintingFailingParams, INSTANTIATE_TEST_SUITE_P(PrintingFailingParams,
FailingParamTest, FailingParamTest,
testing::Values(2)); testing::Values(2));
static const char kGoldenString[] = "\"Line\0 1\"\nLine 2"; static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
...@@ -521,48 +521,48 @@ class DeathTestAndMultiThreadsTest : public testing::Test { ...@@ -521,48 +521,48 @@ class DeathTestAndMultiThreadsTest : public testing::Test {
#endif // GTEST_IS_THREADSAFE #endif // GTEST_IS_THREADSAFE
// The MixedUpTestCaseTest test case verifies that Google Test will fail a // The MixedUpTestSuiteTest test case verifies that Google Test will fail a
// test if it uses a different fixture class than what other tests in // test if it uses a different fixture class than what other tests in
// the same test case use. It deliberately contains two fixture // the same test case use. It deliberately contains two fixture
// classes with the same name but defined in different namespaces. // classes with the same name but defined in different namespaces.
// The MixedUpTestCaseWithSameTestNameTest test case verifies that // The MixedUpTestSuiteWithSameTestNameTest test case verifies that
// when the user defines two tests with the same test case name AND // when the user defines two tests with the same test case name AND
// same test name (but in different namespaces), the second test will // same test name (but in different namespaces), the second test will
// fail. // fail.
namespace foo { namespace foo {
class MixedUpTestCaseTest : public testing::Test { class MixedUpTestSuiteTest : public testing::Test {
}; };
TEST_F(MixedUpTestCaseTest, FirstTestFromNamespaceFoo) {} TEST_F(MixedUpTestSuiteTest, FirstTestFromNamespaceFoo) {}
TEST_F(MixedUpTestCaseTest, SecondTestFromNamespaceFoo) {} TEST_F(MixedUpTestSuiteTest, SecondTestFromNamespaceFoo) {}
class MixedUpTestCaseWithSameTestNameTest : public testing::Test { class MixedUpTestSuiteWithSameTestNameTest : public testing::Test {
}; };
TEST_F(MixedUpTestCaseWithSameTestNameTest, TEST_F(MixedUpTestSuiteWithSameTestNameTest,
TheSecondTestWithThisNameShouldFail) {} TheSecondTestWithThisNameShouldFail) {}
} // namespace foo } // namespace foo
namespace bar { namespace bar {
class MixedUpTestCaseTest : public testing::Test { class MixedUpTestSuiteTest : public testing::Test {
}; };
// The following two tests are expected to fail. We rely on the // The following two tests are expected to fail. We rely on the
// golden file to check that Google Test generates the right error message. // golden file to check that Google Test generates the right error message.
TEST_F(MixedUpTestCaseTest, ThisShouldFail) {} TEST_F(MixedUpTestSuiteTest, ThisShouldFail) {}
TEST_F(MixedUpTestCaseTest, ThisShouldFailToo) {} TEST_F(MixedUpTestSuiteTest, ThisShouldFailToo) {}
class MixedUpTestCaseWithSameTestNameTest : public testing::Test { class MixedUpTestSuiteWithSameTestNameTest : public testing::Test {
}; };
// Expected to fail. We rely on the golden file to check that Google Test // Expected to fail. We rely on the golden file to check that Google Test
// generates the right error message. // generates the right error message.
TEST_F(MixedUpTestCaseWithSameTestNameTest, TEST_F(MixedUpTestSuiteWithSameTestNameTest,
TheSecondTestWithThisNameShouldFail) {} TheSecondTestWithThisNameShouldFail) {}
} // namespace bar } // namespace bar
...@@ -773,10 +773,10 @@ TEST_P(ParamTest, Failure) { ...@@ -773,10 +773,10 @@ TEST_P(ParamTest, Failure) {
EXPECT_EQ("b", GetParam()) << "Expected failure"; EXPECT_EQ("b", GetParam()) << "Expected failure";
} }
INSTANTIATE_TEST_CASE_P(PrintingStrings, INSTANTIATE_TEST_SUITE_P(PrintingStrings,
ParamTest, ParamTest,
testing::Values(std::string("a")), testing::Values(std::string("a")),
ParamNameFunc); ParamNameFunc);
// This #ifdef block tests the output of typed tests. // This #ifdef block tests the output of typed tests.
#if GTEST_HAS_TYPED_TEST #if GTEST_HAS_TYPED_TEST
...@@ -785,7 +785,7 @@ template <typename T> ...@@ -785,7 +785,7 @@ template <typename T>
class TypedTest : public testing::Test { class TypedTest : public testing::Test {
}; };
TYPED_TEST_CASE(TypedTest, testing::Types<int>); TYPED_TEST_SUITE(TypedTest, testing::Types<int>);
TYPED_TEST(TypedTest, Success) { TYPED_TEST(TypedTest, Success) {
EXPECT_EQ(0, TypeParam()); EXPECT_EQ(0, TypeParam());
...@@ -811,7 +811,7 @@ class TypedTestNames { ...@@ -811,7 +811,7 @@ class TypedTestNames {
} }
}; };
TYPED_TEST_CASE(TypedTestWithNames, TypesForTestWithNames, TypedTestNames); TYPED_TEST_SUITE(TypedTestWithNames, TypesForTestWithNames, TypedTestNames);
TYPED_TEST(TypedTestWithNames, Success) {} TYPED_TEST(TypedTestWithNames, Success) {}
...@@ -826,7 +826,7 @@ template <typename T> ...@@ -826,7 +826,7 @@ template <typename T>
class TypedTestP : public testing::Test { class TypedTestP : public testing::Test {
}; };
TYPED_TEST_CASE_P(TypedTestP); TYPED_TEST_SUITE_P(TypedTestP);
TYPED_TEST_P(TypedTestP, Success) { TYPED_TEST_P(TypedTestP, Success) {
EXPECT_EQ(0U, TypeParam()); EXPECT_EQ(0U, TypeParam());
...@@ -836,10 +836,10 @@ TYPED_TEST_P(TypedTestP, Failure) { ...@@ -836,10 +836,10 @@ TYPED_TEST_P(TypedTestP, Failure) {
EXPECT_EQ(1U, TypeParam()) << "Expected failure"; EXPECT_EQ(1U, TypeParam()) << "Expected failure";
} }
REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure); REGISTER_TYPED_TEST_SUITE_P(TypedTestP, Success, Failure);
typedef testing::Types<unsigned char, unsigned int> UnsignedTypes; typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes); INSTANTIATE_TYPED_TEST_SUITE_P(Unsigned, TypedTestP, UnsignedTypes);
class TypedTestPNames { class TypedTestPNames {
public: public:
...@@ -854,7 +854,7 @@ class TypedTestPNames { ...@@ -854,7 +854,7 @@ class TypedTestPNames {
} }
}; };
INSTANTIATE_TYPED_TEST_CASE_P(UnsignedCustomName, TypedTestP, UnsignedTypes, INSTANTIATE_TYPED_TEST_SUITE_P(UnsignedCustomName, TypedTestP, UnsignedTypes,
TypedTestPNames); TypedTestPNames);
#endif // GTEST_HAS_TYPED_TEST_P #endif // GTEST_HAS_TYPED_TEST_P
...@@ -877,7 +877,7 @@ class ATypedDeathTest : public testing::Test { ...@@ -877,7 +877,7 @@ class ATypedDeathTest : public testing::Test {
}; };
typedef testing::Types<int, double> NumericTypes; typedef testing::Types<int, double> NumericTypes;
TYPED_TEST_CASE(ATypedDeathTest, NumericTypes); TYPED_TEST_SUITE(ATypedDeathTest, NumericTypes);
TYPED_TEST(ATypedDeathTest, ShouldRunFirst) { TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
} }
...@@ -894,14 +894,14 @@ template <typename T> ...@@ -894,14 +894,14 @@ template <typename T>
class ATypeParamDeathTest : public testing::Test { class ATypeParamDeathTest : public testing::Test {
}; };
TYPED_TEST_CASE_P(ATypeParamDeathTest); TYPED_TEST_SUITE_P(ATypeParamDeathTest);
TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) { TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
} }
REGISTER_TYPED_TEST_CASE_P(ATypeParamDeathTest, ShouldRunFirst); REGISTER_TYPED_TEST_SUITE_P(ATypeParamDeathTest, ShouldRunFirst);
INSTANTIATE_TYPED_TEST_CASE_P(My, ATypeParamDeathTest, NumericTypes); INSTANTIATE_TYPED_TEST_SUITE_P(My, ATypeParamDeathTest, NumericTypes);
# endif // GTEST_HAS_TYPED_TEST_P # endif // GTEST_HAS_TYPED_TEST_P
...@@ -1031,9 +1031,9 @@ class DynamicFixture : public testing::Test { ...@@ -1031,9 +1031,9 @@ class DynamicFixture : public testing::Test {
void SetUp() override { printf("DynamicFixture::SetUp\n"); } void SetUp() override { printf("DynamicFixture::SetUp\n"); }
void TearDown() override { printf("DynamicFixture::TearDown\n"); } void TearDown() override { printf("DynamicFixture::TearDown\n"); }
static void SetUpTestCase() { printf("DynamicFixture::SetUpTestCase\n"); } static void SetUpTestSuite() { printf("DynamicFixture::SetUpTestSuite\n"); }
static void TearDownTestCase() { static void TearDownTestSuite() {
printf("DynamicFixture::TearDownTestCase\n"); printf("DynamicFixture::TearDownTestSuite\n");
} }
}; };
......
...@@ -36,10 +36,10 @@ class DummyTest : public ::testing::TestWithParam<const char *> {}; ...@@ -36,10 +36,10 @@ class DummyTest : public ::testing::TestWithParam<const char *> {};
TEST_P(DummyTest, Dummy) { TEST_P(DummyTest, Dummy) {
} }
INSTANTIATE_TEST_CASE_P(InvalidTestName, INSTANTIATE_TEST_SUITE_P(InvalidTestName,
DummyTest, DummyTest,
::testing::Values("InvalidWithQuotes"), ::testing::Values("InvalidWithQuotes"),
::testing::PrintToStringParamName()); ::testing::PrintToStringParamName());
} // namespace } // namespace
......
...@@ -41,10 +41,10 @@ std::string StringParamTestSuffix( ...@@ -41,10 +41,10 @@ std::string StringParamTestSuffix(
TEST_P(DummyTest, Dummy) { TEST_P(DummyTest, Dummy) {
} }
INSTANTIATE_TEST_CASE_P(DuplicateTestNames, INSTANTIATE_TEST_SUITE_P(DuplicateTestNames,
DummyTest, DummyTest,
::testing::Values("a", "b", "a", "c"), ::testing::Values("a", "b", "a", "c"),
StringParamTestSuffix); StringParamTestSuffix);
} // namespace } // namespace
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
......
...@@ -44,7 +44,7 @@ class ExternalInstantiationTest : public ::testing::TestWithParam<int> { ...@@ -44,7 +44,7 @@ class ExternalInstantiationTest : public ::testing::TestWithParam<int> {
// Test fixture for testing instantiation of a test in multiple // Test fixture for testing instantiation of a test in multiple
// translation units. // translation units.
class InstantiationInMultipleTranslaionUnitsTest class InstantiationInMultipleTranslationUnitsTest
: public ::testing::TestWithParam<int> { : public ::testing::TestWithParam<int> {
}; };
......
...@@ -46,16 +46,16 @@ ParamGenerator<int> extern_gen = Values(33); ...@@ -46,16 +46,16 @@ ParamGenerator<int> extern_gen = Values(33);
// and instantiated in another. The test is defined in // and instantiated in another. The test is defined in
// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is // googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
// defined in gtest-param-test_test.h. // defined in gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P(MultiplesOf33, INSTANTIATE_TEST_SUITE_P(MultiplesOf33,
ExternalInstantiationTest, ExternalInstantiationTest,
Values(33, 66)); Values(33, 66));
// Tests that a parameterized test case can be instantiated // Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined // in multiple translation units. Another instantiation is defined
// in googletest-param-test-test.cc and // in googletest-param-test-test.cc and
// InstantiationInMultipleTranslaionUnitsTest fixture is defined in // InstantiationInMultipleTranslationUnitsTest fixture is defined in
// gtest-param-test_test.h // gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P(Sequence2, INSTANTIATE_TEST_SUITE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest, InstantiationInMultipleTranslationUnitsTest,
Values(42*3, 42*4, 42*5)); Values(42*3, 42*4, 42*5));
...@@ -393,7 +393,7 @@ typedef testing::Types< ...@@ -393,7 +393,7 @@ typedef testing::Types<
# endif // GTEST_HAS_GLOBAL_STRING # endif // GTEST_HAS_GLOBAL_STRING
const char*> StringTypes; const char*> StringTypes;
TYPED_TEST_CASE(RETest, StringTypes); TYPED_TEST_SUITE(RETest, StringTypes);
// Tests RE's implicit constructors. // Tests RE's implicit constructors.
TYPED_TEST(RETest, ImplicitConstructorWorks) { TYPED_TEST(RETest, ImplicitConstructorWorks) {
......
...@@ -46,16 +46,16 @@ ParamGenerator<int> extern_gen_2 = Values(33); ...@@ -46,16 +46,16 @@ ParamGenerator<int> extern_gen_2 = Values(33);
// and instantiated in another. The test is defined in // and instantiated in another. The test is defined in
// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is // googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
// defined in gtest-param-test_test.h. // defined in gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P(MultiplesOf33, INSTANTIATE_TEST_SUITE_P(MultiplesOf33,
ExternalInstantiationTest, ExternalInstantiationTest,
Values(33, 66)); Values(33, 66));
// Tests that a parameterized test case can be instantiated // Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined // in multiple translation units. Another instantiation is defined
// in googletest-param-test-test.cc and // in googletest-param-test-test.cc and
// InstantiationInMultipleTranslaionUnitsTest fixture is defined in // InstantiationInMultipleTranslationUnitsTest fixture is defined in
// gtest-param-test_test.h // gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P(Sequence2, INSTANTIATE_TEST_SUITE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest, InstantiationInMultipleTranslationUnitsTest,
Values(42*3, 42*4, 42*5)); Values(42*3, 42*4, 42*5));
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
// Tests that the same type-parameterized test case can be // Tests that the same type-parameterized test case can be
// instantiated in different translation units linked together. // instantiated in different translation units linked together.
// (ContainerTest is also instantiated in gtest-typed-test_test.cc.) // (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest, INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest,
testing::Types<std::vector<int> >); testing::Types<std::vector<int> >);
#endif // GTEST_HAS_TYPED_TEST_P #endif // GTEST_HAS_TYPED_TEST_P
...@@ -46,7 +46,7 @@ template <typename T> ...@@ -46,7 +46,7 @@ template <typename T>
class ContainerTest : public Test { class ContainerTest : public Test {
}; };
TYPED_TEST_CASE_P(ContainerTest); TYPED_TEST_SUITE_P(ContainerTest);
TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) { TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) {
TypeParam container; TypeParam container;
...@@ -57,8 +57,8 @@ TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { ...@@ -57,8 +57,8 @@ TYPED_TEST_P(ContainerTest, InitialSizeIsZero) {
EXPECT_EQ(0U, container.size()); EXPECT_EQ(0U, container.size());
} }
REGISTER_TYPED_TEST_CASE_P(ContainerTest, REGISTER_TYPED_TEST_SUITE_P(ContainerTest,
CanBeDefaultConstructed, InitialSizeIsZero); CanBeDefaultConstructed, InitialSizeIsZero);
#endif // GTEST_HAS_TYPED_TEST_P #endif // GTEST_HAS_TYPED_TEST_P
......
...@@ -120,9 +120,9 @@ TEST_P(MyParamTest, ShouldPass) { ...@@ -120,9 +120,9 @@ TEST_P(MyParamTest, ShouldPass) {
GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam()); GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
g_param_test_count++; g_param_test_count++;
} }
INSTANTIATE_TEST_CASE_P(MyParamSequence, INSTANTIATE_TEST_SUITE_P(MyParamSequence,
MyParamTest, MyParamTest,
testing::Range(0, kNumberOfParamTests)); testing::Range(0, kNumberOfParamTests));
// Resets the count for each test. // Resets the count for each test.
void ResetCounts() { void ResetCounts() {
......
...@@ -111,7 +111,7 @@ Invalid characters in brackets []%(stack)s]]></failure> ...@@ -111,7 +111,7 @@ Invalid characters in brackets []%(stack)s]]></failure>
<testsuite name="SkippedTest" tests="1" failures="0" disabled="0" errors="0" time="*"> <testsuite name="SkippedTest" tests="1" failures="0" disabled="0" errors="0" time="*">
<testcase name="Skipped" status="skipped" time="*" classname="SkippedTest"/> <testcase name="Skipped" status="skipped" time="*" classname="SkippedTest"/>
</testsuite> </testsuite>
<testsuite name="PropertyRecordingTest" tests="4" failures="0" disabled="0" errors="0" time="*" SetUpTestCase="yes" TearDownTestCase="aye"> <testsuite name="PropertyRecordingTest" tests="4" failures="0" disabled="0" errors="0" time="*" SetUpTestSuite="yes" TearDownTestSuite="aye">
<testcase name="OneProperty" status="run" time="*" classname="PropertyRecordingTest"> <testcase name="OneProperty" status="run" time="*" classname="PropertyRecordingTest">
<properties> <properties>
<property name="key_1" value="1"/> <property name="key_1" value="1"/>
...@@ -164,11 +164,11 @@ Invalid characters in brackets []%(stack)s]]></failure> ...@@ -164,11 +164,11 @@ Invalid characters in brackets []%(stack)s]]></failure>
<testsuite name="TypedTest/1" tests="1" failures="0" disabled="0" errors="0" time="*"> <testsuite name="TypedTest/1" tests="1" failures="0" disabled="0" errors="0" time="*">
<testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="TypedTest/1" /> <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="TypedTest/1" />
</testsuite> </testsuite>
<testsuite name="Single/TypeParameterizedTestCase/0" tests="1" failures="0" disabled="0" errors="0" time="*"> <testsuite name="Single/TypeParameterizedTestSuite/0" tests="1" failures="0" disabled="0" errors="0" time="*">
<testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestCase/0" /> <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestSuite/0" />
</testsuite> </testsuite>
<testsuite name="Single/TypeParameterizedTestCase/1" tests="1" failures="0" disabled="0" errors="0" time="*"> <testsuite name="Single/TypeParameterizedTestSuite/1" tests="1" failures="0" disabled="0" errors="0" time="*">
<testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestCase/1" /> <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestSuite/1" />
</testsuite> </testsuite>
</testsuites>""" % {'stack': STACK_TRACE_TEMPLATE} </testsuites>""" % {'stack': STACK_TRACE_TEMPLATE}
...@@ -186,7 +186,7 @@ EXPECTED_SHARDED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?> ...@@ -186,7 +186,7 @@ EXPECTED_SHARDED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*"> <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*">
<testcase name="Succeeds" status="run" time="*" classname="SuccessfulTest"/> <testcase name="Succeeds" status="run" time="*" classname="SuccessfulTest"/>
</testsuite> </testsuite>
<testsuite name="PropertyRecordingTest" tests="1" failures="0" disabled="0" errors="0" time="*" SetUpTestCase="yes" TearDownTestCase="aye"> <testsuite name="PropertyRecordingTest" tests="1" failures="0" disabled="0" errors="0" time="*" SetUpTestSuite="yes" TearDownTestSuite="aye">
<testcase name="TwoValuesForOneKeyUsesLastValue" status="run" time="*" classname="PropertyRecordingTest"> <testcase name="TwoValuesForOneKeyUsesLastValue" status="run" time="*" classname="PropertyRecordingTest">
<properties> <properties>
<property name="key_1" value="2"/> <property name="key_1" value="2"/>
......
...@@ -101,8 +101,10 @@ TEST(InvalidCharactersTest, InvalidCharactersInMessage) { ...@@ -101,8 +101,10 @@ TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
class PropertyRecordingTest : public Test { class PropertyRecordingTest : public Test {
public: public:
static void SetUpTestCase() { RecordProperty("SetUpTestCase", "yes"); } static void SetUpTestSuite() { RecordProperty("SetUpTestSuite", "yes"); }
static void TearDownTestCase() { RecordProperty("TearDownTestCase", "aye"); } static void TearDownTestSuite() {
RecordProperty("TearDownTestSuite", "aye");
}
}; };
TEST_F(PropertyRecordingTest, OneProperty) { TEST_F(PropertyRecordingTest, OneProperty) {
...@@ -150,28 +152,28 @@ TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) { ...@@ -150,28 +152,28 @@ TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
class ValueParamTest : public TestWithParam<int> {}; class ValueParamTest : public TestWithParam<int> {};
TEST_P(ValueParamTest, HasValueParamAttribute) {} TEST_P(ValueParamTest, HasValueParamAttribute) {}
TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute) {} TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute) {}
INSTANTIATE_TEST_CASE_P(Single, ValueParamTest, Values(33, 42)); INSTANTIATE_TEST_SUITE_P(Single, ValueParamTest, Values(33, 42));
#if GTEST_HAS_TYPED_TEST #if GTEST_HAS_TYPED_TEST
// Verifies that the type parameter name is output in the 'type_param' // Verifies that the type parameter name is output in the 'type_param'
// XML attribute for typed tests. // XML attribute for typed tests.
template <typename T> class TypedTest : public Test {}; template <typename T> class TypedTest : public Test {};
typedef testing::Types<int, long> TypedTestTypes; typedef testing::Types<int, long> TypedTestTypes;
TYPED_TEST_CASE(TypedTest, TypedTestTypes); TYPED_TEST_SUITE(TypedTest, TypedTestTypes);
TYPED_TEST(TypedTest, HasTypeParamAttribute) {} TYPED_TEST(TypedTest, HasTypeParamAttribute) {}
#endif #endif
#if GTEST_HAS_TYPED_TEST_P #if GTEST_HAS_TYPED_TEST_P
// Verifies that the type parameter name is output in the 'type_param' // Verifies that the type parameter name is output in the 'type_param'
// XML attribute for type-parameterized tests. // XML attribute for type-parameterized tests.
template <typename T> class TypeParameterizedTestCase : public Test {}; template <typename T>
TYPED_TEST_CASE_P(TypeParameterizedTestCase); class TypeParameterizedTestSuite : public Test {};
TYPED_TEST_P(TypeParameterizedTestCase, HasTypeParamAttribute) {} TYPED_TEST_SUITE_P(TypeParameterizedTestSuite);
REGISTER_TYPED_TEST_CASE_P(TypeParameterizedTestCase, HasTypeParamAttribute); TYPED_TEST_P(TypeParameterizedTestSuite, HasTypeParamAttribute) {}
typedef testing::Types<int, long> TypeParameterizedTestCaseTypes; REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, HasTypeParamAttribute);
INSTANTIATE_TYPED_TEST_CASE_P(Single, typedef testing::Types<int, long> TypeParameterizedTestSuiteTypes; // NOLINT
TypeParameterizedTestCase, INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite,
TypeParameterizedTestCaseTypes); TypeParameterizedTestSuiteTypes);
#endif #endif
int main(int argc, char** argv) { int main(int argc, char** argv) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment