From 63fe568b9b36de9a3ddd72da45ef193d7471224f Mon Sep 17 00:00:00 2001 From: Sergey Shambir Date: Mon, 4 Mar 2013 01:30:46 +0400 Subject: CppTools: improved languages support in ProjectPart Please, read blueprint here: http://qt-project.org/wiki/Blueprint-for-language-specs-system Removed feature from QbsProjectManager: it not longer splits project on separate C and C++ parts, because Qt version used only by clang parser (not native) and can be ignored for pure C and Objective-C without C++. Change-Id: I1c561f7f9f915cc6cb8579d19db74e8352f54c1e Reviewed-by: Erik Verbruggen Reviewed-by: Tobias Hunger Reviewed-by: Daniel Teske --- src/plugins/cpptools/cppmodelmanager_test.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/plugins/cpptools/cppmodelmanager_test.cpp') diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp index 338aa01d79..a5eb79914b 100644 --- a/src/plugins/cpptools/cppmodelmanager_test.cpp +++ b/src/plugins/cpptools/cppmodelmanager_test.cpp @@ -39,7 +39,8 @@ using namespace CppTools::Internal; typedef CPlusPlus::Document Document; typedef CPlusPlus::CppModelManagerInterface::ProjectInfo ProjectInfo; -typedef CPlusPlus::CppModelManagerInterface::ProjectPart ProjectPart; +typedef CPlusPlus::ProjectPart ProjectPart; +typedef CPlusPlus::ProjectFile ProjectFile; typedef ProjectExplorer::Project Project; namespace { @@ -81,7 +82,7 @@ void CppToolsPlugin::test_modelmanager_paths() ProjectPart::Ptr part(new ProjectPart); pi.appendProjectPart(part); - part->language = ProjectPart::CXX; + part->cxxVersion = ProjectPart::CXX98; part->qtVersion = ProjectPart::Qt5; part->defines = QByteArray("#define OH_BEHAVE -1\n"); part->includePaths = QStringList() << testIncludeDir(false); @@ -109,19 +110,20 @@ void CppToolsPlugin::test_modelmanager_framework_headers() ProjectPart::Ptr part(new ProjectPart); pi.appendProjectPart(part); - part->language = ProjectPart::CXX; + part->cxxVersion = ProjectPart::CXX98; part->qtVersion = ProjectPart::Qt5; part->defines = QByteArray("#define OH_BEHAVE -1\n"); part->includePaths << testIncludeDir(); part->frameworkPaths << testFrameworksDir(); - part->sourceFiles << testSource(QLatin1String("test_modelmanager_framework_headers.cpp")); + const QString &source = testSource(QLatin1String("test_modelmanager_framework_headers.cpp")); + part->files << ProjectFile(source, ProjectFile::CXXSource); mm->updateProjectInfo(pi); - mm->updateSourceFiles(part->sourceFiles).waitForFinished(); + mm->updateSourceFiles(QStringList(source)).waitForFinished(); QCoreApplication::processEvents(); - QVERIFY(mm->snapshot().contains(part->sourceFiles.first())); - Document::Ptr doc = mm->snapshot().document(part->sourceFiles.first()); + QVERIFY(mm->snapshot().contains(source)); + Document::Ptr doc = mm->snapshot().document(source); QVERIFY(!doc.isNull()); CPlusPlus::Namespace *ns = doc->globalNamespace(); QVERIFY(ns); -- cgit v1.2.1