MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / checkForTestOption

Method checkForTestOption

lib/extensionsystem/optionsparser.cpp:106–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool OptionsParser::checkForTestOption()
107{
108 if (m_currentArg != QLatin1String(TEST_OPTION))
109 return false;
110 if (nextToken(RequiredToken)) {
111 if (m_currentArg == QLatin1String("all")) {
112 foreach (PluginSpec *spec, m_pmPrivate->pluginSpecs) {
113 if (spec && !m_pmPrivate->containsTestSpec(spec))
114 m_pmPrivate->testSpecs.append(PluginManagerPrivate::TestSpec(spec));
115 }
116 } else {
117 QStringList args = m_currentArg.split(QLatin1Char(','));
118 const QString pluginName = args.takeFirst();
119 if (PluginSpec *spec = m_pmPrivate->pluginByName(pluginName)) {
120 if (m_pmPrivate->containsTestSpec(spec)) {
121 if (m_errorString)
122 *m_errorString = QCoreApplication::translate("PluginManager",
123 "The plugin '%1' is specified twice for testing.").arg(pluginName);
124 m_hasError = true;
125 } else {
126 m_pmPrivate->testSpecs.append(PluginManagerPrivate::TestSpec(spec, args));
127 }
128 } else {
129 if (m_errorString)
130 *m_errorString = QCoreApplication::translate("PluginManager",
131 "The plugin '%1' does not exist.").arg(pluginName);
132 m_hasError = true;
133 }
134 }
135 }
136 return true;
137}
138
139bool OptionsParser::checkForLoadOption()
140{

Callers

nothing calls this directly

Calls 3

TestSpecClass · 0.85
pluginByNameMethod · 0.80
foreachFunction · 0.70

Tested by

no test coverage detected