diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-03-02 10:49:06 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-03-02 08:52:30 +0000 |
commit | c5f60bcc7c6f7b7e34a681f59ea3da5e2f4e3a7b (patch) | |
tree | 443d50579df411fb7b8f9b76a5db8023345690ae /src/plugins/debugger | |
parent | ee4874e4eebc835c75c96302e6ee7a11868a64cb (diff) | |
download | qt-creator-c5f60bcc7c6f7b7e34a681f59ea3da5e2f4e3a7b.tar.gz |
Debugger: Fix compilation without tests
* Some functions were inside WITH_TESTS section.
* MSVC requires Perspective::Split to be explicitly exported.
Change-Id: I272cefc5c4f446415b2714595f8b398f8ce010a4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r-- | src/plugins/debugger/debuggermainwindow.h | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 191 |
2 files changed, 96 insertions, 97 deletions
diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index a361a78682..1800f693c2 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -52,7 +52,7 @@ class ANALYZER_EXPORT Perspective public: enum SplitType { SplitVertical, SplitHorizontal, AddToTab }; - class Split + class ANALYZER_EXPORT Split { public: Split() = default; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index a5e2a96f3e..53b067a9d3 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -3305,102 +3305,6 @@ void DebuggerPlugin::extensionsInitialized() dd->extensionsInitialized(); } -#ifdef WITH_TESTS - -void DebuggerPluginPrivate::testLoadProject(const QString &proFile, const TestCallBack &cb) -{ - connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, - this, &DebuggerPluginPrivate::testProjectLoaded); - - m_testCallbacks.append(cb); - ProjectExplorerPlugin::OpenProjectResult result = ProjectExplorerPlugin::openProject(proFile); - if (result) { - // Will end up in callback below due to the connections to - // signal currentProjectChanged(). - return; - } - - // Project opening failed. Eat the unused callback. - qWarning("Cannot open %s: %s", qPrintable(proFile), qPrintable(result.errorMessage())); - QVERIFY(false); - m_testCallbacks.pop_back(); -} - -void DebuggerPluginPrivate::testProjectLoaded(Project *project) -{ - if (!project) { - qWarning("Changed to null project."); - return; - } - m_testProject = project; - connect(project, SIGNAL(proFilesEvaluated()), SLOT(testProjectEvaluated())); - project->configureAsExampleProject({ }); -} - -void DebuggerPluginPrivate::testProjectEvaluated() -{ - QString fileName = m_testProject->projectFilePath().toUserOutput(); - QVERIFY(!fileName.isEmpty()); - qWarning("Project %s loaded", qPrintable(fileName)); - connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), - this, SLOT(testProjectBuilt(bool))); - ProjectExplorerPlugin::buildProject(m_testProject); -} - -void DebuggerPluginPrivate::testProjectBuilt(bool success) -{ - QVERIFY(success); - QVERIFY(!m_testCallbacks.isEmpty()); - TestCallBack cb = m_testCallbacks.takeLast(); - invoke<void>(cb.receiver, cb.slot); -} - -void DebuggerPluginPrivate::testUnloadProject() -{ - ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); - invoke<void>(pe, "unloadProject"); -} - -//static Target *activeTarget() -//{ -// Project *project = ProjectExplorerPlugin::instance()->currentProject(); -// return project->activeTarget(); -//} - -//static Kit *currentKit() -//{ -// Target *t = activeTarget(); -// if (!t || !t->isEnabled()) -// return 0; -// return t->kit(); -//} - -//static LocalApplicationRunConfiguration *activeLocalRunConfiguration() -//{ -// Target *t = activeTarget(); -// return t ? qobject_cast<LocalApplicationRunConfiguration *>(t->activeRunConfiguration()) : 0; -//} - -void DebuggerPluginPrivate::testRunProject(const DebuggerRunParameters &rp, const TestCallBack &cb) -{ - m_testCallbacks.append(cb); - RunControl *rc = createAndScheduleRun(rp, 0); - connect(rc, &RunControl::finished, this, &DebuggerPluginPrivate::testRunControlFinished); -} - -void DebuggerPluginPrivate::testRunControlFinished() -{ - QVERIFY(!m_testCallbacks.isEmpty()); - TestCallBack cb = m_testCallbacks.takeLast(); - ExtensionSystem::invoke<void>(cb.receiver, cb.slot); -} - -void DebuggerPluginPrivate::testFinished() -{ - QTestEventLoop::instance().exitLoop(); - QVERIFY(m_testSuccess); -} - void DebuggerPluginPrivate::updateUiForProject(Project *project) { if (m_previousProject) { @@ -3605,6 +3509,101 @@ QWidget *DebuggerPluginPrivate::createContents(IMode *mode) //} +#ifdef WITH_TESTS +void DebuggerPluginPrivate::testLoadProject(const QString &proFile, const TestCallBack &cb) +{ + connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, + this, &DebuggerPluginPrivate::testProjectLoaded); + + m_testCallbacks.append(cb); + ProjectExplorerPlugin::OpenProjectResult result = ProjectExplorerPlugin::openProject(proFile); + if (result) { + // Will end up in callback below due to the connections to + // signal currentProjectChanged(). + return; + } + + // Project opening failed. Eat the unused callback. + qWarning("Cannot open %s: %s", qPrintable(proFile), qPrintable(result.errorMessage())); + QVERIFY(false); + m_testCallbacks.pop_back(); +} + +void DebuggerPluginPrivate::testProjectLoaded(Project *project) +{ + if (!project) { + qWarning("Changed to null project."); + return; + } + m_testProject = project; + connect(project, SIGNAL(proFilesEvaluated()), SLOT(testProjectEvaluated())); + project->configureAsExampleProject({ }); +} + +void DebuggerPluginPrivate::testProjectEvaluated() +{ + QString fileName = m_testProject->projectFilePath().toUserOutput(); + QVERIFY(!fileName.isEmpty()); + qWarning("Project %s loaded", qPrintable(fileName)); + connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), + this, SLOT(testProjectBuilt(bool))); + ProjectExplorerPlugin::buildProject(m_testProject); +} + +void DebuggerPluginPrivate::testProjectBuilt(bool success) +{ + QVERIFY(success); + QVERIFY(!m_testCallbacks.isEmpty()); + TestCallBack cb = m_testCallbacks.takeLast(); + invoke<void>(cb.receiver, cb.slot); +} + +void DebuggerPluginPrivate::testUnloadProject() +{ + ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); + invoke<void>(pe, "unloadProject"); +} + +//static Target *activeTarget() +//{ +// Project *project = ProjectExplorerPlugin::instance()->currentProject(); +// return project->activeTarget(); +//} + +//static Kit *currentKit() +//{ +// Target *t = activeTarget(); +// if (!t || !t->isEnabled()) +// return 0; +// return t->kit(); +//} + +//static LocalApplicationRunConfiguration *activeLocalRunConfiguration() +//{ +// Target *t = activeTarget(); +// return t ? qobject_cast<LocalApplicationRunConfiguration *>(t->activeRunConfiguration()) : 0; +//} + +void DebuggerPluginPrivate::testRunProject(const DebuggerRunParameters &rp, const TestCallBack &cb) +{ + m_testCallbacks.append(cb); + RunControl *rc = createAndScheduleRun(rp, 0); + connect(rc, &RunControl::finished, this, &DebuggerPluginPrivate::testRunControlFinished); +} + +void DebuggerPluginPrivate::testRunControlFinished() +{ + QVERIFY(!m_testCallbacks.isEmpty()); + TestCallBack cb = m_testCallbacks.takeLast(); + ExtensionSystem::invoke<void>(cb.receiver, cb.slot); +} + +void DebuggerPluginPrivate::testFinished() +{ + QTestEventLoop::instance().exitLoop(); + QVERIFY(m_testSuccess); +} + /////////////////////////////////////////////////////////////////////////// //void DebuggerPlugin::testStateMachine() |