1# Testing Reference 2 3<!--* toc_depth: 3 *--> 4 5This page lists the facilities provided by GoogleTest for writing test programs. 6To use them, add `#include <gtest/gtest.h>`. 7 8## Macros 9 10GoogleTest defines the following macros for writing tests. 11 12### TEST {#TEST} 13 14<pre> 15TEST(<em>TestSuiteName</em>, <em>TestName</em>) { 16 ... <em>statements</em> ... 17} 18</pre> 19 20Defines an individual test named *`TestName`* in the test suite 21*`TestSuiteName`*, consisting of the given statements. 22 23Both arguments *`TestSuiteName`* and *`TestName`* must be valid C++ identifiers 24and must not contain underscores (`_`). Tests in different test suites can have 25the same individual name. 26 27The statements within the test body can be any code under test. 28[Assertions](assertions.md) used within the test body determine the outcome of 29the test. 30 31### TEST_F {#TEST_F} 32 33<pre> 34TEST_F(<em>TestFixtureName</em>, <em>TestName</em>) { 35 ... <em>statements</em> ... 36} 37</pre> 38 39Defines an individual test named *`TestName`* that uses the test fixture class 40*`TestFixtureName`*. The test suite name is *`TestFixtureName`*. 41 42Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++ 43identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be 44the name of a test fixture class—see 45[Test Fixtures](../primer.md#same-data-multiple-tests). 46 47The statements within the test body can be any code under test. 48[Assertions](assertions.md) used within the test body determine the outcome of 49the test. 50 51### TEST_P {#TEST_P} 52 53<pre> 54TEST_P(<em>TestFixtureName</em>, <em>TestName</em>) { 55 ... <em>statements</em> ... 56} 57</pre> 58 59Defines an individual value-parameterized test named *`TestName`* that uses the 60test fixture class *`TestFixtureName`*. The test suite name is 61*`TestFixtureName`*. 62 63Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++ 64identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be 65the name of a value-parameterized test fixture class—see 66[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). 67 68The statements within the test body can be any code under test. Within the test 69body, the test parameter can be accessed with the `GetParam()` function (see 70[`WithParamInterface`](#WithParamInterface)). For example: 71 72```cpp 73TEST_P(MyTestSuite, DoesSomething) { 74 ... 75 EXPECT_TRUE(DoSomething(GetParam())); 76 ... 77} 78``` 79 80[Assertions](assertions.md) used within the test body determine the outcome of 81the test. 82 83See also [`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P). 84 85### INSTANTIATE_TEST_SUITE_P {#INSTANTIATE_TEST_SUITE_P} 86 87`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`)` 88\ 89`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`,`*`name_generator`*`)` 90 91Instantiates the value-parameterized test suite *`TestSuiteName`* (defined with 92[`TEST_P`](#TEST_P)). 93 94The argument *`InstantiationName`* is a unique name for the instantiation of the 95test suite, to distinguish between multiple instantiations. In test output, the 96instantiation name is added as a prefix to the test suite name 97*`TestSuiteName`*. If *`InstantiationName`* is empty 98(`INSTANTIATE_TEST_SUITE_P(, ...)`), no prefix is added. 99 100The argument *`param_generator`* is one of the following GoogleTest-provided 101functions that generate the test parameters, all defined in the `::testing` 102namespace: 103 104<span id="param-generators"></span> 105 106| Parameter Generator | Behavior | 107| ------------------- | ---------------------------------------------------- | 108| `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. | 109| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. | 110| `ValuesIn(container)` or `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. | 111| `Bool()` | Yields sequence `{false, true}`. | 112| `Combine(g1, g2, ..., gN)` | Yields as `std::tuple` *n*-tuples all combinations (Cartesian product) of the values generated by the given *n* generators `g1`, `g2`, ..., `gN`. | 113| `ConvertGenerator<T>(g)` | Yields values generated by generator `g`, `static_cast` to `T`. | 114 115The optional last argument *`name_generator`* is a function or functor that 116generates custom test name suffixes based on the test parameters. The function 117must accept an argument of type 118[`TestParamInfo<class ParamType>`](#TestParamInfo) and return a `std::string`. 119The test name suffix can only contain alphanumeric characters and underscores. 120GoogleTest provides [`PrintToStringParamName`](#PrintToStringParamName), or a 121custom function can be used for more control: 122 123```cpp 124INSTANTIATE_TEST_SUITE_P( 125 MyInstantiation, MyTestSuite, 126 testing::Values(...), 127 [](const testing::TestParamInfo<MyTestSuite::ParamType>& info) { 128 // Can use info.param here to generate the test suffix 129 std::string name = ... 130 return name; 131 }); 132``` 133 134For more information, see 135[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). 136 137See also 138[`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST`](#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST). 139 140### TYPED_TEST_SUITE {#TYPED_TEST_SUITE} 141 142`TYPED_TEST_SUITE(`*`TestFixtureName`*`,`*`Types`*`)` 143 144Defines a typed test suite based on the test fixture *`TestFixtureName`*. The 145test suite name is *`TestFixtureName`*. 146 147The argument *`TestFixtureName`* is a fixture class template, parameterized by a 148type, for example: 149 150```cpp 151template <typename T> 152class MyFixture : public testing::Test { 153 public: 154 ... 155 using List = std::list<T>; 156 static T shared_; 157 T value_; 158}; 159``` 160 161The argument *`Types`* is a [`Types`](#Types) object representing the list of 162types to run the tests on, for example: 163 164```cpp 165using MyTypes = ::testing::Types<char, int, unsigned int>; 166TYPED_TEST_SUITE(MyFixture, MyTypes); 167``` 168 169The type alias (`using` or `typedef`) is necessary for the `TYPED_TEST_SUITE` 170macro to parse correctly. 171 172See also [`TYPED_TEST`](#TYPED_TEST) and 173[Typed Tests](../advanced.md#typed-tests) for more information. 174 175### TYPED_TEST {#TYPED_TEST} 176 177<pre> 178TYPED_TEST(<em>TestSuiteName</em>, <em>TestName</em>) { 179 ... <em>statements</em> ... 180} 181</pre> 182 183Defines an individual typed test named *`TestName`* in the typed test suite 184*`TestSuiteName`*. The test suite must be defined with 185[`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE). 186 187Within the test body, the special name `TypeParam` refers to the type parameter, 188and `TestFixture` refers to the fixture class. See the following example: 189 190```cpp 191TYPED_TEST(MyFixture, Example) { 192 // Inside a test, refer to the special name TypeParam to get the type 193 // parameter. Since we are inside a derived class template, C++ requires 194 // us to visit the members of MyFixture via 'this'. 195 TypeParam n = this->value_; 196 197 // To visit static members of the fixture, add the 'TestFixture::' 198 // prefix. 199 n += TestFixture::shared_; 200 201 // To refer to typedefs in the fixture, add the 'typename TestFixture::' 202 // prefix. The 'typename' is required to satisfy the compiler. 203 typename TestFixture::List values; 204 205 values.push_back(n); 206 ... 207} 208``` 209 210For more information, see [Typed Tests](../advanced.md#typed-tests). 211 212### TYPED_TEST_SUITE_P {#TYPED_TEST_SUITE_P} 213 214`TYPED_TEST_SUITE_P(`*`TestFixtureName`*`)` 215 216Defines a type-parameterized test suite based on the test fixture 217*`TestFixtureName`*. The test suite name is *`TestFixtureName`*. 218 219The argument *`TestFixtureName`* is a fixture class template, parameterized by a 220type. See [`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE) for an example. 221 222See also [`TYPED_TEST_P`](#TYPED_TEST_P) and 223[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more 224information. 225 226### TYPED_TEST_P {#TYPED_TEST_P} 227 228<pre> 229TYPED_TEST_P(<em>TestSuiteName</em>, <em>TestName</em>) { 230 ... <em>statements</em> ... 231} 232</pre> 233 234Defines an individual type-parameterized test named *`TestName`* in the 235type-parameterized test suite *`TestSuiteName`*. The test suite must be defined 236with [`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P). 237 238Within the test body, the special name `TypeParam` refers to the type parameter, 239and `TestFixture` refers to the fixture class. See [`TYPED_TEST`](#TYPED_TEST) 240for an example. 241 242See also [`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P) and 243[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more 244information. 245 246### REGISTER_TYPED_TEST_SUITE_P {#REGISTER_TYPED_TEST_SUITE_P} 247 248`REGISTER_TYPED_TEST_SUITE_P(`*`TestSuiteName`*`,`*`TestNames...`*`)` 249 250Registers the type-parameterized tests *`TestNames...`* of the test suite 251*`TestSuiteName`*. The test suite and tests must be defined with 252[`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P) and [`TYPED_TEST_P`](#TYPED_TEST_P). 253 254For example: 255 256```cpp 257// Define the test suite and tests. 258TYPED_TEST_SUITE_P(MyFixture); 259TYPED_TEST_P(MyFixture, HasPropertyA) { ... } 260TYPED_TEST_P(MyFixture, HasPropertyB) { ... } 261 262// Register the tests in the test suite. 263REGISTER_TYPED_TEST_SUITE_P(MyFixture, HasPropertyA, HasPropertyB); 264``` 265 266See also [`INSTANTIATE_TYPED_TEST_SUITE_P`](#INSTANTIATE_TYPED_TEST_SUITE_P) and 267[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more 268information. 269 270### INSTANTIATE_TYPED_TEST_SUITE_P {#INSTANTIATE_TYPED_TEST_SUITE_P} 271 272`INSTANTIATE_TYPED_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`Types`*`)` 273 274Instantiates the type-parameterized test suite *`TestSuiteName`*. The test suite 275must be registered with 276[`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P). 277 278The argument *`InstantiationName`* is a unique name for the instantiation of the 279test suite, to distinguish between multiple instantiations. In test output, the 280instantiation name is added as a prefix to the test suite name 281*`TestSuiteName`*. If *`InstantiationName`* is empty 282(`INSTANTIATE_TYPED_TEST_SUITE_P(, ...)`), no prefix is added. 283 284The argument *`Types`* is a [`Types`](#Types) object representing the list of 285types to run the tests on, for example: 286 287```cpp 288using MyTypes = ::testing::Types<char, int, unsigned int>; 289INSTANTIATE_TYPED_TEST_SUITE_P(MyInstantiation, MyFixture, MyTypes); 290``` 291 292The type alias (`using` or `typedef`) is necessary for the 293`INSTANTIATE_TYPED_TEST_SUITE_P` macro to parse correctly. 294 295For more information, see 296[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). 297 298### FRIEND_TEST {#FRIEND_TEST} 299 300`FRIEND_TEST(`*`TestSuiteName`*`,`*`TestName`*`)` 301 302Within a class body, declares an individual test as a friend of the class, 303enabling the test to access private class members. 304 305If the class is defined in a namespace, then in order to be friends of the 306class, test fixtures and tests must be defined in the exact same namespace, 307without inline or anonymous namespaces. 308 309For example, if the class definition looks like the following: 310 311```cpp 312namespace my_namespace { 313 314class MyClass { 315 friend class MyClassTest; 316 FRIEND_TEST(MyClassTest, HasPropertyA); 317 FRIEND_TEST(MyClassTest, HasPropertyB); 318 ... definition of class MyClass ... 319}; 320 321} // namespace my_namespace 322``` 323 324Then the test code should look like: 325 326```cpp 327namespace my_namespace { 328 329class MyClassTest : public testing::Test { 330 ... 331}; 332 333TEST_F(MyClassTest, HasPropertyA) { ... } 334TEST_F(MyClassTest, HasPropertyB) { ... } 335 336} // namespace my_namespace 337``` 338 339See [Testing Private Code](../advanced.md#testing-private-code) for more 340information. 341 342### SCOPED_TRACE {#SCOPED_TRACE} 343 344`SCOPED_TRACE(`*`message`*`)` 345 346Causes the current file name, line number, and the given message *`message`* to 347be added to the failure message for each assertion failure that occurs in the 348scope. 349 350For more information, see 351[Adding Traces to Assertions](../advanced.md#adding-traces-to-assertions). 352 353See also the [`ScopedTrace` class](#ScopedTrace). 354 355### GTEST_SKIP {#GTEST_SKIP} 356 357`GTEST_SKIP()` 358 359Prevents further test execution at runtime. 360 361Can be used in individual test cases or in the `SetUp()` methods of test 362environments or test fixtures (classes derived from the 363[`Environment`](#Environment) or [`Test`](#Test) classes). If used in a global 364test environment `SetUp()` method, it skips all tests in the test program. If 365used in a test fixture `SetUp()` method, it skips all tests in the corresponding 366test suite. 367 368Similar to assertions, `GTEST_SKIP` allows streaming a custom message into it. 369 370See [Skipping Test Execution](../advanced.md#skipping-test-execution) for more 371information. 372 373### GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST {#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST} 374 375`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(`*`TestSuiteName`*`)` 376 377Allows the value-parameterized test suite *`TestSuiteName`* to be 378uninstantiated. 379 380By default, every [`TEST_P`](#TEST_P) call without a corresponding 381[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P) call causes a failing 382test in the test suite `GoogleTestVerification`. 383`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST` suppresses this failure for the 384given test suite. 385 386## Classes and types 387 388GoogleTest defines the following classes and types to help with writing tests. 389 390### AssertionResult {#AssertionResult} 391 392`testing::AssertionResult` 393 394A class for indicating whether an assertion was successful. 395 396When the assertion wasn't successful, the `AssertionResult` object stores a 397non-empty failure message that can be retrieved with the object's `message()` 398method. 399 400To create an instance of this class, use one of the factory functions 401[`AssertionSuccess()`](#AssertionSuccess) or 402[`AssertionFailure()`](#AssertionFailure). 403 404### AssertionException {#AssertionException} 405 406`testing::AssertionException` 407 408Exception which can be thrown from 409[`TestEventListener::OnTestPartResult`](#TestEventListener::OnTestPartResult). 410 411### EmptyTestEventListener {#EmptyTestEventListener} 412 413`testing::EmptyTestEventListener` 414 415Provides an empty implementation of all methods in the 416[`TestEventListener`](#TestEventListener) interface, such that a subclass only 417needs to override the methods it cares about. 418 419### Environment {#Environment} 420 421`testing::Environment` 422 423Represents a global test environment. See 424[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down). 425 426#### Protected Methods {#Environment-protected} 427 428##### SetUp {#Environment::SetUp} 429 430`virtual void Environment::SetUp()` 431 432Override this to define how to set up the environment. 433 434##### TearDown {#Environment::TearDown} 435 436`virtual void Environment::TearDown()` 437 438Override this to define how to tear down the environment. 439 440### ScopedTrace {#ScopedTrace} 441 442`testing::ScopedTrace` 443 444An instance of this class causes a trace to be included in every test failure 445message generated by code in the scope of the lifetime of the `ScopedTrace` 446instance. The effect is undone with the destruction of the instance. 447 448The `ScopedTrace` constructor has the following form: 449 450```cpp 451template <typename T> 452ScopedTrace(const char* file, int line, const T& message) 453``` 454 455Example usage: 456 457```cpp 458testing::ScopedTrace trace("file.cc", 123, "message"); 459``` 460 461The resulting trace includes the given source file path and line number, and the 462given message. The `message` argument can be anything streamable to 463`std::ostream`. 464 465See also [`SCOPED_TRACE`](#SCOPED_TRACE). 466 467### Test {#Test} 468 469`testing::Test` 470 471The abstract class that all tests inherit from. `Test` is not copyable. 472 473#### Public Methods {#Test-public} 474 475##### SetUpTestSuite {#Test::SetUpTestSuite} 476 477`static void Test::SetUpTestSuite()` 478 479Performs shared setup for all tests in the test suite. GoogleTest calls 480`SetUpTestSuite()` before running the first test in the test suite. 481 482##### TearDownTestSuite {#Test::TearDownTestSuite} 483 484`static void Test::TearDownTestSuite()` 485 486Performs shared teardown for all tests in the test suite. GoogleTest calls 487`TearDownTestSuite()` after running the last test in the test suite. 488 489##### HasFatalFailure {#Test::HasFatalFailure} 490 491`static bool Test::HasFatalFailure()` 492 493Returns true if and only if the current test has a fatal failure. 494 495##### HasNonfatalFailure {#Test::HasNonfatalFailure} 496 497`static bool Test::HasNonfatalFailure()` 498 499Returns true if and only if the current test has a nonfatal failure. 500 501##### HasFailure {#Test::HasFailure} 502 503`static bool Test::HasFailure()` 504 505Returns true if and only if the current test has any failure, either fatal or 506nonfatal. 507 508##### IsSkipped {#Test::IsSkipped} 509 510`static bool Test::IsSkipped()` 511 512Returns true if and only if the current test was skipped. 513 514##### RecordProperty {#Test::RecordProperty} 515 516`static void Test::RecordProperty(const std::string& key, const std::string& 517value)` \ 518`static void Test::RecordProperty(const std::string& key, int value)` 519 520Logs a property for the current test, test suite, or entire invocation of the 521test program. Only the last value for a given key is logged. 522 523The key must be a valid XML attribute name, and cannot conflict with the ones 524already used by GoogleTest (`name`, `file`, `line`, `status`, `time`, 525`classname`, `type_param`, and `value_param`). 526 527`RecordProperty` is `public static` so it can be called from utility functions 528that are not members of the test fixture. 529 530Calls to `RecordProperty` made during the lifespan of the test (from the moment 531its constructor starts to the moment its destructor finishes) are output in XML 532as attributes of the `<testcase>` element. Properties recorded from a fixture's 533`SetUpTestSuite` or `TearDownTestSuite` methods are logged as attributes of the 534corresponding `<testsuite>` element. Calls to `RecordProperty` made in the 535global context (before or after invocation of `RUN_ALL_TESTS` or from the 536`SetUp`/`TearDown` methods of registered `Environment` objects) are output as 537attributes of the `<testsuites>` element. 538 539#### Protected Methods {#Test-protected} 540 541##### SetUp {#Test::SetUp} 542 543`virtual void Test::SetUp()` 544 545Override this to perform test fixture setup. GoogleTest calls `SetUp()` before 546running each individual test. 547 548##### TearDown {#Test::TearDown} 549 550`virtual void Test::TearDown()` 551 552Override this to perform test fixture teardown. GoogleTest calls `TearDown()` 553after running each individual test. 554 555### TestWithParam {#TestWithParam} 556 557`testing::TestWithParam<T>` 558 559A convenience class which inherits from both [`Test`](#Test) and 560[`WithParamInterface<T>`](#WithParamInterface). 561 562### TestSuite {#TestSuite} 563 564Represents a test suite. `TestSuite` is not copyable. 565 566#### Public Methods {#TestSuite-public} 567 568##### name {#TestSuite::name} 569 570`const char* TestSuite::name() const` 571 572Gets the name of the test suite. 573 574##### type_param {#TestSuite::type_param} 575 576`const char* TestSuite::type_param() const` 577 578Returns the name of the parameter type, or `NULL` if this is not a typed or 579type-parameterized test suite. See [Typed Tests](../advanced.md#typed-tests) and 580[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). 581 582##### should_run {#TestSuite::should_run} 583 584`bool TestSuite::should_run() const` 585 586Returns true if any test in this test suite should run. 587 588##### successful_test_count {#TestSuite::successful_test_count} 589 590`int TestSuite::successful_test_count() const` 591 592Gets the number of successful tests in this test suite. 593 594##### skipped_test_count {#TestSuite::skipped_test_count} 595 596`int TestSuite::skipped_test_count() const` 597 598Gets the number of skipped tests in this test suite. 599 600##### failed_test_count {#TestSuite::failed_test_count} 601 602`int TestSuite::failed_test_count() const` 603 604Gets the number of failed tests in this test suite. 605 606##### reportable_disabled_test_count {#TestSuite::reportable_disabled_test_count} 607 608`int TestSuite::reportable_disabled_test_count() const` 609 610Gets the number of disabled tests that will be reported in the XML report. 611 612##### disabled_test_count {#TestSuite::disabled_test_count} 613 614`int TestSuite::disabled_test_count() const` 615 616Gets the number of disabled tests in this test suite. 617 618##### reportable_test_count {#TestSuite::reportable_test_count} 619 620`int TestSuite::reportable_test_count() const` 621 622Gets the number of tests to be printed in the XML report. 623 624##### test_to_run_count {#TestSuite::test_to_run_count} 625 626`int TestSuite::test_to_run_count() const` 627 628Get the number of tests in this test suite that should run. 629 630##### total_test_count {#TestSuite::total_test_count} 631 632`int TestSuite::total_test_count() const` 633 634Gets the number of all tests in this test suite. 635 636##### Passed {#TestSuite::Passed} 637 638`bool TestSuite::Passed() const` 639 640Returns true if and only if the test suite passed. 641 642##### Failed {#TestSuite::Failed} 643 644`bool TestSuite::Failed() const` 645 646Returns true if and only if the test suite failed. 647 648##### elapsed_time {#TestSuite::elapsed_time} 649 650`TimeInMillis TestSuite::elapsed_time() const` 651 652Returns the elapsed time, in milliseconds. 653 654##### start_timestamp {#TestSuite::start_timestamp} 655 656`TimeInMillis TestSuite::start_timestamp() const` 657 658Gets the time of the test suite start, in ms from the start of the UNIX epoch. 659 660##### GetTestInfo {#TestSuite::GetTestInfo} 661 662`const TestInfo* TestSuite::GetTestInfo(int i) const` 663 664Returns the [`TestInfo`](#TestInfo) for the `i`-th test among all the tests. `i` 665can range from 0 to `total_test_count() - 1`. If `i` is not in that range, 666returns `NULL`. 667 668##### ad_hoc_test_result {#TestSuite::ad_hoc_test_result} 669 670`const TestResult& TestSuite::ad_hoc_test_result() const` 671 672Returns the [`TestResult`](#TestResult) that holds test properties recorded 673during execution of `SetUpTestSuite` and `TearDownTestSuite`. 674 675### TestInfo {#TestInfo} 676 677`testing::TestInfo` 678 679Stores information about a test. 680 681#### Public Methods {#TestInfo-public} 682 683##### test_suite_name {#TestInfo::test_suite_name} 684 685`const char* TestInfo::test_suite_name() const` 686 687Returns the test suite name. 688 689##### name {#TestInfo::name} 690 691`const char* TestInfo::name() const` 692 693Returns the test name. 694 695##### type_param {#TestInfo::type_param} 696 697`const char* TestInfo::type_param() const` 698 699Returns the name of the parameter type, or `NULL` if this is not a typed or 700type-parameterized test. See [Typed Tests](../advanced.md#typed-tests) and 701[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). 702 703##### value_param {#TestInfo::value_param} 704 705`const char* TestInfo::value_param() const` 706 707Returns the text representation of the value parameter, or `NULL` if this is not 708a value-parameterized test. See 709[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). 710 711##### file {#TestInfo::file} 712 713`const char* TestInfo::file() const` 714 715Returns the file name where this test is defined. 716 717##### line {#TestInfo::line} 718 719`int TestInfo::line() const` 720 721Returns the line where this test is defined. 722 723##### is_in_another_shard {#TestInfo::is_in_another_shard} 724 725`bool TestInfo::is_in_another_shard() const` 726 727Returns true if this test should not be run because it's in another shard. 728 729##### should_run {#TestInfo::should_run} 730 731`bool TestInfo::should_run() const` 732 733Returns true if this test should run, that is if the test is not disabled (or it 734is disabled but the `also_run_disabled_tests` flag has been specified) and its 735full name matches the user-specified filter. 736 737GoogleTest allows the user to filter the tests by their full names. Only the 738tests that match the filter will run. See 739[Running a Subset of the Tests](../advanced.md#running-a-subset-of-the-tests) 740for more information. 741 742##### is_reportable {#TestInfo::is_reportable} 743 744`bool TestInfo::is_reportable() const` 745 746Returns true if and only if this test will appear in the XML report. 747 748##### result {#TestInfo::result} 749 750`const TestResult* TestInfo::result() const` 751 752Returns the result of the test. See [`TestResult`](#TestResult). 753 754### TestParamInfo {#TestParamInfo} 755 756`testing::TestParamInfo<T>` 757 758Describes a parameter to a value-parameterized test. The type `T` is the type of 759the parameter. 760 761Contains the fields `param` and `index` which hold the value of the parameter 762and its integer index respectively. 763 764### UnitTest {#UnitTest} 765 766`testing::UnitTest` 767 768This class contains information about the test program. 769 770`UnitTest` is a singleton class. The only instance is created when 771`UnitTest::GetInstance()` is first called. This instance is never deleted. 772 773`UnitTest` is not copyable. 774 775#### Public Methods {#UnitTest-public} 776 777##### GetInstance {#UnitTest::GetInstance} 778 779`static UnitTest* UnitTest::GetInstance()` 780 781Gets the singleton `UnitTest` object. The first time this method is called, a 782`UnitTest` object is constructed and returned. Consecutive calls will return the 783same object. 784 785##### original_working_dir {#UnitTest::original_working_dir} 786 787`const char* UnitTest::original_working_dir() const` 788 789Returns the working directory when the first [`TEST()`](#TEST) or 790[`TEST_F()`](#TEST_F) was executed. The `UnitTest` object owns the string. 791 792##### current_test_suite {#UnitTest::current_test_suite} 793 794`const TestSuite* UnitTest::current_test_suite() const` 795 796Returns the [`TestSuite`](#TestSuite) object for the test that's currently 797running, or `NULL` if no test is running. 798 799##### current_test_info {#UnitTest::current_test_info} 800 801`const TestInfo* UnitTest::current_test_info() const` 802 803Returns the [`TestInfo`](#TestInfo) object for the test that's currently 804running, or `NULL` if no test is running. 805 806##### random_seed {#UnitTest::random_seed} 807 808`int UnitTest::random_seed() const` 809 810Returns the random seed used at the start of the current test run. 811 812##### successful_test_suite_count {#UnitTest::successful_test_suite_count} 813 814`int UnitTest::successful_test_suite_count() const` 815 816Gets the number of successful test suites. 817 818##### failed_test_suite_count {#UnitTest::failed_test_suite_count} 819 820`int UnitTest::failed_test_suite_count() const` 821 822Gets the number of failed test suites. 823 824##### total_test_suite_count {#UnitTest::total_test_suite_count} 825 826`int UnitTest::total_test_suite_count() const` 827 828Gets the number of all test suites. 829 830##### test_suite_to_run_count {#UnitTest::test_suite_to_run_count} 831 832`int UnitTest::test_suite_to_run_count() const` 833 834Gets the number of all test suites that contain at least one test that should 835run. 836 837##### successful_test_count {#UnitTest::successful_test_count} 838 839`int UnitTest::successful_test_count() const` 840 841Gets the number of successful tests. 842 843##### skipped_test_count {#UnitTest::skipped_test_count} 844 845`int UnitTest::skipped_test_count() const` 846 847Gets the number of skipped tests. 848 849##### failed_test_count {#UnitTest::failed_test_count} 850 851`int UnitTest::failed_test_count() const` 852 853Gets the number of failed tests. 854 855##### reportable_disabled_test_count {#UnitTest::reportable_disabled_test_count} 856 857`int UnitTest::reportable_disabled_test_count() const` 858 859Gets the number of disabled tests that will be reported in the XML report. 860 861##### disabled_test_count {#UnitTest::disabled_test_count} 862 863`int UnitTest::disabled_test_count() const` 864 865Gets the number of disabled tests. 866 867##### reportable_test_count {#UnitTest::reportable_test_count} 868 869`int UnitTest::reportable_test_count() const` 870 871Gets the number of tests to be printed in the XML report. 872 873##### total_test_count {#UnitTest::total_test_count} 874 875`int UnitTest::total_test_count() const` 876 877Gets the number of all tests. 878 879##### test_to_run_count {#UnitTest::test_to_run_count} 880 881`int UnitTest::test_to_run_count() const` 882 883Gets the number of tests that should run. 884 885##### start_timestamp {#UnitTest::start_timestamp} 886 887`TimeInMillis UnitTest::start_timestamp() const` 888 889Gets the time of the test program start, in ms from the start of the UNIX epoch. 890 891##### elapsed_time {#UnitTest::elapsed_time} 892 893`TimeInMillis UnitTest::elapsed_time() const` 894 895Gets the elapsed time, in milliseconds. 896 897##### Passed {#UnitTest::Passed} 898 899`bool UnitTest::Passed() const` 900 901Returns true if and only if the unit test passed (i.e. all test suites passed). 902 903##### Failed {#UnitTest::Failed} 904 905`bool UnitTest::Failed() const` 906 907Returns true if and only if the unit test failed (i.e. some test suite failed or 908something outside of all tests failed). 909 910##### GetTestSuite {#UnitTest::GetTestSuite} 911 912`const TestSuite* UnitTest::GetTestSuite(int i) const` 913 914Gets the [`TestSuite`](#TestSuite) object for the `i`-th test suite among all 915the test suites. `i` can range from 0 to `total_test_suite_count() - 1`. If `i` 916is not in that range, returns `NULL`. 917 918##### ad_hoc_test_result {#UnitTest::ad_hoc_test_result} 919 920`const TestResult& UnitTest::ad_hoc_test_result() const` 921 922Returns the [`TestResult`](#TestResult) containing information on test failures 923and properties logged outside of individual test suites. 924 925##### listeners {#UnitTest::listeners} 926 927`TestEventListeners& UnitTest::listeners()` 928 929Returns the list of event listeners that can be used to track events inside 930GoogleTest. See [`TestEventListeners`](#TestEventListeners). 931 932### TestEventListener {#TestEventListener} 933 934`testing::TestEventListener` 935 936The interface for tracing execution of tests. The methods below are listed in 937the order the corresponding events are fired. 938 939#### Public Methods {#TestEventListener-public} 940 941##### OnTestProgramStart {#TestEventListener::OnTestProgramStart} 942 943`virtual void TestEventListener::OnTestProgramStart(const UnitTest& unit_test)` 944 945Fired before any test activity starts. 946 947##### OnTestIterationStart {#TestEventListener::OnTestIterationStart} 948 949`virtual void TestEventListener::OnTestIterationStart(const UnitTest& unit_test, 950int iteration)` 951 952Fired before each iteration of tests starts. There may be more than one 953iteration if `GTEST_FLAG(repeat)` is set. `iteration` is the iteration index, 954starting from 0. 955 956##### OnEnvironmentsSetUpStart {#TestEventListener::OnEnvironmentsSetUpStart} 957 958`virtual void TestEventListener::OnEnvironmentsSetUpStart(const UnitTest& 959unit_test)` 960 961Fired before environment set-up for each iteration of tests starts. 962 963##### OnEnvironmentsSetUpEnd {#TestEventListener::OnEnvironmentsSetUpEnd} 964 965`virtual void TestEventListener::OnEnvironmentsSetUpEnd(const UnitTest& 966unit_test)` 967 968Fired after environment set-up for each iteration of tests ends. 969 970##### OnTestSuiteStart {#TestEventListener::OnTestSuiteStart} 971 972`virtual void TestEventListener::OnTestSuiteStart(const TestSuite& test_suite)` 973 974Fired before the test suite starts. 975 976##### OnTestStart {#TestEventListener::OnTestStart} 977 978`virtual void TestEventListener::OnTestStart(const TestInfo& test_info)` 979 980Fired before the test starts. 981 982##### OnTestPartResult {#TestEventListener::OnTestPartResult} 983 984`virtual void TestEventListener::OnTestPartResult(const TestPartResult& 985test_part_result)` 986 987Fired after a failed assertion or a `SUCCEED()` invocation. If you want to throw 988an exception from this function to skip to the next test, it must be an 989[`AssertionException`](#AssertionException) or inherited from it. 990 991##### OnTestEnd {#TestEventListener::OnTestEnd} 992 993`virtual void TestEventListener::OnTestEnd(const TestInfo& test_info)` 994 995Fired after the test ends. 996 997##### OnTestSuiteEnd {#TestEventListener::OnTestSuiteEnd} 998 999`virtual void TestEventListener::OnTestSuiteEnd(const TestSuite& test_suite)` 1000 1001Fired after the test suite ends. 1002 1003##### OnEnvironmentsTearDownStart {#TestEventListener::OnEnvironmentsTearDownStart} 1004 1005`virtual void TestEventListener::OnEnvironmentsTearDownStart(const UnitTest& 1006unit_test)` 1007 1008Fired before environment tear-down for each iteration of tests starts. 1009 1010##### OnEnvironmentsTearDownEnd {#TestEventListener::OnEnvironmentsTearDownEnd} 1011 1012`virtual void TestEventListener::OnEnvironmentsTearDownEnd(const UnitTest& 1013unit_test)` 1014 1015Fired after environment tear-down for each iteration of tests ends. 1016 1017##### OnTestIterationEnd {#TestEventListener::OnTestIterationEnd} 1018 1019`virtual void TestEventListener::OnTestIterationEnd(const UnitTest& unit_test, 1020int iteration)` 1021 1022Fired after each iteration of tests finishes. 1023 1024##### OnTestProgramEnd {#TestEventListener::OnTestProgramEnd} 1025 1026`virtual void TestEventListener::OnTestProgramEnd(const UnitTest& unit_test)` 1027 1028Fired after all test activities have ended. 1029 1030### TestEventListeners {#TestEventListeners} 1031 1032`testing::TestEventListeners` 1033 1034Lets users add listeners to track events in GoogleTest. 1035 1036#### Public Methods {#TestEventListeners-public} 1037 1038##### Append {#TestEventListeners::Append} 1039 1040`void TestEventListeners::Append(TestEventListener* listener)` 1041 1042Appends an event listener to the end of the list. GoogleTest assumes ownership 1043of the listener (i.e. it will delete the listener when the test program 1044finishes). 1045 1046##### Release {#TestEventListeners::Release} 1047 1048`TestEventListener* TestEventListeners::Release(TestEventListener* listener)` 1049 1050Removes the given event listener from the list and returns it. It then becomes 1051the caller's responsibility to delete the listener. Returns `NULL` if the 1052listener is not found in the list. 1053 1054##### default_result_printer {#TestEventListeners::default_result_printer} 1055 1056`TestEventListener* TestEventListeners::default_result_printer() const` 1057 1058Returns the standard listener responsible for the default console output. Can be 1059removed from the listeners list to shut down default console output. Note that 1060removing this object from the listener list with 1061[`Release()`](#TestEventListeners::Release) transfers its ownership to the 1062caller and makes this function return `NULL` the next time. 1063 1064##### default_xml_generator {#TestEventListeners::default_xml_generator} 1065 1066`TestEventListener* TestEventListeners::default_xml_generator() const` 1067 1068Returns the standard listener responsible for the default XML output controlled 1069by the `--gtest_output=xml` flag. Can be removed from the listeners list by 1070users who want to shut down the default XML output controlled by this flag and 1071substitute it with custom one. Note that removing this object from the listener 1072list with [`Release()`](#TestEventListeners::Release) transfers its ownership to 1073the caller and makes this function return `NULL` the next time. 1074 1075### TestPartResult {#TestPartResult} 1076 1077`testing::TestPartResult` 1078 1079A copyable object representing the result of a test part (i.e. an assertion or 1080an explicit `FAIL()`, `ADD_FAILURE()`, or `SUCCESS()`). 1081 1082#### Public Methods {#TestPartResult-public} 1083 1084##### type {#TestPartResult::type} 1085 1086`Type TestPartResult::type() const` 1087 1088Gets the outcome of the test part. 1089 1090The return type `Type` is an enum defined as follows: 1091 1092```cpp 1093enum Type { 1094 kSuccess, // Succeeded. 1095 kNonFatalFailure, // Failed but the test can continue. 1096 kFatalFailure, // Failed and the test should be terminated. 1097 kSkip // Skipped. 1098}; 1099``` 1100 1101##### file_name {#TestPartResult::file_name} 1102 1103`const char* TestPartResult::file_name() const` 1104 1105Gets the name of the source file where the test part took place, or `NULL` if 1106it's unknown. 1107 1108##### line_number {#TestPartResult::line_number} 1109 1110`int TestPartResult::line_number() const` 1111 1112Gets the line in the source file where the test part took place, or `-1` if it's 1113unknown. 1114 1115##### summary {#TestPartResult::summary} 1116 1117`const char* TestPartResult::summary() const` 1118 1119Gets the summary of the failure message. 1120 1121##### message {#TestPartResult::message} 1122 1123`const char* TestPartResult::message() const` 1124 1125Gets the message associated with the test part. 1126 1127##### skipped {#TestPartResult::skipped} 1128 1129`bool TestPartResult::skipped() const` 1130 1131Returns true if and only if the test part was skipped. 1132 1133##### passed {#TestPartResult::passed} 1134 1135`bool TestPartResult::passed() const` 1136 1137Returns true if and only if the test part passed. 1138 1139##### nonfatally_failed {#TestPartResult::nonfatally_failed} 1140 1141`bool TestPartResult::nonfatally_failed() const` 1142 1143Returns true if and only if the test part non-fatally failed. 1144 1145##### fatally_failed {#TestPartResult::fatally_failed} 1146 1147`bool TestPartResult::fatally_failed() const` 1148 1149Returns true if and only if the test part fatally failed. 1150 1151##### failed {#TestPartResult::failed} 1152 1153`bool TestPartResult::failed() const` 1154 1155Returns true if and only if the test part failed. 1156 1157### TestProperty {#TestProperty} 1158 1159`testing::TestProperty` 1160 1161A copyable object representing a user-specified test property which can be 1162output as a key/value string pair. 1163 1164#### Public Methods {#TestProperty-public} 1165 1166##### key {#key} 1167 1168`const char* key() const` 1169 1170Gets the user-supplied key. 1171 1172##### value {#value} 1173 1174`const char* value() const` 1175 1176Gets the user-supplied value. 1177 1178##### SetValue {#SetValue} 1179 1180`void SetValue(const std::string& new_value)` 1181 1182Sets a new value, overriding the previous one. 1183 1184### TestResult {#TestResult} 1185 1186`testing::TestResult` 1187 1188Contains information about the result of a single test. 1189 1190`TestResult` is not copyable. 1191 1192#### Public Methods {#TestResult-public} 1193 1194##### total_part_count {#TestResult::total_part_count} 1195 1196`int TestResult::total_part_count() const` 1197 1198Gets the number of all test parts. This is the sum of the number of successful 1199test parts and the number of failed test parts. 1200 1201##### test_property_count {#TestResult::test_property_count} 1202 1203`int TestResult::test_property_count() const` 1204 1205Returns the number of test properties. 1206 1207##### Passed {#TestResult::Passed} 1208 1209`bool TestResult::Passed() const` 1210 1211Returns true if and only if the test passed (i.e. no test part failed). 1212 1213##### Skipped {#TestResult::Skipped} 1214 1215`bool TestResult::Skipped() const` 1216 1217Returns true if and only if the test was skipped. 1218 1219##### Failed {#TestResult::Failed} 1220 1221`bool TestResult::Failed() const` 1222 1223Returns true if and only if the test failed. 1224 1225##### HasFatalFailure {#TestResult::HasFatalFailure} 1226 1227`bool TestResult::HasFatalFailure() const` 1228 1229Returns true if and only if the test fatally failed. 1230 1231##### HasNonfatalFailure {#TestResult::HasNonfatalFailure} 1232 1233`bool TestResult::HasNonfatalFailure() const` 1234 1235Returns true if and only if the test has a non-fatal failure. 1236 1237##### elapsed_time {#TestResult::elapsed_time} 1238 1239`TimeInMillis TestResult::elapsed_time() const` 1240 1241Returns the elapsed time, in milliseconds. 1242 1243##### start_timestamp {#TestResult::start_timestamp} 1244 1245`TimeInMillis TestResult::start_timestamp() const` 1246 1247Gets the time of the test case start, in ms from the start of the UNIX epoch. 1248 1249##### GetTestPartResult {#TestResult::GetTestPartResult} 1250 1251`const TestPartResult& TestResult::GetTestPartResult(int i) const` 1252 1253Returns the [`TestPartResult`](#TestPartResult) for the `i`-th test part result 1254among all the results. `i` can range from 0 to `total_part_count() - 1`. If `i` 1255is not in that range, aborts the program. 1256 1257##### GetTestProperty {#TestResult::GetTestProperty} 1258 1259`const TestProperty& TestResult::GetTestProperty(int i) const` 1260 1261Returns the [`TestProperty`](#TestProperty) object for the `i`-th test property. 1262`i` can range from 0 to `test_property_count() - 1`. If `i` is not in that 1263range, aborts the program. 1264 1265### TimeInMillis {#TimeInMillis} 1266 1267`testing::TimeInMillis` 1268 1269An integer type representing time in milliseconds. 1270 1271### Types {#Types} 1272 1273`testing::Types<T...>` 1274 1275Represents a list of types for use in typed tests and type-parameterized tests. 1276 1277The template argument `T...` can be any number of types, for example: 1278 1279``` 1280testing::Types<char, int, unsigned int> 1281``` 1282 1283See [Typed Tests](../advanced.md#typed-tests) and 1284[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more 1285information. 1286 1287### WithParamInterface {#WithParamInterface} 1288 1289`testing::WithParamInterface<T>` 1290 1291The pure interface class that all value-parameterized tests inherit from. 1292 1293A value-parameterized test fixture class must inherit from both [`Test`](#Test) 1294and `WithParamInterface`. In most cases that just means inheriting from 1295[`TestWithParam`](#TestWithParam), but more complicated test hierarchies may 1296need to inherit from `Test` and `WithParamInterface` at different levels. 1297 1298This interface defines the type alias `ParamType` for the parameter type `T` and 1299has support for accessing the test parameter value via the `GetParam()` method: 1300 1301``` 1302static const ParamType& GetParam() 1303``` 1304 1305For more information, see 1306[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). 1307 1308## Functions 1309 1310GoogleTest defines the following functions to help with writing and running 1311tests. 1312 1313### InitGoogleTest {#InitGoogleTest} 1314 1315`void testing::InitGoogleTest(int* argc, char** argv)` \ 1316`void testing::InitGoogleTest(int* argc, wchar_t** argv)` \ 1317`void testing::InitGoogleTest()` 1318 1319Initializes GoogleTest. This must be called before calling 1320[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line 1321for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it 1322is removed from `argv`, and `*argc` is decremented. Keep in mind that `argv` 1323must terminate with a `NULL` pointer (i.e. `argv[argc]` is `NULL`), which is 1324already the case with the default `argv` passed to `main`. 1325 1326No value is returned. Instead, the GoogleTest flag variables are updated. 1327 1328The `InitGoogleTest(int* argc, wchar_t** argv)` overload can be used in Windows 1329programs compiled in `UNICODE` mode. 1330 1331The argument-less `InitGoogleTest()` overload can be used on Arduino/embedded 1332platforms where there is no `argc`/`argv`. 1333 1334### AddGlobalTestEnvironment {#AddGlobalTestEnvironment} 1335 1336`Environment* testing::AddGlobalTestEnvironment(Environment* env)` 1337 1338Adds a test environment to the test program. Must be called before 1339[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is called. See 1340[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down) for 1341more information. 1342 1343See also [`Environment`](#Environment). 1344 1345### RegisterTest {#RegisterTest} 1346 1347```cpp 1348template <typename Factory> 1349TestInfo* testing::RegisterTest(const char* test_suite_name, const char* test_name, 1350 const char* type_param, const char* value_param, 1351 const char* file, int line, Factory factory) 1352``` 1353 1354Dynamically registers a test with the framework. 1355 1356The `factory` argument is a factory callable (move-constructible) object or 1357function pointer that creates a new instance of the `Test` object. It handles 1358ownership to the caller. The signature of the callable is `Fixture*()`, where 1359`Fixture` is the test fixture class for the test. All tests registered with the 1360same `test_suite_name` must return the same fixture type. This is checked at 1361runtime. 1362 1363The framework will infer the fixture class from the factory and will call the 1364`SetUpTestSuite` and `TearDownTestSuite` methods for it. 1365 1366Must be called before [`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is invoked, otherwise 1367behavior is undefined. 1368 1369See 1370[Registering tests programmatically](../advanced.md#registering-tests-programmatically) 1371for more information. 1372 1373### RUN_ALL_TESTS {#RUN_ALL_TESTS} 1374 1375`int RUN_ALL_TESTS()` 1376 1377Use this function in `main()` to run all tests. It returns `0` if all tests are 1378successful, or `1` otherwise. 1379 1380`RUN_ALL_TESTS()` should be invoked after the command line has been parsed by 1381[`InitGoogleTest()`](#InitGoogleTest). 1382 1383This function was formerly a macro; thus, it is in the global namespace and has 1384an all-caps name. 1385 1386### AssertionSuccess {#AssertionSuccess} 1387 1388`AssertionResult testing::AssertionSuccess()` 1389 1390Creates a successful assertion result. See 1391[`AssertionResult`](#AssertionResult). 1392 1393### AssertionFailure {#AssertionFailure} 1394 1395`AssertionResult testing::AssertionFailure()` 1396 1397Creates a failed assertion result. Use the `<<` operator to store a failure 1398message: 1399 1400```cpp 1401testing::AssertionFailure() << "My failure message"; 1402``` 1403 1404See [`AssertionResult`](#AssertionResult). 1405 1406### StaticAssertTypeEq {#StaticAssertTypeEq} 1407 1408`testing::StaticAssertTypeEq<T1, T2>()` 1409 1410Compile-time assertion for type equality. Compiles if and only if `T1` and `T2` 1411are the same type. The value it returns is irrelevant. 1412 1413See [Type Assertions](../advanced.md#type-assertions) for more information. 1414 1415### PrintToString {#PrintToString} 1416 1417`std::string testing::PrintToString(x)` 1418 1419Prints any value `x` using GoogleTest's value printer. 1420 1421See 1422[Teaching GoogleTest How to Print Your Values](../advanced.md#teaching-googletest-how-to-print-your-values) 1423for more information. 1424 1425### PrintToStringParamName {#PrintToStringParamName} 1426 1427`std::string testing::PrintToStringParamName(TestParamInfo<T>& info)` 1428 1429A built-in parameterized test name generator which returns the result of 1430[`PrintToString`](#PrintToString) called on `info.param`. Does not work when the 1431test parameter is a `std::string` or C string. See 1432[Specifying Names for Value-Parameterized Test Parameters](../advanced.md#specifying-names-for-value-parameterized-test-parameters) 1433for more information. 1434 1435See also [`TestParamInfo`](#TestParamInfo) and 1436[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P). 1437