| 244 | } |
| 245 | |
| 246 | int 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 | |
| 279 | NGTest::TFlags NGTest::ParseFlags(int argc, char** argv) { |
| 280 | TFlags result; |
nothing calls this directly
no test coverage detected