| 104 | } |
| 105 | |
| 106 | bool 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 | |
| 139 | bool OptionsParser::checkForLoadOption() |
| 140 | { |
nothing calls this directly
no test coverage detected