forked from qt-creator/qt-creator
GenericProject: Make dependency on CppTools optional
Especially in the light of the language server, the generic project is currently the project one can use for language servers that require a "project workspace". Makes it possibly to run Qt Creator with "-noload CppTools" if you still want to use generic projects with some other language. Change-Id: Ib9059289a2db4c44c0c1060a02fcdafacb885fbd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -61,6 +61,7 @@ add_qtc_plugin(CppTools
|
||||
cppprojectinfogenerator.cpp cppprojectinfogenerator.h
|
||||
cppprojectpartchooser.cpp cppprojectpartchooser.h
|
||||
cppprojectupdater.cpp cppprojectupdater.h
|
||||
cppprojectupdaterinterface.h
|
||||
cppqtstyleindenter.cpp cppqtstyleindenter.h
|
||||
cpprefactoringchanges.cpp cpprefactoringchanges.h
|
||||
cpprefactoringengine.cpp cpprefactoringengine.h
|
||||
|
@@ -101,4 +101,14 @@ void CppProjectUpdater::onProjectInfoGenerated()
|
||||
QTC_CHECK(future != QFuture<void>());
|
||||
}
|
||||
|
||||
CppProjectUpdaterFactory::CppProjectUpdaterFactory()
|
||||
{
|
||||
setObjectName("CppProjectUpdaterFactory");
|
||||
}
|
||||
|
||||
CppProjectUpdaterInterface *CppProjectUpdaterFactory::create()
|
||||
{
|
||||
return new CppProjectUpdater;
|
||||
}
|
||||
|
||||
} // namespace CppTools
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cppprojectupdaterinterface.h"
|
||||
#include "cpptools_global.h"
|
||||
#include "projectinfo.h"
|
||||
|
||||
@@ -35,7 +36,18 @@ namespace CppTools {
|
||||
|
||||
class ProjectInfo;
|
||||
|
||||
class CPPTOOLS_EXPORT CppProjectUpdater : public QObject
|
||||
// registered in extensionsystem's object pool for plugins with weak dependency to CppTools
|
||||
class CPPTOOLS_EXPORT CppProjectUpdaterFactory : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CppProjectUpdaterFactory();
|
||||
|
||||
// keep the namespace, for the type name in the invokeMethod call
|
||||
Q_INVOKABLE CppTools::CppProjectUpdaterInterface *create();
|
||||
};
|
||||
|
||||
class CPPTOOLS_EXPORT CppProjectUpdater : public QObject, public CppProjectUpdaterInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,8 +55,8 @@ public:
|
||||
CppProjectUpdater();
|
||||
~CppProjectUpdater() override;
|
||||
|
||||
void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo);
|
||||
void cancel();
|
||||
void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) override;
|
||||
void cancel() override;
|
||||
|
||||
private:
|
||||
void cancelAndWaitForFinished();
|
||||
|
41
src/plugins/cpptools/cppprojectupdaterinterface.h
Normal file
41
src/plugins/cpptools/cppprojectupdaterinterface.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/rawprojectpart.h>
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
class CppProjectUpdaterInterface
|
||||
{
|
||||
public:
|
||||
virtual ~CppProjectUpdaterInterface() = default;
|
||||
|
||||
virtual void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) = 0;
|
||||
virtual void cancel() = 0;
|
||||
};
|
||||
|
||||
} // namespace CppTools
|
@@ -53,6 +53,7 @@ HEADERS += \
|
||||
cpppointerdeclarationformatter.h \
|
||||
cppprojectfile.h \
|
||||
cppprojectupdater.h \
|
||||
cppprojectupdaterinterface.h \
|
||||
cppqtstyleindenter.h \
|
||||
cpprefactoringchanges.h \
|
||||
cpprefactoringengine.h \
|
||||
|
@@ -140,6 +140,7 @@ Project {
|
||||
"cppprojectpartchooser.h",
|
||||
"cppprojectupdater.cpp",
|
||||
"cppprojectupdater.h",
|
||||
"cppprojectupdaterinterface.h",
|
||||
"cppqtstyleindenter.cpp",
|
||||
"cppqtstyleindenter.h",
|
||||
"cpprefactoringchanges.cpp",
|
||||
|
@@ -23,31 +23,33 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "cpptoolsconstants.h"
|
||||
#include "cpptoolsplugin.h"
|
||||
#include "cppfilesettingspage.h"
|
||||
#include "cppcodemodelsettingspage.h"
|
||||
#include "cppcodestylesettingspage.h"
|
||||
#include "cppfilesettingspage.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpptoolsjsextension.h"
|
||||
#include "cpptoolssettings.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "cppprojectfile.h"
|
||||
#include "cppprojectupdater.h"
|
||||
#include "cpptoolsbridge.h"
|
||||
#include "cpptoolsbridgeqtcreatorimplementation.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
#include "cpptoolsjsextension.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "cpptoolssettings.h"
|
||||
#include "projectinfo.h"
|
||||
#include "stringtable.h"
|
||||
#include "cpptoolsbridgeqtcreatorimplementation.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/jsexpander.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
|
||||
@@ -97,6 +99,7 @@ public:
|
||||
delete m_cppCodeModelSettingsPage;
|
||||
if (m_cppCodeStyleSettingsPage)
|
||||
delete m_cppCodeStyleSettingsPage;
|
||||
ExtensionSystem::PluginManager::removeObject(&m_cppProjectUpdaterFactory);
|
||||
}
|
||||
|
||||
QSharedPointer<CppCodeModelSettings> m_codeModelSettings;
|
||||
@@ -104,6 +107,7 @@ public:
|
||||
CppFileSettingsPage *m_cppFileSettingsPage = nullptr;
|
||||
CppCodeModelSettingsPage *m_cppCodeModelSettingsPage = nullptr;
|
||||
QPointer<CppCodeStyleSettingsPage> m_cppCodeStyleSettingsPage = nullptr;
|
||||
CppProjectUpdaterFactory m_cppProjectUpdaterFactory;
|
||||
};
|
||||
|
||||
CppToolsPlugin::CppToolsPlugin()
|
||||
@@ -173,6 +177,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
d = new CppToolsPluginPrivate;
|
||||
|
||||
JsExpander::registerGlobalObject<CppToolsJsExtension>("Cpp");
|
||||
ExtensionSystem::PluginManager::addObject(&d->m_cppProjectUpdaterFactory);
|
||||
|
||||
// Menus
|
||||
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
|
@@ -3,7 +3,8 @@ if (WITH_TESTS)
|
||||
endif()
|
||||
|
||||
add_qtc_plugin(GenericProjectManager
|
||||
PLUGIN_DEPENDS Core CppTools ProjectExplorer QtSupport TextEditor ${TST_COMPONENT}
|
||||
PLUGIN_DEPENDS Core ProjectExplorer QtSupport TextEditor ${TST_COMPONENT}
|
||||
PLUGIN_RECOMMENDS CppTools
|
||||
SOURCES ${TEST_SOURCES}
|
||||
filesselectionwizardpage.cpp filesselectionwizardpage.h
|
||||
genericbuildconfiguration.cpp genericbuildconfiguration.h
|
||||
@@ -15,8 +16,3 @@ add_qtc_plugin(GenericProjectManager
|
||||
genericprojectplugin.cpp genericprojectplugin.h
|
||||
genericprojectwizard.cpp genericprojectwizard.h
|
||||
)
|
||||
|
||||
extend_qtc_plugin(GenericProjectManager
|
||||
CONDITION WITH_TESTS
|
||||
SOURCES genericprojectplugin_test.cpp
|
||||
)
|
||||
|
@@ -34,7 +34,9 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
|
||||
#include <cpptools/cppprojectupdater.h>
|
||||
#include <cpptools/cppprojectupdaterinterface.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
@@ -59,6 +61,7 @@
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QHash>
|
||||
#include <QMetaObject>
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
|
||||
@@ -170,13 +173,23 @@ static bool writeFile(const QString &filePath, const QString &contents)
|
||||
|
||||
GenericProject::GenericProject(const Utils::FilePath &fileName)
|
||||
: Project(Constants::GENERICMIMETYPE, fileName)
|
||||
, m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
|
||||
, m_deployFileWatcher(new FileSystemWatcher(this))
|
||||
{
|
||||
setId(Constants::GENERICPROJECT_ID);
|
||||
setProjectLanguages(Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||
setDisplayName(fileName.toFileInfo().completeBaseName());
|
||||
|
||||
QObject *projectUpdaterFactory = ExtensionSystem::PluginManager::getObjectByName(
|
||||
"CppProjectUpdaterFactory");
|
||||
if (projectUpdaterFactory) {
|
||||
const bool successFullyCreatedProjectUpdater
|
||||
= QMetaObject::invokeMethod(projectUpdaterFactory,
|
||||
"create",
|
||||
Q_RETURN_ARG(CppTools::CppProjectUpdaterInterface *,
|
||||
m_cppCodeModelUpdater));
|
||||
QTC_CHECK(successFullyCreatedProjectUpdater);
|
||||
}
|
||||
|
||||
connect(this, &GenericProject::projectFileIsDirty, this, [this](const FilePath &p) {
|
||||
if (p.endsWith(".files"))
|
||||
refresh(Files);
|
||||
@@ -501,6 +514,8 @@ QStringList GenericProject::processEntries(const QStringList &paths,
|
||||
|
||||
void GenericProject::refreshCppCodeModel()
|
||||
{
|
||||
if (!m_cppCodeModelUpdater)
|
||||
return;
|
||||
QtSupport::CppKitInfo kitInfo(this);
|
||||
QTC_ASSERT(kitInfo.isValid(), return);
|
||||
|
||||
|
@@ -29,7 +29,9 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
namespace CppTools { class CppProjectUpdater; }
|
||||
namespace CppTools {
|
||||
class CppProjectUpdaterInterface;
|
||||
}
|
||||
namespace Utils { class FileSystemWatcher; }
|
||||
|
||||
namespace GenericProjectManager {
|
||||
@@ -87,7 +89,7 @@ private:
|
||||
QStringList m_cxxflags;
|
||||
QStringList m_cflags;
|
||||
|
||||
CppTools::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
|
||||
CppTools::CppProjectUpdaterInterface *m_cppCodeModelUpdater = nullptr;
|
||||
|
||||
Utils::FileSystemWatcher * const m_deployFileWatcher = nullptr;
|
||||
};
|
||||
|
@@ -17,9 +17,4 @@ SOURCES = genericproject.cpp \
|
||||
genericbuildconfiguration.cpp \
|
||||
filesselectionwizardpage.cpp
|
||||
|
||||
equals(TEST, 1) {
|
||||
SOURCES += genericprojectplugin_test.cpp
|
||||
DEFINES += SRCDIR=\\\"$$PWD\\\"
|
||||
}
|
||||
|
||||
RESOURCES += genericprojectmanager.qrc
|
||||
|
@@ -8,12 +8,15 @@ QtcPlugin {
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "QtSupport" }
|
||||
Depends { name: "app_version_header" }
|
||||
|
||||
pluginRecommends: [
|
||||
"CppTools"
|
||||
]
|
||||
|
||||
pluginTestDepends: [
|
||||
"CppEditor",
|
||||
]
|
||||
@@ -35,12 +38,4 @@ QtcPlugin {
|
||||
"genericprojectwizard.cpp",
|
||||
"genericprojectwizard.h",
|
||||
]
|
||||
|
||||
Group {
|
||||
name: "Tests"
|
||||
condition: qtc.testsEnabled
|
||||
files: [ "genericprojectplugin_test.cpp" ]
|
||||
|
||||
cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"'])
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,9 @@ QTC_LIB_DEPENDS += \
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
coreplugin \
|
||||
projectexplorer \
|
||||
cpptools \
|
||||
texteditor \
|
||||
qtsupport
|
||||
QTC_PLUGIN_RECOMMENDS += \
|
||||
cpptools
|
||||
QTC_TEST_DEPENDS += \
|
||||
cppeditor
|
||||
|
@@ -38,13 +38,6 @@ class GenericProjectPlugin : public ExtensionSystem::IPlugin
|
||||
public:
|
||||
~GenericProjectPlugin() override;
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
private slots:
|
||||
void test_simple();
|
||||
void test_mixed1();
|
||||
void test_mixed2();
|
||||
#endif // WITH_TESTS
|
||||
|
||||
private:
|
||||
bool initialize(const QStringList &arguments, QString *errorString) override;
|
||||
void extensionsInitialized() override { }
|
||||
|
@@ -1,168 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "genericprojectplugin.h"
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QTest>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Tests;
|
||||
using namespace GenericProjectManager;
|
||||
using namespace GenericProjectManager::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace {
|
||||
|
||||
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
|
||||
inline QString sourceProjectPath(const QString &project)
|
||||
{
|
||||
const QString fileName(_(SRCDIR "/../../../tests/genericprojectmanager/") + project);
|
||||
return QFileInfo(fileName).absoluteFilePath();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
void GenericProjectPlugin::test_simple()
|
||||
{
|
||||
Tests::VerifyCleanCppModelManager verify;
|
||||
|
||||
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_simpleproject")));
|
||||
QVERIFY(temporaryDir.isValid());
|
||||
const QString mainFile = temporaryDir.absolutePath("main.cpp");
|
||||
const QString projectFile = temporaryDir.absolutePath("simpleproject.creator");
|
||||
|
||||
ProjectOpenerAndCloser projects;
|
||||
const ProjectInfo pInfo = projects.open(projectFile);
|
||||
QVERIFY(pInfo.isValid());
|
||||
QCOMPARE(pInfo.projectParts().size(), 1);
|
||||
|
||||
ProjectPart::Ptr pPart = pInfo.projectParts().first();
|
||||
QVERIFY(pPart);
|
||||
QCOMPARE(pPart->files.size(), 1);
|
||||
QCOMPARE(pPart->files.first().path, mainFile);
|
||||
QCOMPARE(pPart->files.first().kind, ProjectFile::CXXSource);
|
||||
}
|
||||
|
||||
static QStringList simplify(const ProjectFiles &files, const QString &prefix)
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
foreach (const ProjectFile &file, files) {
|
||||
if (file.path.startsWith(prefix))
|
||||
result.append(file.path.mid(prefix.size()));
|
||||
else
|
||||
result.append(file.path);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void GenericProjectPlugin::test_mixed1()
|
||||
{
|
||||
Tests::VerifyCleanCppModelManager verify;
|
||||
|
||||
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_mixedproject1/")));
|
||||
QVERIFY(temporaryDir.isValid());
|
||||
const QString projectFile = temporaryDir.absolutePath("mixedproject1.creator");
|
||||
|
||||
ProjectOpenerAndCloser projects;
|
||||
const ProjectInfo pInfo = projects.open(projectFile);
|
||||
QVERIFY(pInfo.isValid());
|
||||
QCOMPARE(pInfo.projectParts().size(), 3);
|
||||
|
||||
QVector<ProjectPart::Ptr> parts = pInfo.projectParts();
|
||||
std::sort(parts.begin(), parts.end(), [](const ProjectPart::Ptr &p1,
|
||||
const ProjectPart::Ptr &p2) {
|
||||
return p1->displayName < p2->displayName;
|
||||
});
|
||||
|
||||
const QString dirPathWithSlash = temporaryDir.path() + QLatin1Char('/');
|
||||
const QStringList part0files = simplify(parts[0]->files, dirPathWithSlash);
|
||||
const QStringList part1files = simplify(parts[1]->files, dirPathWithSlash);
|
||||
const QStringList part2files = simplify(parts[2]->files, dirPathWithSlash);
|
||||
|
||||
QCOMPARE(parts[0]->displayName, _("mixedproject1 (C++)"));
|
||||
QCOMPARE(parts[0]->files.size(), 4);
|
||||
QVERIFY(part0files.contains(_("main.cpp")));
|
||||
QVERIFY(part0files.contains(_("header.h")));
|
||||
QVERIFY(part0files.contains(_("MyViewController.h")));
|
||||
QVERIFY(part0files.contains(_("Glue.h")));
|
||||
|
||||
QCOMPARE(parts[1]->displayName, _("mixedproject1 (Obj-C)"));
|
||||
QCOMPARE(parts[1]->files.size(), 4);
|
||||
QVERIFY(part1files.contains(_("MyViewController.m")));
|
||||
QVERIFY(part1files.contains(_("header.h")));
|
||||
QVERIFY(part1files.contains(_("MyViewController.h")));
|
||||
QVERIFY(part1files.contains(_("Glue.h")));
|
||||
|
||||
QCOMPARE(parts[2]->displayName, _("mixedproject1 (Obj-C++)"));
|
||||
QCOMPARE(parts[2]->files.size(), 4);
|
||||
QVERIFY(part2files.contains(_("Glue.mm")));
|
||||
QVERIFY(part2files.contains(_("header.h")));
|
||||
QVERIFY(part2files.contains(_("MyViewController.h")));
|
||||
QVERIFY(part2files.contains(_("Glue.h")));
|
||||
}
|
||||
|
||||
void GenericProjectPlugin::test_mixed2()
|
||||
{
|
||||
Tests::VerifyCleanCppModelManager verify;
|
||||
|
||||
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_mixedproject2/")));
|
||||
QVERIFY(temporaryDir.isValid());
|
||||
const QString projectFile = temporaryDir.absolutePath("mixedproject2.creator");
|
||||
|
||||
ProjectOpenerAndCloser projects;
|
||||
const ProjectInfo pInfo = projects.open(projectFile);
|
||||
QVERIFY(pInfo.isValid());
|
||||
QCOMPARE(pInfo.projectParts().size(), 2);
|
||||
|
||||
QVector<ProjectPart::Ptr> parts = pInfo.projectParts();
|
||||
std::sort(parts.begin(), parts.end(), [](const ProjectPart::Ptr &p1,
|
||||
const ProjectPart::Ptr &p2) {
|
||||
return p1->displayName < p2->displayName;
|
||||
});
|
||||
|
||||
const QString dirPathWithSlash = temporaryDir.path() + QLatin1Char('/');
|
||||
const QStringList part0files = simplify(parts[0]->files, dirPathWithSlash);
|
||||
const QStringList part1files = simplify(parts[1]->files, dirPathWithSlash);
|
||||
|
||||
QCOMPARE(parts[0]->displayName, _("mixedproject2 (C)"));
|
||||
QCOMPARE(parts[0]->files.size(), 1);
|
||||
QVERIFY(part0files.contains(_("impl.c")));
|
||||
|
||||
QCOMPARE(parts[1]->displayName, _("mixedproject2 (C++)"));
|
||||
QCOMPARE(parts[1]->files.size(), 2);
|
||||
QVERIFY(part1files.contains(_("main.cpp")));
|
||||
QVERIFY(part1files.contains(_("header.hpp")));
|
||||
}
|
Reference in New Issue
Block a user