diff --git a/src/app/main.cpp b/src/app/main.cpp index 81d9ff84f94e475608d221593f2be1191d80e3b6..4b2d15b723958a8f4560cbc786999b315b91627f 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -82,6 +82,7 @@ static const char HELP_OPTION4[] = "--help"; static const char VERSION_OPTION[] = "-version"; static const char CLIENT_OPTION[] = "-client"; static const char SETTINGS_OPTION[] = "-settingspath"; +static const char TEST_OPTION[] = "-test"; static const char PID_OPTION[] = "-pid"; static const char BLOCK_OPTION[] = "-block"; static const char PLUGINPATH_OPTION[] = "-pluginpath"; @@ -319,6 +320,7 @@ int main(int argc, char **argv) QStringList customPluginPaths; QStringList arguments = app.arguments(); // adapted arguments list is passed to plugin manager later QMutableStringListIterator it(arguments); + bool testOptionProvided = false; while (it.hasNext()) { const QString &arg = it.next(); if (arg == QLatin1String(SETTINGS_OPTION)) { @@ -333,8 +335,15 @@ int main(int argc, char **argv) customPluginPaths << QDir::fromNativeSeparators(it.next()); it.remove(); } + } else if (arg == QLatin1String(TEST_OPTION)) { + testOptionProvided = true; } } + if (settingsPath.isEmpty() && testOptionProvided) { + settingsPath = QDir::tempPath() + QString::fromLatin1("/qtc-%1-test-settings") + .arg(QLatin1String(Core::Constants::IDE_VERSION_LONG)); + settingsPath = QDir::cleanPath(settingsPath); + } if (!settingsPath.isEmpty()) QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settingsPath); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 22d7837ebf98c2d6dba58583547448b4dc1da925..ae837fd1151d442f389c74c0421efa0bc19c1478 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -614,7 +614,8 @@ void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int d #ifdef WITH_TESTS formatOption(str, QString::fromLatin1(OptionsParser::TEST_OPTION) + QLatin1String(" <plugin>[,testfunction[:testdata]]..."), QString(), - QLatin1String("Run plugin's tests"), optionIndentation, descriptionIndentation); + QLatin1String("Run plugin's tests (by default a separate settings path is used)"), + optionIndentation, descriptionIndentation); formatOption(str, QString::fromLatin1(OptionsParser::TEST_OPTION) + QLatin1String(" all"), QString(), QLatin1String("Run tests from all plugins"), optionIndentation, descriptionIndentation);