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

Function ParseOptions

libs/testing/testingmain.cpp:119–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void ParseOptions(int argc, char * argv[], CommandLineOptions & options)
120{
121 for (int i = 1; i < argc; ++i)
122 {
123 std::string_view const arg = argv[i];
124 if (arg.starts_with(kFilterOption))
125 options.m_filterRegExp = argv[i] + sizeof(kFilterOption) - 1;
126 if (arg.starts_with(kSuppressOption))
127 options.m_suppressRegExp = argv[i] + sizeof(kSuppressOption) - 1;
128 if (arg.starts_with(kDataPathOptions))
129 options.m_dataPath = argv[i] + sizeof(kDataPathOptions) - 1;
130 if (arg.starts_with(kResourcePathOptions))
131 options.m_resourcePath = argv[i] + sizeof(kResourcePathOptions) - 1;
132 if (arg == kHelpOption)
133 options.m_help = true;
134 if (arg == kListAllTestsOption)
135 options.m_listTests = true;
136 }
137#ifndef OMIM_UNIT_TEST_DISABLE_PLATFORM_INIT
138 // Setting stored paths from testingmain.cpp
139 Platform & pl = GetPlatform();
140 if (options.m_dataPath)
141 pl.SetWritableDirForTests(options.m_dataPath);
142 if (options.m_resourcePath)
143 {
144 pl.SetResourceDir(options.m_resourcePath);
145 pl.SetSettingsDir(options.m_resourcePath);
146 }
147#endif
148}
149
150CommandLineOptions const & GetTestingOptions()
151{

Callers 1

mainFunction · 0.85

Calls 3

SetResourceDirMethod · 0.80
SetSettingsDirMethod · 0.45

Tested by

no test coverage detected