| 153 | } |
| 154 | |
| 155 | int 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; |
nothing calls this directly
no test coverage detected