OSDN Git Service

PluginManager: add -test all capability for internal testing.
authorBill King <bill.king@nokia.com>
Wed, 16 Feb 2011 12:40:44 +0000 (13:40 +0100)
committerBill King <bill.king@nokia.com>
Wed, 16 Feb 2011 16:09:21 +0000 (17:09 +0100)
src/libs/extensionsystem/optionsparser.cpp

index 9b093d3..cf5ce78 100644 (file)
@@ -107,14 +107,21 @@ bool OptionsParser::checkForTestOption()
     if (m_currentArg != QLatin1String(TEST_OPTION))
         return false;
     if (nextToken(RequiredToken)) {
-        PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
-        if (!spec) {
-            if (m_errorString)
-                *m_errorString = QCoreApplication::translate("PluginManager",
-                                                             "The plugin '%1' does not exist.").arg(m_currentArg);
-            m_hasError = true;
+        if(m_currentArg == "all") {
+            foreach(PluginSpec *spec, m_pmPrivate->pluginSpecs) {
+                if (spec)
+                    m_pmPrivate->testSpecs.append(spec);
+            }
         } else {
-            m_pmPrivate->testSpecs.append(spec);
+            PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
+            if (!spec) {
+                if (m_errorString)
+                    *m_errorString = QCoreApplication::translate("PluginManager",
+                                                                 "The plugin '%1' does not exist.").arg(m_currentArg);
+                m_hasError = true;
+            } else {
+                m_pmPrivate->testSpecs.append(spec);
+            }
         }
     }
     return true;