Non-empty failure message that can be retrieved with the object’s message() When the assertion wasn’t successful, the AssertionResult object stores a AssertionResultĪ class for indicating whether an assertion was successful. GoogleTest defines the following classes and types to help with writing tests. GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST suppresses this failure for the Test in the test suite GoogleTestVerification. INSTANTIATE_TEST_SUITE_P call causes a failing GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST( TestSuiteName )Īllows the value-parameterized test suite TestSuiteName to beīy default, every TEST_P call without a corresponding GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST Similar to assertions, GTEST_SKIP allows streaming a custom message into it. Used in a test fixture SetUp() method, it skips all tests in the corresponding Test environment SetUp() method, it skips all tests in the test program. Prevents further test execution at runtime.Ĭan be used in individual test cases or in the SetUp() methods of testĮnvironments or test fixtures (classes derived from theĮnvironment or Test classes). TEST_P ( MyTestSuite, DoesSomething ) // namespace my_namespaceĬauses the current file name, line number, and the given message message toīe added to the failure message for each assertion failure that occurs in the Within the testīody, the test parameter can be accessed with the GetParam() function (see The statements within the test body can be any code under test. The name of a value-parameterized test fixture class-see TestFixtureName must beĭefines an individual value-parameterized test named TestName that uses the Identifiers and must not contain underscores ( _). The test suite name is TestFixtureName.īoth arguments TestFixtureName and TestName must be valid C++ The statements within the test body can be any code under test.Īssertions used within the test body determine the outcome ofĭefines an individual test named TestName that uses the test fixture class TestSuiteName, consisting of the given statements.īoth arguments TestSuiteName and TestName must be valid C++ identifiersĪnd must not contain underscores ( _). TESTĭefines an individual test named TestName in the test suite GoogleTest defines the following macros for writing tests. To use them, include the header gtest/gtest.h. This page lists the facilities provided by GoogleTest for writing test programs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |