Commit b66705fd authored by Milian Wolff's avatar Milian Wolff
Browse files

Fix test_pluginenabling

Allow multiple initializations of the AutoTestShell instead of
asserting.
parent f124dab2
......@@ -19,12 +19,11 @@
#include "autotestshell.h"
KDevelop::AutoTestShell::AutoTestShell(const QStringList& plugins)
: m_plugins(plugins)
{
}
using namespace KDevelop;
AutoTestShell::~AutoTestShell() = default;
void KDevelop::AutoTestShell::init(const QStringList& plugins)
void AutoTestShell::init(const QStringList& plugins)
{
// TODO: Maybe generalize, add KDEVELOP_STANDALONE build option
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
......@@ -32,7 +31,7 @@ void KDevelop::AutoTestShell::init(const QStringList& plugins)
#endif
qputenv("CLEAR_DUCHAIN_DIR", "1"); // Always clear duchain dir (also to avoid popups asking the user to clear it)
static auto instance = AutoTestShell(plugins);
Q_ASSERT(instance.m_plugins == plugins);
static auto instance = AutoTestShell();
instance.m_plugins = plugins;
s_instance = &instance;
}
......@@ -47,7 +47,7 @@ class KDEVPLATFORMTESTS_EXPORT AutoTestShell
: public KDevelop::ShellExtension
{
public:
explicit AutoTestShell(const QStringList& plugins);
~AutoTestShell();
QString xmlFile() override { return QString(); }
QString executableFilePath() override { return QString(); };
......@@ -72,6 +72,7 @@ public:
static void init(const QStringList& plugins = QStringList());
private:
AutoTestShell() = default;
QStringList m_plugins;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment