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

Method RunMain

library/cpp/testing/unittest/utmain.cpp:723–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721#endif
722
723int NUnitTest::RunMain(int argc, char** argv) {
724#if defined(_linux_) && defined(CLANG_COVERAGE)
725 {
726 struct sigaction sa;
727 memset(&sa, 0, sizeof(sa));
728 sa.sa_handler = GracefulShutdownHandler;
729 sa.sa_flags = SA_SIGINFO | SA_RESTART;
730 Y_ABORT_UNLESS(!sigaction(SIGUSR2, &sa, nullptr));
731 }
732#endif
733 InitializeYt(argc, argv);
734
735 NTesting::THook::CallBeforeInit();
736 InitNetworkSubSystem();
737 Singleton<::NPrivate::TTestEnv>();
738
739 try {
740 GetExecPath();
741 } catch (...) {
742 }
743
744#ifndef UT_SKIP_EXCEPTIONS
745 try {
746#endif
747 NTesting::THook::CallBeforeRun();
748 Y_DEFER {
749 NTesting::THook::CallAfterRun();
750 };
751
752 NPlugin::OnStartMain(argc, argv);
753 Y_DEFER {
754 NPlugin::OnStopMain(argc, argv);
755 };
756
757 TColoredProcessor processor(GetExecPath());
758 IOutputStream* listStream = &Cout;
759 THolder<IOutputStream> listFile;
760
761 enum EListType {
762 DONT_LIST,
763 LIST,
764 LIST_VERBOSE
765 };
766 EListType listTests = DONT_LIST;
767
768 bool hasJUnitProcessor = false;
769 bool forkTests = false;
770 bool isForked = false;
771 std::vector<std::shared_ptr<ITestSuiteProcessor>> traceProcessors;
772
773
774 // load filters from environment variable
775 TString filterFn = GetEnv(Y_UNITTEST_TEST_FILTER_FILE_OPTION);
776 if (!filterFn.empty()) {
777 processor.FilterFromFile(filterFn);
778 }
779
780 auto processJunitOption = [&](const TStringBuf& v) {

Callers

nothing calls this directly

Calls 15

InitializeYtFunction · 0.85
InitNetworkSubSystemFunction · 0.85
OnStartMainFunction · 0.85
OnStopMainFunction · 0.85
strcmpFunction · 0.85
DoUsageFunction · 0.85
DoListFunction · 0.85
InstanceFunction · 0.85
CurrentExceptionMessageFunction · 0.85
FilterFromFileMethod · 0.80
SubStringMethod · 0.80
stemMethod · 0.80

Tested by

no test coverage detected