MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / AddTestInfo

Function AddTestInfo

rtpose_wrapper/src/gtest/gtest-all.cpp:1030–1050  ·  view source on GitHub ↗

Adds a TestInfo to the unit test. Arguments: set_up_tc: pointer to the function that sets up the test case tear_down_tc: pointer to the function that tears down the test case test_info: the TestInfo object

Source from the content-addressed store, hash-verified

1028 // tear_down_tc: pointer to the function that tears down the test case
1029 // test_info: the TestInfo object
1030 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
1031 Test::TearDownTestCaseFunc tear_down_tc,
1032 TestInfo* test_info) {
1033 // In order to support thread-safe death tests, we need to
1034 // remember the original working directory when the test program
1035 // was first invoked. We cannot do this in RUN_ALL_TESTS(), as
1036 // the user may have changed the current directory before calling
1037 // RUN_ALL_TESTS(). Therefore we capture the current directory in
1038 // AddTestInfo(), which is called to register a TEST or TEST_F
1039 // before main() is reached.
1040 if (original_working_dir_.IsEmpty()) {
1041 original_working_dir_.Set(FilePath::GetCurrentDir());
1042 GTEST_CHECK_(!original_working_dir_.IsEmpty())
1043 << "Failed to get the current working directory.";
1044 }
1045
1046 GetTestCase(test_info->test_case_name(),
1047 test_info->type_param(),
1048 set_up_tc,
1049 tear_down_tc)->AddTestInfo(test_info);
1050 }
1051
1052#if GTEST_HAS_PARAM_TEST
1053 // Returns ParameterizedTestCaseRegistry object used to keep track of

Callers

nothing calls this directly

Calls 3

GetTestCaseFunction · 0.85
SetMethod · 0.80
AddTestInfoMethod · 0.80

Tested by

no test coverage detected