MCPcopy Create free account
hub / github.com/catboost/catboost / Main

Method Main

library/cpp/testing/gtest/main.cpp:246–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246int NGTest::Main(int argc, char** argv) {
247 InitializeYt(argc, argv);
248
249 auto flags = ParseFlags(argc, argv);
250
251 ::testing::GTEST_FLAG(filter) = flags.Filter;
252
253 std::ofstream trace;
254 if (!flags.TracePath.empty()) {
255 trace.open(flags.TracePath, (flags.AppendTrace ? std::ios::app : std::ios::out) | std::ios::binary);
256
257 if (!trace.is_open()) {
258 std::cerr << "Failed to open file " << flags.TracePath << " for write" << std::endl;
259 exit(2);
260 }
261
262 UnsetDefaultReporter();
263 SetTraceReporter(&trace);
264 }
265
266 NTesting::THook::CallBeforeInit();
267
268 ::testing::InitGoogleMock(&flags.GtestArgc, flags.GtestArgv.data());
269
270 ListTests(flags.ListLevel, flags.ListPath);
271
272 NTesting::THook::CallBeforeRun();
273
274 Y_DEFER { NTesting::THook::CallAfterRun(); };
275
276 return RUN_ALL_TESTS();
277}
278
279NGTest::TFlags NGTest::ParseFlags(int argc, char** argv) {
280 TFlags result;

Callers

nothing calls this directly

Calls 8

InitializeYtFunction · 0.85
exitFunction · 0.85
InitGoogleMockFunction · 0.85
RUN_ALL_TESTSFunction · 0.85
ParseFlagsEnum · 0.50
emptyMethod · 0.45
openMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected