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

Method Init

library/cpp/threading/skip_list/perf/main.cpp:149–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 bool Init(int argc, const char* argv[]) {
150 TVector<TString> tests;
151 try {
152 NLastGetopt::TOpts opts;
153 opts.AddHelpOption();
154
155#define OPTION(opt, x) \
156 opts.AddLongOption(opt, #x) \
157 .Optional() \
158 .DefaultValue(ToString(x)) \
159 .StoreResult(&x) // end of OPTION
160
161 OPTION('i', Iterations);
162 OPTION('k', KeyLen);
163 OPTION('v', ValueLen);
164 OPTION('r', NumReaders);
165 OPTION('w', NumWriters);
166 OPTION('b', BatchSize);
167
168#undef OPTION
169
170 NLastGetopt::TOptsParseResultException optsRes(&opts, argc, argv);
171 for (const auto& opt : opts.Opts_) {
172 const NLastGetopt::TOptParseResult* r = optsRes.FindOptParseResult(opt.Get(), true);
173 if (r) {
174 LogInfo() << "[-" << opt->GetChar() << "] " << opt->GetName() << ": " << r->Back() << Endl;
175 }
176 }
177 tests = optsRes.GetFreeArgs();
178 } catch (...) {
179 LogError() << CurrentExceptionMessage() << Endl;
180 return false;
181 }
182
183#define TEST(type) \
184 AddTest(#type, std::bind(&TTestSuite::Y_CAT(TEST_, type), this)) // end of TEST
185
186 TEST(Clear);
187 TEST(InsertRandom);
188 TEST(InsertSequential);
189 TEST(InsertSequentialSimple);
190 TEST(LookupRandom);
191 TEST(Concurrent);
192
193#undef TEST
194
195 if (tests.empty()) {
196 LogError() << "no tests specified, choose from: " << PrintTests() << Endl;
197 return false;
198 }
199
200 for (size_t i = 0; i < tests.size(); ++i) {
201 if (!AllTests.contains(tests[i])) {
202 LogError() << "unknown test name: " << tests[i] << Endl;
203 return false;
204 }
205 Tests.push_back(AllTests[tests[i]]);
206 }

Callers 1

mainFunction · 0.45

Calls 12

CurrentExceptionMessageFunction · 0.85
FindOptParseResultMethod · 0.80
TESTFunction · 0.50
GetMethod · 0.45
GetCharMethod · 0.45
GetNameMethod · 0.45
BackMethod · 0.45
GetFreeArgsMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected