MCPcopy Create free account
hub / github.com/comaps/comaps / main

Function main

libs/testing/testingmain.cpp:155–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155int main(int argc, char * argv[])
156{
157#if defined(OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP) && !defined(OMIM_OS_IPHONE)
158 QAPP theApp(argc, argv);
159 UNUSED_VALUE(theApp);
160#else
161 UNUSED_VALUE(argc);
162 UNUSED_VALUE(argv);
163#endif
164
165 base::ScopedLogLevelChanger const infoLogLevel(LINFO);
166#if defined(OMIM_OS_DESKTOP) || defined(OMIM_OS_IPHONE)
167 base::SetLogMessageFn(base::LogMessageTests);
168#endif
169
170#ifdef WITH_GL_MOCK
171 emul::GLMockFunctions::Init(&argc, argv);
172 SCOPE_GUARD(GLMockScope, bind(&emul::GLMockFunctions::Teardown));
173#endif
174
175 vector<string> testnames;
176 vector<bool> testResults;
177 int numFailedTests = 0;
178
179 ParseOptions(argc, argv, g_testingOptions);
180 if (g_testingOptions.m_help)
181 {
182 Usage(argv[0]);
183 return STATUS_SUCCESS;
184 }
185
186 regex filterRegExp;
187 if (g_testingOptions.m_filterRegExp)
188 filterRegExp.assign(g_testingOptions.m_filterRegExp);
189
190 regex suppressRegExp;
191 if (g_testingOptions.m_suppressRegExp)
192 suppressRegExp.assign(g_testingOptions.m_suppressRegExp);
193
194 for (TestRegister * test = TestRegister::FirstRegister(); test; test = test->m_next)
195 {
196 string filename(test->m_filename);
197 string testname(test->m_testname);
198
199 // Retrieve fine file name.
200 auto const lastSlash = filename.find_last_of("\\/");
201 if (lastSlash != string::npos)
202 filename.erase(0, lastSlash + 1);
203
204 testnames.push_back(filename + "::" + testname);
205 testResults.push_back(true);
206 }
207
208 if (GetTestingOptions().m_listTests)
209 {
210 for (auto const & name : testnames)
211 cout << name << '\n';
212 return 0;

Callers

nothing calls this directly

Calls 12

SetLogMessageFnFunction · 0.85
ParseOptionsFunction · 0.85
UsageFunction · 0.85
ElapsedNanosecondsMethod · 0.80
InitFunction · 0.50
assignMethod · 0.45
eraseMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
whatMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected