Merge remote-tracking branch 'origin/4.3'

Change-Id: I126f3a05212a3d5df78812e66285bc9e8078360b
This commit is contained in:
Orgad Shaneh
2017-06-20 11:30:21 +03:00
48 changed files with 3004 additions and 2039 deletions

View File

@@ -15,7 +15,6 @@ QtcProduct {
project.buildDirectory + '/' + qtc.ide_library_path,
project.buildDirectory + '/' + qtc.ide_plugin_path
]
cpp.minimumOsxVersion: "10.7"
cpp.defines: base.filter(function(d) { return d != "QT_RESTRICTED_CAST_FROM_ASCII"; })
Group {

View File

@@ -1,5 +1,6 @@
import qbs 1.0
import qbs.FileInfo
import qbs.Utilities
import QtcFunctions
Product {
@@ -19,9 +20,13 @@ Product {
Depends { name: "qtc" }
Depends { name: product.name + " dev headers"; required: false }
Properties {
condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0
cpp.minimumMacosVersion: "10.8"
}
cpp.cxxLanguageVersion: "c++14"
cpp.defines: qtc.generalDefines
cpp.minimumOsxVersion: "10.7"
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
cpp.visibility: "minimal"

View File

@@ -59,7 +59,7 @@ defineReplace(stripSrcDir) {
return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}
macos:!minQtVersion(5, 7, 0) {
darwin:!minQtVersion(5, 7, 0) {
# Qt 5.6 still sets deployment target 10.7, which does not work
# with all C++11/14 features (e.g. std::future)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8

View File

@@ -25,13 +25,14 @@
from dumper import *
def typeTarget(type):
target = type.target()
if target:
return target
return type
def stripTypeName(value):
type = value.type
try:
type = type.target()
except:
pass
return str(type.unqualified())
return typeTarget(value.type).unqualified().name
def extractPointerType(d, value):
postfix = ""
@@ -41,7 +42,7 @@ def extractPointerType(d, value):
try:
return readLiteral(d, value["_name"]) + postfix
except:
typeName = str(value.type.unqualified().target())
typeName = typeTarget(value.type.unqualified()).name
if typeName == "CPlusPlus::IntegerType":
return "int" + postfix
elif typeName == "CPlusPlus::VoidType":
@@ -67,20 +68,15 @@ def readTemplateName(d, value):
return name
def readLiteral(d, value):
if d.isNull(value):
if not value.integer():
return "<null>"
type = value.type.unqualified()
try:
type = type.target()
except:
pass
typestr = str(type)
if typestr == "CPlusPlus::TemplateNameId":
type = typeTarget(value.type.unqualified())
if type and (type.name == "CPlusPlus::TemplateNameId"):
return readTemplateName(d, value)
elif typestr == "CPlusPlus::QualifiedNameId":
elif type and (type.name == "CPlusPlus::QualifiedNameId"):
return readLiteral(d, value["_base"]) + "::" + readLiteral(d, value["_name"])
try:
return d.extractBlob(value["_chars"], value["_size"]).toString()
return bytes(d.readRawMemory(value["_chars"], value["_size"])).decode('latin1')
except:
return "<unsupported>"
@@ -118,7 +114,7 @@ def qdump__Debugger__Internal__WatchItem(d, value):
d.putPlainChildren(value)
def qdump__Debugger__Internal__BreakpointModelId(d, value):
d.putValue("%s.%s" % (int(value["m_majorPart"]), int(value["m_minorPart"])))
d.putValue("%s.%s" % (value["m_majorPart"].integer(), value["m_minorPart"].integer()))
d.putPlainChildren(value)
def qdump__Debugger__Internal__ThreadId(d, value):
@@ -130,7 +126,10 @@ def qdump__CPlusPlus__ByteArrayRef(d, value):
d.putPlainChildren(value)
def qdump__CPlusPlus__Identifier(d, value):
d.putSimpleCharArray(value["_chars"], value["_size"])
try:
d.putSimpleCharArray(value["_chars"], value["_size"])
except:
pass
d.putPlainChildren(value)
def qdump__CPlusPlus__Symbol(d, value):
@@ -202,8 +201,12 @@ def qdump__Utf8String(d, value):
def qdump__CPlusPlus__Token(d, value):
k = value["f"]["kind"]
e = int(k)
type = str(k.cast(d.lookupType("CPlusPlus::Kind")))[11:] # Strip "CPlusPlus::"
e = k.lvalue
if e:
kindType = d.lookupType("CPlusPlus::Kind")
type = kindType.typeData().enumDisplay(e, k.address())[11:]
else:
type = ''
try:
if e == 6:
type = readLiteral(d, value["identifier"]) + " (%s)" % type
@@ -216,8 +219,8 @@ def qdump__CPlusPlus__Token(d, value):
def qdump__CPlusPlus__Internal__PPToken(d, value):
data, size, alloc = d.byteArrayData(value["m_src"])
length = int(value["f"]["utf16chars"])
offset = int(value["utf16charOffset"])
length = value["f"]["utf16chars"].integer()
offset = value["utf16charOffset"].integer()
#warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s"
# % (size, alloc, offset, length, data))
d.putValue(d.readMemory(data + offset, min(100, length)), "latin1")
@@ -227,8 +230,8 @@ def qdump__ProString(d, value):
try:
s = value["m_string"]
data, size, alloc = d.stringData(s)
data += 2 * int(value["m_offset"])
size = int(value["m_length"])
data += 2 * value["m_offset"].integer()
size = value["m_length"].integer()
s = d.readMemory(data, 2 * size)
d.putValue(s, "utf16")
except:

File diff suppressed because it is too large Load Diff

View File

@@ -253,6 +253,6 @@
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<key>LSMinimumSystemVersion</key>
<string>10.7.0</string>
<string>10.8</string>
</dict>
</plist>

View File

@@ -38,7 +38,7 @@ win32 {
--app-icon qtcreator \
--output-partial-info-plist $$shell_quote($(TMPDIR)/qtcreator.Info.plist) \
--platform macosx \
--minimum-deployment-target 10.7 \
--minimum-deployment-target $$QMAKE_MACOSX_DEPLOYMENT_TARGET \
--compile $$shell_quote($$IDE_DATA_PATH) \
$$shell_quote($$PWD/qtcreator.xcassets) > /dev/null
ASSETCATALOG.input = ASSETCATALOG.files

View File

@@ -26,6 +26,7 @@
#include "environment.h"
#include "algorithm.h"
#include "qtcassert.h"
#include <QDir>
#include <QProcessEnvironment>
@@ -372,6 +373,7 @@ void Environment::modify(const QList<EnvironmentItem> & list)
} else {
// TODO use variable expansion
QString value = item.value;
int replaceCount = 0;
for (int i=0; i < value.size(); ++i) {
if (value.at(i) == '$') {
if ((i + 1) < value.size()) {
@@ -386,6 +388,8 @@ void Environment::modify(const QList<EnvironmentItem> & list)
Environment::const_iterator it = constFind(name);
if (it != constEnd())
value.replace(i, end-i+1, it.value());
++replaceCount;
QTC_ASSERT(replaceCount < 100, break);
}
}
}

View File

@@ -46,8 +46,8 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/coreconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildmanager.h>
#include <QAction>
#include <QMessageBox>
@@ -102,6 +102,7 @@ void AutotestPlugin::initializeMenuEntries()
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+A")));
connect(action, &QAction::triggered,
this, &AutotestPlugin::onRunAllTriggered);
action->setEnabled(false);
menu->addAction(command);
action = new QAction(tr("&Run Selected Tests"), this);
@@ -109,6 +110,7 @@ void AutotestPlugin::initializeMenuEntries()
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+R")));
connect(action, &QAction::triggered,
this, &AutotestPlugin::onRunSelectedTriggered);
action->setEnabled(false);
menu->addAction(command);
action = new QAction(tr("Re&scan Tests"), this);
@@ -121,7 +123,12 @@ void AutotestPlugin::initializeMenuEntries()
ActionContainer *toolsMenu = ActionManager::actionContainer(Core::Constants::M_TOOLS);
toolsMenu->addMenu(menu);
connect(toolsMenu->menu(), &QMenu::aboutToShow,
using namespace ProjectExplorer;
connect(BuildManager::instance(), &BuildManager::buildStateChanged,
this, &AutotestPlugin::updateMenuItemsEnabledState);
connect(BuildManager::instance(), &BuildManager::buildQueueFinished,
this, &AutotestPlugin::updateMenuItemsEnabledState);
connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
this, &AutotestPlugin::updateMenuItemsEnabledState);
}
@@ -176,7 +183,8 @@ void AutotestPlugin::onRunSelectedTriggered()
void AutotestPlugin::updateMenuItemsEnabledState()
{
const bool enabled = !TestRunner::instance()->isTestRunning()
const bool enabled = !ProjectExplorer::BuildManager::isBuilding()
&& !TestRunner::instance()->isTestRunning()
&& TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle;
const bool hasTests = TestTreeModel::instance()->hasTests();

View File

@@ -60,7 +60,7 @@ private:
void updateMenuItemsEnabledState();
QList<QObject *> createTestObjects() const override;
const QSharedPointer<TestSettings> m_settings;
TestFrameworkManager *m_frameworkManager = 0;
TestFrameworkManager *m_frameworkManager = nullptr;
};
} // namespace Internal

View File

@@ -104,6 +104,8 @@ TestConfiguration *GTestTreeItem::testConfiguration() const
default:
return nullptr;
}
if (config)
config->setInternalTargets(internalTargets());
return config;
}
@@ -124,6 +126,7 @@ QList<TestConfiguration *> GTestTreeItem::getAllTestConfigurations() const
return result;
QHash<QString, int> proFilesWithTestSets;
QHash<QString, QSet<QString> > proFilesWithInternalTargets;
for (int row = 0, count = childCount(); row < count; ++row) {
const GTestTreeItem *child = static_cast<const GTestTreeItem *>(childItem(row));
@@ -132,6 +135,7 @@ QList<TestConfiguration *> GTestTreeItem::getAllTestConfigurations() const
const TestTreeItem *grandChild = child->childItem(grandChildRow);
const QString &key = grandChild->proFile();
proFilesWithTestSets.insert(key, proFilesWithTestSets[key] + 1);
proFilesWithInternalTargets.insert(key, grandChild->internalTargets());
}
}
@@ -142,6 +146,7 @@ QList<TestConfiguration *> GTestTreeItem::getAllTestConfigurations() const
tc->setTestCaseCount(it.value());
tc->setProjectFile(it.key());
tc->setProject(project);
tc->setInternalTargets(proFilesWithInternalTargets.value(it.key()));
result << tc;
}
@@ -162,6 +167,7 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
return result;
QHash<QString, TestCases> proFilesWithCheckedTestSets;
QHash<QString, QSet<QString> > proFilesWithInternalTargets;
for (int row = 0, count = childCount(); row < count; ++row) {
const GTestTreeItem *child = static_cast<const GTestTreeItem *>(childItem(row));
@@ -175,6 +181,8 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
auto &testCases = proFilesWithCheckedTestSets[child->childItem(0)->proFile()];
testCases.filters.append(gtestFilter(child->state()).arg(child->name()).arg('*'));
testCases.additionalTestCaseCount += grandChildCount - 1;
proFilesWithInternalTargets.insert(child->childItem(0)->proFile(),
child->internalTargets());
break;
}
case Qt::PartiallyChecked: {
@@ -183,6 +191,8 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
if (grandChild->checked() == Qt::Checked) {
proFilesWithCheckedTestSets[grandChild->proFile()].filters.append(
gtestFilter(child->state()).arg(child->name()).arg(grandChild->name()));
proFilesWithInternalTargets.insert(grandChild->proFile(),
grandChild->internalTargets());
}
}
break;
@@ -198,6 +208,7 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
tc->setTestCaseCount(tc->testCaseCount() + it.value().additionalTestCaseCount);
tc->setProjectFile(it.key());
tc->setProject(project);
tc->setInternalTargets(proFilesWithInternalTargets[it.key()]);
result << tc;
}

View File

@@ -134,6 +134,8 @@ TestConfiguration *QtTestTreeItem::testConfiguration() const
default:
return nullptr;
}
if (config)
config->setInternalTargets(internalTargets());
return config;
}
@@ -160,6 +162,7 @@ QList<TestConfiguration *> QtTestTreeItem::getAllTestConfigurations() const
tc->setTestCaseCount(child->childCount());
tc->setProjectFile(child->proFile());
tc->setProject(project);
tc->setInternalTargets(child->internalTargets());
result << tc;
}
return result;
@@ -185,6 +188,7 @@ QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const
testConfiguration->setTestCaseCount(child->childCount());
testConfiguration->setProjectFile(child->proFile());
testConfiguration->setProject(project);
testConfiguration->setInternalTargets(child->internalTargets());
result << testConfiguration;
continue;
case Qt::PartiallyChecked:
@@ -210,6 +214,7 @@ QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const
testConfiguration->setTestCases(testCases);
testConfiguration->setProjectFile(child->proFile());
testConfiguration->setProject(project);
testConfiguration->setInternalTargets(child->internalTargets());
result << testConfiguration;
}
}

View File

@@ -36,6 +36,7 @@
#include <qmljs/qmljsdialect.h>
#include <qmljstools/qmljsmodelmanager.h>
#include <utils/hostosinfo.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
namespace Autotest {
@@ -238,6 +239,49 @@ bool QuickTestParser::handleQtQuickTest(QFutureInterface<TestParseResultPtr> fut
return result;
}
static QMap<QString, QDateTime> qmlFilesWithMTime(const QString &directory)
{
const QFileInfoList &qmlFiles = QDir(directory).entryInfoList({ "*.qml" },
QDir::Files, QDir::Name);
QMap<QString, QDateTime> filesAndDates;
for (const QFileInfo &info : qmlFiles)
filesAndDates.insert(info.fileName(), info.lastModified());
return filesAndDates;
}
void QuickTestParser::handleDirectoryChanged(const QString &directory)
{
const QMap<QString, QDateTime> &filesAndDates = qmlFilesWithMTime(directory);
const QMap<QString, QDateTime> &watched = m_watchedFiles.value(directory);
const QStringList &keys = watched.keys();
if (filesAndDates.keys() != keys) { // removed or added files
m_watchedFiles[directory] = filesAndDates;
TestTreeModel::instance()->parser()->emitUpdateTestTree(this);
} else { // we might still have different timestamps
const bool timestampChanged = Utils::anyOf(keys, [&](const QString &file) {
return filesAndDates.value(file) != watched.value(file);
});
if (timestampChanged) {
QmlJS::PathsAndLanguages paths;
paths.maybeInsert(Utils::FileName::fromString(directory), QmlJS::Dialect::Qml);
QFutureInterface<void> future;
QmlJS::ModelManagerInterface *qmlJsMM = QmlJS::ModelManagerInterface::instance();
QmlJS::ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM,
true /*emitDocumentChanges*/,
false /*onlyTheLib*/,
true /*forceRescan*/ );
}
}
}
void QuickTestParser::doUpdateWatchPaths(const QStringList &directories)
{
for (const QString &dir : directories) {
m_directoryWatcher.addPath(dir);
m_watchedFiles[dir] = qmlFilesWithMTime(dir);
}
}
QuickTestParser::QuickTestParser()
: CppParser()
{
@@ -246,11 +290,12 @@ QuickTestParser::QuickTestParser()
const QStringList &dirs = m_directoryWatcher.directories();
if (!dirs.isEmpty())
m_directoryWatcher.removePaths(dirs);
m_watchedFiles.clear();
});
connect(&m_directoryWatcher, &QFileSystemWatcher::directoryChanged,
[this] { TestTreeModel::instance()->parser()->emitUpdateTestTree(this); });
this, &QuickTestParser::handleDirectoryChanged);
connect(this, &QuickTestParser::updateWatchPaths,
&m_directoryWatcher, &QFileSystemWatcher::addPaths, Qt::QueuedConnection);
this, &QuickTestParser::doUpdateWatchPaths, Qt::QueuedConnection);
}
QuickTestParser::~QuickTestParser()

View File

@@ -56,10 +56,13 @@ signals:
private:
bool handleQtQuickTest(QFutureInterface<TestParseResultPtr> futureInterface,
CPlusPlus::Document::Ptr document, const Core::Id &id) const;
void handleDirectoryChanged(const QString &directory);
void doUpdateWatchPaths(const QStringList &directories);
QList<QmlJS::Document::Ptr> scanDirectoryForQuickTestQmlFiles(const QString &srcDir) const;
QmlJS::Snapshot m_qmlSnapshot;
QHash<QString, QString> m_proFilesForQmlFiles;
QFileSystemWatcher m_directoryWatcher;
QMap<QString, QMap<QString, QDateTime> > m_watchedFiles;
};
} // namespace Internal

View File

@@ -27,6 +27,7 @@
#include "quicktestconfiguration.h"
#include "quicktestparser.h"
#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/session.h>
#include <utils/qtcassert.h>
@@ -138,6 +139,8 @@ TestConfiguration *QuickTestTreeItem::testConfiguration() const
default:
return nullptr;
}
if (config)
config->setInternalTargets(internalTargets());
return config;
}
@@ -150,6 +153,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
return result;
QHash<QString, int> foundProFiles;
QHash<QString, QSet<QString> > proFilesWithTargets;
for (int row = 0, count = childCount(); row < count; ++row) {
const TestTreeItem *child = childItem(row);
// unnamed Quick Tests must be handled separately
@@ -158,12 +162,14 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
const TestTreeItem *grandChild = child->childItem(childRow);
const QString &proFile = grandChild->proFile();
foundProFiles.insert(proFile, foundProFiles[proFile] + 1);
proFilesWithTargets.insert(proFile, grandChild->internalTargets());
}
continue;
}
// named Quick Test
const QString &proFile = child->proFile();
foundProFiles.insert(proFile, foundProFiles[proFile] + child->childCount());
proFilesWithTargets.insert(proFile, child->internalTargets());
}
// create TestConfiguration for each project file
QHash<QString, int>::ConstIterator it = foundProFiles.begin();
@@ -173,6 +179,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
tc->setTestCaseCount(it.value());
tc->setProjectFile(it.key());
tc->setProject(project);
tc->setInternalTargets(proFilesWithTargets[it.key()]);
result << tc;
}
return result;
@@ -203,6 +210,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co
tc->setUnnamedOnly(true);
tc->setProjectFile(proFile);
tc->setProject(project);
tc->setInternalTargets(grandChild->internalTargets());
foundProFiles.insert(proFile, tc);
}
}
@@ -246,6 +254,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co
tc->setTestCases(testFunctions);
tc->setProjectFile(child->proFile());
tc->setProject(project);
tc->setInternalTargets(child->internalTargets());
foundProFiles.insert(child->proFile(), tc);
}
break;
@@ -306,6 +315,20 @@ bool QuickTestTreeItem::lessThan(const TestTreeItem *other, TestTreeItem::SortMo
return TestTreeItem::lessThan(other, mode);
}
QSet<QString> QuickTestTreeItem::internalTargets() const
{
QSet<QString> result;
const auto cppMM = CppTools::CppModelManager::instance();
const auto projectInfo = cppMM->projectInfo(ProjectExplorer::SessionManager::startupProject());
for (const CppTools::ProjectPart::Ptr projectPart : projectInfo.projectParts()) {
if (projectPart->projectFile == proFile()) {
result.insert(projectPart->buildSystemTarget);
break;
}
}
return result;
}
TestTreeItem *QuickTestTreeItem::unnamedQuickTests() const
{
if (type() != Root)

View File

@@ -45,7 +45,7 @@ public:
TestTreeItem *find(const TestParseResult *result) override;
bool modify(const TestParseResult *result) override;
bool lessThan(const TestTreeItem *other, SortMode mode) const override;
QSet<QString> internalTargets() const override;
private:
TestTreeItem *unnamedQuickTests() const;
};

View File

@@ -64,6 +64,7 @@ static bool isLocal(RunConfiguration *runConfiguration)
void TestConfiguration::completeTestInformation(int runMode)
{
QTC_ASSERT(!m_projectFile.isEmpty(), return);
QTC_ASSERT(!m_buildTargets.isEmpty(), return);
Project *project = SessionManager::startupProject();
if (!project)
@@ -73,23 +74,16 @@ void TestConfiguration::completeTestInformation(int runMode)
if (!target)
return;
const auto cppMM = CppTools::CppModelManager::instance();
const QVector<CppTools::ProjectPart::Ptr> projectParts = cppMM->projectInfo(project).projectParts();
const QVector<CppTools::ProjectPart::Ptr> relevantParts
= Utils::filtered(projectParts, [this] (const CppTools::ProjectPart::Ptr &part) {
return part->selectedForBuilding && part->projectFile == m_projectFile;
});
const QSet<QString> buildSystemTargets
= Utils::transform<QSet>(relevantParts, [] (const CppTools::ProjectPart::Ptr &part) {
return part->buildSystemTarget;
});
const Utils::FileName fn = Utils::FileName::fromString(m_projectFile);
const QSet<QString> buildSystemTargets = m_buildTargets;
const BuildTargetInfo targetInfo
= Utils::findOrDefault(target->applicationTargets().list,
[&buildSystemTargets, &fn] (const BuildTargetInfo &bti) {
return Utils::anyOf(buildSystemTargets, [&fn, &bti](const QString &b) {
return b == bti.targetName || (b.contains(bti.targetName) && bti.projectFilePath == fn);
[&buildSystemTargets] (const BuildTargetInfo &bti) {
return Utils::anyOf(buildSystemTargets, [&bti](const QString &b) {
const QStringList targWithProjectFile = b.split('|');
if (targWithProjectFile.size() != 2) // some build targets might miss the project file
return false;
return targWithProjectFile.at(0) == bti.targetName
&& targWithProjectFile.at(1).startsWith(bti.projectFilePath.toString());
});
});
const Utils::FileName executable = targetInfo.targetFilePath; // empty if BTI is default created
@@ -97,7 +91,8 @@ void TestConfiguration::completeTestInformation(int runMode)
if (!isLocal(runConfig)) // TODO add device support
continue;
if (buildSystemTargets.contains(runConfig->buildSystemTarget())) {
const QString bst = runConfig->buildSystemTarget() + '|' + m_projectFile;
if (buildSystemTargets.contains(bst)) {
Runnable runnable = runConfig->runnable();
if (!runnable.is<StandardRunnable>())
continue;
@@ -146,7 +141,7 @@ void TestConfiguration::completeTestInformation(int runMode)
}
if (m_displayName.isEmpty()) // happens e.g. when guessing the TestConfiguration or error
m_displayName = buildSystemTargets.isEmpty() ? "unknown" : *buildSystemTargets.begin();
m_displayName = buildSystemTargets.isEmpty() ? "unknown" : (*buildSystemTargets.begin()).split('|').first();
}
/**
@@ -204,6 +199,11 @@ void TestConfiguration::setProject(Project *project)
m_project = project;
}
void TestConfiguration::setInternalTargets(const QSet<QString> &targets)
{
m_buildTargets = targets;
}
QString TestConfiguration::executableFilePath() const
{
if (m_executableFile.isEmpty())

View File

@@ -66,6 +66,7 @@ public:
void setDisplayName(const QString &displayName);
void setEnvironment(const Utils::Environment &env);
void setProject(ProjectExplorer::Project *project);
void setInternalTargets(const QSet<QString> &targets);
QStringList testCases() const { return m_testCases; }
int testCaseCount() const { return m_testCaseCount; }
@@ -97,6 +98,7 @@ private:
QPointer<ProjectExplorer::Project> m_project;
bool m_guessedConfiguration = false;
TestRunConfiguration *m_runConfig = 0;
QSet<QString> m_buildTargets;
};
class DebuggableTestConfiguration : public TestConfiguration

View File

@@ -42,6 +42,7 @@
#include <utils/progressindicator.h>
#include <utils/utilsicons.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <projectexplorer/buildmanager.h>
#include <QAction>
#include <QMenu>
@@ -113,7 +114,8 @@ TestNavigationWidget::~TestNavigationWidget()
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
{
const bool enabled = !TestRunner::instance()->isTestRunning()
const bool enabled = !ProjectExplorer::BuildManager::isBuilding()
&& !TestRunner::instance()->isTestRunning()
&& m_model->parser()->state() == TestCodeParser::Idle;
const bool hasTests = m_model->hasTests();
@@ -170,8 +172,6 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll);
connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll);
runAll->setEnabled(enabled && hasTests);
runSelected->setEnabled(enabled && hasTests);
selectAll->setEnabled(enabled && hasTests);
deselectAll->setEnabled(enabled && hasTests);
rescan->setEnabled(enabled);

View File

@@ -34,12 +34,14 @@
#include "testcodeparser.h"
#include <aggregation/aggregate.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/find/basetextfind.h>
#include <coreplugin/find/itemviewfind.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/texteditor.h>
#include <utils/theme/theme.h>
@@ -511,7 +513,9 @@ void TestResultsPane::onTestRunStarted()
m_testRunning = true;
m_stopTestRun->setEnabled(true);
m_runAll->setEnabled(false);
Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(false);
m_runSelected->setEnabled(false);
Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(false);
m_summaryWidget->setVisible(false);
}
@@ -519,8 +523,14 @@ void TestResultsPane::onTestRunFinished()
{
m_testRunning = false;
m_stopTestRun->setEnabled(false);
m_runAll->setEnabled(true);
m_runSelected->setEnabled(true);
const bool runEnabled = !ProjectExplorer::BuildManager::isBuilding()
&& TestTreeModel::instance()->hasTests()
&& TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle;
m_runAll->setEnabled(runEnabled); // TODO unify Run* actions
Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(runEnabled);
m_runSelected->setEnabled(runEnabled);
Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(runEnabled);
updateSummaryLabel();
m_summaryWidget->setVisible(true);
m_model->removeCurrentTestMessage();
@@ -541,6 +551,7 @@ void TestResultsPane::updateRunActions()
QString whyNot;
TestTreeModel *model = TestTreeModel::instance();
const bool enable = !m_testRunning && !model->parser()->isParsing() && model->hasTests()
&& !ProjectExplorer::BuildManager::isBuilding()
&& ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject(
ProjectExplorer::Constants::NORMAL_RUN_MODE, &whyNot);
m_runAll->setEnabled(enable);

View File

@@ -29,6 +29,7 @@
#include "testtreeitem.h"
#include <cplusplus/Icons.h>
#include <cpptools/cppmodelmanager.h>
#include <texteditor/texteditor.h>
#include <QIcon>
@@ -281,6 +282,16 @@ bool TestTreeItem::lessThan(const TestTreeItem *other, SortMode mode) const
}
}
QSet<QString> TestTreeItem::internalTargets() const
{
auto cppMM = CppTools::CppModelManager::instance();
const QList<CppTools::ProjectPart::Ptr> projectParts = cppMM->projectPart(filePath());
QSet<QString> targets;
for (const CppTools::ProjectPart::Ptr part : projectParts)
targets.insert(part->buildSystemTarget);
return targets;
}
void TestTreeItem::revalidateCheckState()
{
const Type ttiType = type();

View File

@@ -110,6 +110,7 @@ public:
virtual TestTreeItem *find(const TestParseResult *result) = 0;
virtual bool modify(const TestParseResult *result) = 0;
virtual QSet<QString> internalTargets() const;
protected:
typedef std::function<bool(const TestTreeItem *)> CompareFunction;
TestTreeItem *findChildBy(CompareFunction compare) const;

View File

@@ -119,7 +119,7 @@ Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString
void AutotoolsProject::loadProjectTree()
{
if (m_makefileParserThread != 0) {
if (m_makefileParserThread) {
// The thread is still busy parsing a previus configuration.
// Wait until the thread has been finished and delete it.
// TODO: Discuss whether blocking is acceptable.
@@ -162,7 +162,7 @@ void AutotoolsProject::makefileParsingFinished()
// The parsing has been cancelled by the user. Don't show any
// project data at all.
m_makefileParserThread->deleteLater();
m_makefileParserThread = 0;
m_makefileParserThread = nullptr;
return;
}
@@ -179,7 +179,7 @@ void AutotoolsProject::makefileParsingFinished()
// Apply sources to m_files, which are returned at AutotoolsProject::files()
const QFileInfo fileInfo = projectFilePath().toFileInfo();
const QDir dir = fileInfo.absoluteDir();
QStringList files = m_makefileParserThread->sources();
const QStringList files = m_makefileParserThread->sources();
foreach (const QString& file, files)
m_files.append(dir.absoluteFilePath(file));
@@ -187,35 +187,36 @@ void AutotoolsProject::makefileParsingFinished()
// has been changed, the project tree must be reparsed.
const QStringList makefiles = m_makefileParserThread->makefiles();
foreach (const QString &makefile, makefiles) {
files.append(makefile);
const QString absMakefile = dir.absoluteFilePath(makefile);
const QString watchedFile = dir.absoluteFilePath(makefile);
m_fileWatcher->addFile(watchedFile, Utils::FileSystemWatcher::WatchAllChanges);
m_watchedFiles.append(watchedFile);
m_files.append(absMakefile);
m_fileWatcher->addFile(absMakefile, Utils::FileSystemWatcher::WatchAllChanges);
m_watchedFiles.append(absMakefile);
}
// Add configure.ac file to project and watch for changes.
const QLatin1String configureAc(QLatin1String("configure.ac"));
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
if (configureAcFile.exists()) {
files.append(configureAc);
const QString configureAcFilePath = dir.absoluteFilePath(configureAc);
m_fileWatcher->addFile(configureAcFilePath, Utils::FileSystemWatcher::WatchAllChanges);
m_watchedFiles.append(configureAcFilePath);
const QString absConfigureAc = dir.absoluteFilePath(configureAc);
m_files.append(absConfigureAc);
m_fileWatcher->addFile(absConfigureAc, Utils::FileSystemWatcher::WatchAllChanges);
m_watchedFiles.append(absConfigureAc);
}
auto newRoot = new AutotoolsProjectNode(projectDirectory());
for (const QString &f : files) {
const Utils::FileName path = Utils::FileName::fromString(dir.absoluteFilePath(f));
FileType ft = (f == "Makefile.am" || f == "configure.ac") ? FileType::Project : FileType::Resource;
newRoot->addNestedNode(new FileNode(path, ft, false));
for (const QString &f : m_files) {
const Utils::FileName path = Utils::FileName::fromString(f);
newRoot->addNestedNode(new FileNode(path, FileNode::fileTypeForFileName(path), false));
}
setRootProjectNode(newRoot);
updateCppCodeModel();
m_makefileParserThread->deleteLater();
m_makefileParserThread = 0;
m_makefileParserThread = nullptr;
emit parsingFinished();
}

View File

@@ -334,6 +334,8 @@ QList<CMakeBuildTarget> BuildDirManager::buildTargets() const
m_buildTargets.append(utilityTarget(CMakeBuildStep::allTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::cleanTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::installTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::testTarget(), this));
m_buildTargets.append(m_reader->buildTargets());
}
return m_buildTargets;

View File

@@ -404,9 +404,14 @@ QString CMakeBuildStep::installTarget()
return QString("install");
}
QString CMakeBuildStep::testTarget()
{
return QString("test");
}
QStringList CMakeBuildStep::specialTargets()
{
return { allTarget(), cleanTarget(), installTarget() };
return { allTarget(), cleanTarget(), installTarget(), testTarget() };
}
//

View File

@@ -80,6 +80,7 @@ public:
static QString cleanTarget();
static QString allTarget();
static QString installTarget();
static QString testTarget();
static QStringList specialTargets();
signals:

View File

@@ -498,8 +498,10 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType)
deploymentData.addFile(ct.executable.toString(), deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()), DeployableFile::TypeExecutable);
if (ct.targetType == ExecutableType) {
FileName srcWithTrailingSlash = FileName::fromString(ct.sourceDirectory.toString());
srcWithTrailingSlash.appendString('/');
// TODO: Put a path to corresponding .cbp file into projectFilePath?
appTargetList.list << BuildTargetInfo(ct.title, ct.executable, ct.executable);
appTargetList.list << BuildTargetInfo(ct.title, ct.executable, srcWithTrailingSlash);
}
}

View File

@@ -247,7 +247,7 @@ RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, Core::I
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
const QString title(buildTargetFromId(id));
const CMakeBuildTarget &ct = project->buildTargetForTitle(title);
return new CMakeRunConfiguration(parent, id, ct.executable.toString(), ct.workingDirectory, ct.title);
return new CMakeRunConfiguration(parent, id, title, ct.workingDirectory, ct.title);
}
bool CMakeRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
@@ -274,7 +274,8 @@ bool CMakeRunConfigurationFactory::canRestore(Target *parent, const QVariantMap
RunConfiguration *CMakeRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{
return new CMakeRunConfiguration(parent, idFromMap(map), QString(), Utils::FileName(), QString());
const Core::Id id = idFromMap(map);
return new CMakeRunConfiguration(parent, id, buildTargetFromId(id), Utils::FileName(), QString());
}
QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id)

View File

@@ -316,7 +316,7 @@ void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps)
CppTools::RawProjectPart rpp;
rpp.setProjectFileLocation(fg->target->sourceDirectory.toString() + "/CMakeLists.txt");
rpp.setBuildSystemTarget(fg->target->name);
rpp.setBuildSystemTarget(fg->target->name + '|' + rpp.projectFile);
rpp.setDisplayName(fg->target->name + QString::number(counter));
rpp.setDefines(defineArg.toUtf8());
rpp.setIncludePaths(includes);

View File

@@ -367,7 +367,7 @@ void TeaLeafReader::updateCodeModel(CppTools::RawProjectParts &rpps)
includePaths += m_parameters.buildDirectory.toString();
CppTools::RawProjectPart rpp;
rpp.setProjectFileLocation(QString()); // No project file information available!
rpp.setBuildSystemTarget(cbt.title);
rpp.setBuildSystemTarget(cbt.title + '|');
rpp.setIncludePaths(includePaths);
CppTools::RawProjectPartFlags cProjectFlags;

View File

@@ -94,21 +94,6 @@ public:
return nullptr;
}
VcsInfo *findUpInCache(const QString &directory)
{
VcsInfo *result = nullptr;
const QChar slash = QLatin1Char('/');
// Split the path, trying to find the matching repository. We start from the reverse
// in order to detected nested repositories correctly (say, a git checkout under SVN).
for (int pos = directory.size() - 1; pos >= 0; pos = directory.lastIndexOf(slash, pos) - 1) {
const QString directoryPart = directory.left(pos);
result = findInCache(directoryPart);
if (result)
break;
}
return result;
}
void clearCache()
{
m_cachedMatches.clear();

View File

@@ -588,7 +588,8 @@ public:
for (Scope::iterator it = clazz->memberBegin(); it != clazz->memberEnd(); ++it) {
if (const Function *func = (*it)->type()->asFunctionType()) {
// Filter virtual destructors
if (func->name()->asDestructorNameId())
const Name *name = func->name();
if (!name || name->asDestructorNameId())
continue;
const Function *firstVirtual = 0;

View File

@@ -393,7 +393,7 @@ void CompilerOptionsBuilder::addDefineFloat128ForMingw()
// CLANG-UPGRADE-CHECK: Workaround still needed?
// https://llvm.org/bugs/show_bug.cgi?id=30685
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
addDefine("#define __float128 void");
addDefine("#define __float128 short");
}
QString CompilerOptionsBuilder::includeDirOption() const

View File

@@ -27,6 +27,10 @@
#include "projectexplorer_export.h"
#include <QString>
#include <functional>
namespace Utils {
class FileName;
class MimeType;

View File

@@ -454,7 +454,7 @@ QList<ProjectExplorer::RunConfiguration *> QbsProductNode::runConfigurations() c
QbsRunConfiguration *qbsRc = qobject_cast<QbsRunConfiguration *>(rc);
if (!qbsRc)
continue;
if (qbsRc->buildSystemTarget() == QbsProject::uniqueProductName(qbsProductData()))
if (qbsRc->uniqueProductName() == QbsProject::uniqueProductName(qbsProductData()))
result << qbsRc;
}

View File

@@ -161,6 +161,8 @@ QbsProject::~QbsProject()
m_qbsUpdateFutureInterface = 0;
}
qDeleteAll(m_extraCompilers);
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
[](Core::IDocument *doc) { doc->deleteLater(); });
}
QbsRootProjectNode *QbsProject::rootProjectNode() const
@@ -974,7 +976,7 @@ void QbsProject::updateCppCodeModel()
rpp.setDisplayName(grp.name());
rpp.setProjectFileLocation(grp.location().filePath(),
grp.location().line(), grp.location().column());
rpp.setBuildSystemTarget(uniqueProductName(prd));
rpp.setBuildSystemTarget(prd.name() + '|' + rpp.projectFile);
QHash<QString, qbs::ArtifactData> filePathToSourceArtifact;
bool hasCFiles = false;

View File

@@ -300,6 +300,11 @@ void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
}
QString QbsRunConfiguration::buildSystemTarget() const
{
return productDisplayNameFromId(id());
}
QString QbsRunConfiguration::uniqueProductName() const
{
return m_uniqueProductName;
}

View File

@@ -76,6 +76,7 @@ public:
void addToBaseEnvironment(Utils::Environment &env) const;
QString buildSystemTarget() const final;
QString uniqueProductName() const;
bool isConsoleApplication() const;
signals:

View File

@@ -287,7 +287,7 @@ void QmakeProject::updateCppCodeModel()
CppTools::RawProjectPart rpp;
rpp.setDisplayName(pro->displayName());
rpp.setProjectFileLocation(pro->filePath().toString());
rpp.setBuildSystemTarget(pro->targetInformation().target);
rpp.setBuildSystemTarget(pro->targetInformation().target + '|' + rpp.projectFile);
// TODO: Handle QMAKE_CFLAGS
rpp.setFlagsForCxx({cxxToolChain, pro->variableValue(Variable::CppFlags)});
rpp.setDefines(pro->cxxDefines());

View File

@@ -95,13 +95,22 @@ void QmakeManager::addLibrary()
void QmakeManager::addLibraryContextMenu()
{
QString projectPath;
Node *node = contextNode();
if (dynamic_cast<QmakeProFileNode *>(node))
addLibraryImpl(node->filePath().toString(), nullptr);
if (ContainerNode *cn = node->asContainerNode())
projectPath = cn->project()->projectFilePath().toString();
else if (dynamic_cast<QmakeProFileNode *>(node))
projectPath = node->filePath().toString();
addLibraryImpl(projectPath, nullptr);
}
void QmakeManager::addLibraryImpl(const QString &fileName, BaseTextEditor *editor)
{
if (fileName.isEmpty())
return;
Internal::AddLibraryWizard wizard(fileName, Core::ICore::dialogParent());
if (wizard.exec() != QDialog::Accepted)
return;

View File

@@ -225,19 +225,18 @@ bool QMakeStep::init(QList<const BuildStep *> &earlierSteps)
m_makeArguments.clear();
}
QString makefile = workingDirectory;
QString makefile = workingDirectory + '/';
if (qmakeBc->subNodeBuild()) {
QmakeProFile *pro = qmakeBc->subNodeBuild()->proFile();
if (pro && !pro->makefile().isEmpty())
makefile.append(pro->makefile());
else
makefile.append(QLatin1String("/Makefile"));
makefile.append("Makefile");
} else if (!qmakeBc->makefile().isEmpty()) {
makefile.append(QLatin1Char('/'));
makefile.append(qmakeBc->makefile());
} else {
makefile.append(QLatin1String("/Makefile"));
makefile.append("Makefile");
}
// Check whether we need to run qmake

View File

@@ -213,6 +213,7 @@ bool UpdateInfoPlugin::initialize(const QStringList & /* arguments */, QString *
addAutoReleasedObject(new SettingsPage(this));
QAction *checkForUpdatesAction = new QAction(tr("Check for Updates"), this);
checkForUpdatesAction->setMenuRole(QAction::ApplicationSpecificRole);
Core::Command *checkForUpdatesCommand = Core::ActionManager::registerAction(checkForUpdatesAction, "Updates.CheckForUpdates");
connect(checkForUpdatesAction, &QAction::triggered, this, &UpdateInfoPlugin::startCheckForUpdates);
ActionContainer *const helpContainer = ActionManager::actionContainer(Core::Constants::M_HELP);

View File

@@ -50,6 +50,7 @@
#include <texteditor/texteditorsettings.h>
#include <projectexplorer/project.h>
#include <projectexplorer/session.h>
#include <QDir>
#include <QFileInfo>
@@ -722,22 +723,10 @@ QIcon VcsBaseSubmitEditor::submitIcon()
void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory,
QStringList *untrackedFiles)
{
if (untrackedFiles->empty())
return;
ProjectExplorer::Project *vcsProject = VcsProjectCache::projectFor(repositoryDirectory);
if (!vcsProject)
return;
const QSet<QString> projectFiles
= QSet<QString>::fromList(vcsProject->files(ProjectExplorer::Project::SourceFiles));
if (projectFiles.empty())
return;
const QDir repoDir(repositoryDirectory);
for (QStringList::iterator it = untrackedFiles->begin(); it != untrackedFiles->end(); ) {
const QString path = repoDir.absoluteFilePath(*it);
if (projectFiles.contains(path))
if (ProjectExplorer::SessionManager::projectForFile(FileName::fromString(path)))
++it;
else
it = untrackedFiles->erase(it);

View File

@@ -48,6 +48,7 @@
#include <QHeaderView>
#include <QLabel>
#include <QMouseEvent>
#include <QOpenGLWidget>
#include <QPainter>
#include <QStackedWidget>
#include <QTimer>
@@ -310,6 +311,12 @@ WelcomeMode::WelcomeMode()
layout->addWidget(new StyledBar(m_modeWidget));
layout->addItem(hbox);
if (Utils::HostOsInfo::isMacHost()) { // workaround QTBUG-61384
auto openglWidget = new QOpenGLWidget;
openglWidget->hide();
layout->addWidget(openglWidget);
}
setWidget(m_modeWidget);
}

View File

@@ -57,6 +57,8 @@
#include <QDir>
#include <QFile>
#include <QProcess>
#include <QRegularExpression>
#include <QVersionNumber>
#ifdef MOBILE_DEV_DIRECT_LINK
#include "MobileDevice.h"
@@ -259,6 +261,100 @@ static QString mobileDeviceErrorString(MobileDeviceLib *lib, am_res_t code)
return s;
}
qint64 toBuildNumber(const QString &versionStr)
{
QString buildNumber;
const QRegularExpression re("\\s\\((\\X+)\\)");
const QRegularExpressionMatch m = re.match(versionStr);
if (m.hasMatch())
buildNumber = m.captured(1);
return buildNumber.toLongLong(nullptr, 16);
}
static bool findXcodePath(QString *xcodePath)
{
if (!xcodePath)
return false;
QProcess process;
process.start("/bin/bash", QStringList({"-c", "xcode-select -p"}));
if (!process.waitForFinished(3000))
return false;
*xcodePath = QString::fromLatin1(process.readAllStandardOutput()).trimmed();
return (process.exitStatus() == QProcess::NormalExit && QFile::exists(*xcodePath));
}
/*!
* \brief Finds the \e DeveloperDiskImage.dmg path corresponding to \a versionStr and \a buildStr.
*
* The algorithm sorts the \e DeviceSupport directories with decreasing order of their version and
* build number to find the appropriate \e DeviceSupport directory corresponding to \a versionStr
* and \a buildStr. Directories starting with major build number of \a versionStr are considered
* only, rest are filtered out.
*
* Returns \c true if \e DeveloperDiskImage.dmg is found, otherwise returns \c false. The absolute
* path to the \e DeveloperDiskImage.dmg is enumerated in \a path.
*/
static bool findDeveloperDiskImage(const QString &versionStr, const QString &buildStr,
QString *path = nullptr)
{
const QVersionNumber deviceVersion = QVersionNumber::fromString(versionStr);
if (deviceVersion.isNull())
return false;
QString xcodePath;
if (!findXcodePath(&xcodePath)) {
if (debugAll)
qDebug() << "Error getting xcode installation path.";
return false;
}
// Returns device support directories matching the major version.
const auto findDeviceSupportDirs = [xcodePath, deviceVersion](const QString &subFolder) {
const QDir rootDir(QString("%1/%2").arg(xcodePath).arg(subFolder));
const QStringList filter(QString("%1.*").arg(deviceVersion.majorVersion()));
return rootDir.entryInfoList(filter, QDir::Dirs | QDir::NoDotAndDotDot);
};
// Compares version strings(considers build number) and return true if versionStrA > versionStrB.
const auto compareVersion = [](const QString &versionStrA, const QString &versionStrB) {
const auto versionA = QVersionNumber::fromString(versionStrA);
const auto versionB = QVersionNumber::fromString(versionStrB);
if (versionA == versionB)
return toBuildNumber(versionStrA) > toBuildNumber(versionStrB);
return versionA > versionB;
};
// To filter dirs without DeveloperDiskImage.dmg and dirs having higher version.
const auto filterDir = [compareVersion, versionStr, buildStr](const QFileInfo d) {
const auto devDiskImage = QString("%1/DeveloperDiskImage.dmg").arg(d.absoluteFilePath());
if (!QFile::exists(devDiskImage))
return true; // Dir's without DeveloperDiskImage.dmg
return compareVersion(d.fileName(), QString("%1 (%2)").arg(versionStr).arg(buildStr));
};
QFileInfoList deviceSupportDirs(findDeviceSupportDirs("iOS DeviceSupport"));
deviceSupportDirs << findDeviceSupportDirs("Platforms/iPhoneOS.platform/DeviceSupport");
// Remove dirs without DeveloperDiskImage.dmg and dirs having higher version.
auto endItr = std::remove_if(deviceSupportDirs.begin(), deviceSupportDirs.end(), filterDir);
deviceSupportDirs.erase(endItr, deviceSupportDirs.end());
if (deviceSupportDirs.isEmpty())
return false;
// Sort device support directories.
std::sort(deviceSupportDirs.begin(), deviceSupportDirs.end(),
[compareVersion](const QFileInfo &a, const QFileInfo &b) {
return compareVersion(a.fileName(), b.fileName());
});
if (path)
*path = QString("%1/DeveloperDiskImage.dmg").arg(deviceSupportDirs[0].absoluteFilePath());
return true;
}
extern "C" {
typedef void (*DeviceAvailableCallback)(QString deviceId, AMDeviceRef, void *userData);
}
@@ -309,7 +405,6 @@ public:
private:
bool developerDiskImagePath(QString *path, QString *signaturePath);
bool findDeveloperDiskImage(QString *diskImagePath, QString versionString, QString buildString);
private:
bool checkRead(qptrdiff nRead, int &maxRetry);
@@ -1232,7 +1327,6 @@ MobileDeviceLib *CommandSession::lib()
bool CommandSession::developerDiskImagePath(QString *path, QString *signaturePath)
{
bool success = false;
if (device && path && connectDevice()) {
CFPropertyListRef cfProductVersion = lib()->deviceCopyValue(device, 0, CFSTR("ProductVersion"));
QString versionString;
@@ -1249,80 +1343,17 @@ bool CommandSession::developerDiskImagePath(QString *path, QString *signaturePat
CFRelease(cfBuildVersion);
disconnectDevice();
if (findDeveloperDiskImage(path, versionString, buildString)) {
success = QFile::exists(*path);
if (success && debugAll)
if (findDeveloperDiskImage(versionString, buildString, path)) {
if (debugAll)
qDebug() << "Developers disk image found at" << path;
if (success && signaturePath) {
if (signaturePath) {
*signaturePath = QString("%1.%2").arg(*path).arg("signature");
success = QFile::exists(*signaturePath);
return QFile::exists(*signaturePath);
}
return true;
}
}
return success;
}
bool CommandSession::findDeveloperDiskImage(QString *diskImagePath, QString versionString, QString buildString)
{
if (!diskImagePath || versionString.isEmpty())
return false;
*diskImagePath = QString();
QProcess process;
process.start("/bin/bash", QStringList() << "-c" << "xcode-select -p");
if (!process.waitForFinished(3000))
addError("Error getting xcode installation path. Command did not finish in time");
const QString xcodePath = QString::fromLatin1(process.readAllStandardOutput()).trimmed();
if (process.exitStatus() == QProcess::NormalExit && QFile::exists(xcodePath)) {
auto imageExists = [xcodePath](QString *foundPath, QString subFolder, QString version, QString build) -> bool {
Q_ASSERT(foundPath);
const QString subFolderPath = QString("%1/%2").arg(xcodePath).arg(subFolder);
if (QFile::exists(subFolderPath)) {
*foundPath = QString("%1/%2 (%3)/DeveloperDiskImage.dmg").arg(subFolderPath).arg(version).arg(build);
if (QFile::exists(*foundPath)) {
return true;
}
QDir subFolderDir(subFolderPath);
QStringList nameFilterList;
nameFilterList << QString("%1 (*)").arg(version);
QFileInfoList builds = subFolderDir.entryInfoList(nameFilterList, QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
foreach (QFileInfo buildPathInfo, builds) {
*foundPath = QString("%1/DeveloperDiskImage.dmg").arg(buildPathInfo.absoluteFilePath());
if (QFile::exists(*foundPath)) {
return true;
}
}
*foundPath = QString("%1/%2/DeveloperDiskImage.dmg").arg(subFolderPath).arg(version);
if (QFile::exists(*foundPath)) {
return true;
}
}
*foundPath = QString();
return false;
};
QStringList versionParts = versionString.split(".", QString::SkipEmptyParts);
while (versionParts.count() > 0) {
if (imageExists(diskImagePath,"iOS DeviceSupport", versionParts.join("."), buildString))
break;
if (imageExists(diskImagePath,"Platforms/iPhoneOS.platform/DeviceSupport", versionParts.join("."), buildString))
break;
const QString latestImagePath = QString("%1/Platforms/iPhoneOS.platform/DeviceSupport/Latest/DeveloperDiskImage.dmg").arg(xcodePath);
if (QFile::exists(latestImagePath)) {
*diskImagePath = latestImagePath;
break;
}
versionParts.removeLast();
}
}
return !diskImagePath->isEmpty();
return false;
}
AppOpSession::AppOpSession(const QString &deviceId, const QString &bundlePath,

View File

@@ -131,7 +131,8 @@ def addHighlighterDefinition(language):
clickItem(table, "%d/0" % row, 5, 5, 0, Qt.LeftButton)
clickButton("{name='downloadButton' text='Download Selected Definitions' "
"type='QPushButton' visible='1'}")
# downloading happens asynchronously
# downloading happens asynchronously but may take a little time
progressBarWait(10000)
languageFile = os.path.join(tmpSettingsDir, "QtProject", "qtcreator",
"generic-highlighter", "%s.xml"
% language.lower().replace(" ", "-"))

View File

@@ -62,7 +62,11 @@ def main():
return
progressBarWait(30000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
if cmakeSupportsServerMode():
treeFile = "projecttree_speedcrunch_server.tsv"
else:
treeFile = "projecttree_speedcrunch.tsv"
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", treeFile)
if not cmakeSupportsServerMode() and JIRA.isBugStillOpen(18290):
test.xfail("Building with cmake in Tealeafreader mode may fail", "QTCREATORBUG-18290")

View File

@@ -0,0 +1,281 @@
"text" "nestinglevel"
"CMakeLists.txt" "0"
"speedcrunch" "0"
"confclean" "0"
"<Build Directory>" "1"
"CMakeFiles" "2"
"confclean" "3"
"confclean.rule" "3"
"speedcrunch" "0"
"<Source Directory>" "1"
"core" "2"
"book.cpp" "3"
"constants.cpp" "3"
"evaluator.cpp" "3"
"functions.cpp" "3"
"numberformatter.cpp" "3"
"settings.cpp" "3"
"gui" "2"
"aboutbox.cpp" "3"
"application.cpp" "3"
"autohidelabel.cpp" "3"
"bookdock.cpp" "3"
"constantsdock.cpp" "3"
"constantswidget.cpp" "3"
"editor.cpp" "3"
"functionsdock.cpp" "3"
"functionswidget.cpp" "3"
"historydock.cpp" "3"
"historywidget.cpp" "3"
"mainwindow.cpp" "3"
"resultdisplay.cpp" "3"
"syntaxhighlighter.cpp" "3"
"tipwidget.cpp" "3"
"variablelistwidget.cpp" "3"
"variablesdock.cpp" "3"
"math" "2"
"floatcommon.c" "3"
"floatconst.c" "3"
"floatconvert.c" "3"
"floaterf.c" "3"
"floatexp.c" "3"
"floatgamma.c" "3"
"floathmath.c" "3"
"floatio.c" "3"
"floatipower.c" "3"
"floatlog.c" "3"
"floatlogic.c" "3"
"floatlong.c" "3"
"floatnum.c" "3"
"floatpower.c" "3"
"floatseries.c" "3"
"floattrig.c" "3"
"hmath.cpp" "3"
"number.c" "3"
"resources" "2"
"speedcrunch.qrc" "3"
"/" "4"
"locale" "5"
"ar_JO.qm" "6"
"ca_ES.qm" "6"
"cs_CZ.qm" "6"
"de_DE.qm" "6"
"en_GB.qm" "6"
"en_US.qm" "6"
"es_AR.qm" "6"
"es_ES.qm" "6"
"et_EE.qm" "6"
"eu_ES.qm" "6"
"fi_FI.qm" "6"
"fr_FR.qm" "6"
"he_IL.qm" "6"
"hu_HU.qm" "6"
"id_ID.qm" "6"
"it_IT.qm" "6"
"ja_JP.qm" "6"
"ko_KR.qm" "6"
"lv_LV.qm" "6"
"nb_NO.qm" "6"
"nl_NL.qm" "6"
"pl_PL.qm" "6"
"pt_BR.qm" "6"
"pt_PT.qm" "6"
"ro_RO.qm" "6"
"ru_RU.qm" "6"
"sv_SE.qm" "6"
"tr_TR.qm" "6"
"uz_UZ.qm" "6"
"vi_VN.qm" "6"
"zh_CN.qm" "6"
"speedcrunch.png" "5"
"speedcrunch.rc" "3"
"thirdparty" "2"
"binreloc.c" "3"
"main.cpp" "2"
"<Build Directory>" "1"
"core" "2"
"moc_book.cxx" "3"
"moc_book.cxx.rule" "3"
"moc_constants.cxx" "3"
"moc_constants.cxx.rule" "3"
"moc_evaluator.cxx" "3"
"moc_evaluator.cxx.rule" "3"
"moc_functions.cxx" "3"
"moc_functions.cxx.rule" "3"
"gui" "2"
"moc_application.cxx" "3"
"moc_application.cxx.rule" "3"
"moc_autohidelabel.cxx" "3"
"moc_autohidelabel.cxx.rule" "3"
"moc_bookdock.cxx" "3"
"moc_bookdock.cxx.rule" "3"
"moc_constantsdock.cxx" "3"
"moc_constantsdock.cxx.rule" "3"
"moc_constantswidget.cxx" "3"
"moc_constantswidget.cxx.rule" "3"
"moc_editor.cxx" "3"
"moc_editor.cxx.rule" "3"
"moc_functionsdock.cxx" "3"
"moc_functionsdock.cxx.rule" "3"
"moc_functionswidget.cxx" "3"
"moc_functionswidget.cxx.rule" "3"
"moc_historydock.cxx" "3"
"moc_historydock.cxx.rule" "3"
"moc_historywidget.cxx" "3"
"moc_historywidget.cxx.rule" "3"
"moc_mainwindow.cxx" "3"
"moc_mainwindow.cxx.rule" "3"
"moc_resultdisplay.cxx" "3"
"moc_resultdisplay.cxx.rule" "3"
"moc_tipwidget.cxx" "3"
"moc_tipwidget.cxx.rule" "3"
"moc_variablelistwidget.cxx" "3"
"moc_variablelistwidget.cxx.rule" "3"
"moc_variablesdock.cxx" "3"
"moc_variablesdock.cxx.rule" "3"
"qrc_speedcrunch.cxx" "2"
"testevaluator" "0"
"<Source Directory>" "1"
"core" "2"
"evaluator.cpp" "3"
"functions.cpp" "3"
"settings.cpp" "3"
"math" "2"
"floatcommon.c" "3"
"floatconst.c" "3"
"floatconvert.c" "3"
"floaterf.c" "3"
"floatexp.c" "3"
"floatgamma.c" "3"
"floathmath.c" "3"
"floatio.c" "3"
"floatipower.c" "3"
"floatlog.c" "3"
"floatlogic.c" "3"
"floatlong.c" "3"
"floatnum.c" "3"
"floatpower.c" "3"
"floatseries.c" "3"
"floattrig.c" "3"
"hmath.cpp" "3"
"number.c" "3"
"tests" "2"
"testevaluator.cpp" "3"
"<Build Directory>" "1"
"core" "2"
"moc_evaluator.cxx" "3"
"moc_evaluator.cxx.rule" "3"
"moc_functions.cxx" "3"
"moc_functions.cxx.rule" "3"
"testfloatnum" "0"
"<Source Directory>" "1"
"math" "2"
"floatcommon.c" "3"
"floatconst.c" "3"
"floatconvert.c" "3"
"floaterf.c" "3"
"floatexp.c" "3"
"floatgamma.c" "3"
"floathmath.c" "3"
"floatio.c" "3"
"floatipower.c" "3"
"floatlog.c" "3"
"floatlogic.c" "3"
"floatlong.c" "3"
"floatnum.c" "3"
"floatpower.c" "3"
"floatseries.c" "3"
"floattrig.c" "3"
"number.c" "3"
"tests" "2"
"testfloatnum.c" "3"
"testhmath" "0"
"<Source Directory>" "1"
"math" "2"
"floatcommon.c" "3"
"floatconst.c" "3"
"floatconvert.c" "3"
"floaterf.c" "3"
"floatexp.c" "3"
"floatgamma.c" "3"
"floathmath.c" "3"
"floatio.c" "3"
"floatipower.c" "3"
"floatlog.c" "3"
"floatlogic.c" "3"
"floatlong.c" "3"
"floatnum.c" "3"
"floatpower.c" "3"
"floatseries.c" "3"
"floattrig.c" "3"
"hmath.cpp" "3"
"number.c" "3"
"tests" "2"
"testhmath.cpp" "3"
"uninstall" "0"
"<Build Directory>" "1"
"CMakeFiles" "2"
"uninstall" "3"
"uninstall.rule" "3"
"<Headers>" "0"
"core" "1"
"book.h" "2"
"constants.h" "2"
"errors.h" "2"
"evaluator.h" "2"
"functions.h" "2"
"numberformatter.h" "2"
"settings.h" "2"
"gui" "1"
"aboutbox.h" "2"
"application.h" "2"
"autohidelabel.h" "2"
"bookdock.h" "2"
"constantsdock.h" "2"
"constantswidget.h" "2"
"editor.h" "2"
"functionsdock.h" "2"
"functionswidget.h" "2"
"historydock.h" "2"
"historywidget.h" "2"
"mainwindow.h" "2"
"resultdisplay.h" "2"
"syntaxhighlighter.h" "2"
"tipwidget.h" "2"
"variablelistwidget.h" "2"
"variablesdock.h" "2"
"math" "1"
"floatcommon.h" "2"
"floatconfig.h" "2"
"floatconst.h" "2"
"floatconvert.h" "2"
"floaterf.h" "2"
"floatexp.h" "2"
"floatgamma.h" "2"
"floathmath.h" "2"
"floatincgamma.h" "2"
"floatio.h" "2"
"floatipower.h" "2"
"floatlog.h" "2"
"floatlogic.h" "2"
"floatlong.h" "2"
"floatnum.h" "2"
"floatpower.h" "2"
"floatseries.h" "2"
"floattrig.h" "2"
"hmath.h" "2"
"number.h" "2"
"thirdparty" "1"
"binreloc.h" "2"
"CMake Modules" "0"
"<Source Directory>" "1"
"cmake_uninstall.cmake.in" "2"
"SourceFiles.cmake" "2"
"resources" "2"
"speedcrunch.qrc" "3"
"<Build Directory>" "1"
"CMakeFiles" "2"
"feature_tests.cxx" "3"
"CMakeCCompiler.cmake" "4"
"CMakeCXXCompiler.cmake" "4"
"CMakeSystem.cmake" "4"
1 text nestinglevel
2 CMakeLists.txt 0
3 speedcrunch 0
4 confclean 0
5 <Build Directory> 1
6 CMakeFiles 2
7 confclean 3
8 confclean.rule 3
9 speedcrunch 0
10 <Source Directory> 1
11 core 2
12 book.cpp 3
13 constants.cpp 3
14 evaluator.cpp 3
15 functions.cpp 3
16 numberformatter.cpp 3
17 settings.cpp 3
18 gui 2
19 aboutbox.cpp 3
20 application.cpp 3
21 autohidelabel.cpp 3
22 bookdock.cpp 3
23 constantsdock.cpp 3
24 constantswidget.cpp 3
25 editor.cpp 3
26 functionsdock.cpp 3
27 functionswidget.cpp 3
28 historydock.cpp 3
29 historywidget.cpp 3
30 mainwindow.cpp 3
31 resultdisplay.cpp 3
32 syntaxhighlighter.cpp 3
33 tipwidget.cpp 3
34 variablelistwidget.cpp 3
35 variablesdock.cpp 3
36 math 2
37 floatcommon.c 3
38 floatconst.c 3
39 floatconvert.c 3
40 floaterf.c 3
41 floatexp.c 3
42 floatgamma.c 3
43 floathmath.c 3
44 floatio.c 3
45 floatipower.c 3
46 floatlog.c 3
47 floatlogic.c 3
48 floatlong.c 3
49 floatnum.c 3
50 floatpower.c 3
51 floatseries.c 3
52 floattrig.c 3
53 hmath.cpp 3
54 number.c 3
55 resources 2
56 speedcrunch.qrc 3
57 / 4
58 locale 5
59 ar_JO.qm 6
60 ca_ES.qm 6
61 cs_CZ.qm 6
62 de_DE.qm 6
63 en_GB.qm 6
64 en_US.qm 6
65 es_AR.qm 6
66 es_ES.qm 6
67 et_EE.qm 6
68 eu_ES.qm 6
69 fi_FI.qm 6
70 fr_FR.qm 6
71 he_IL.qm 6
72 hu_HU.qm 6
73 id_ID.qm 6
74 it_IT.qm 6
75 ja_JP.qm 6
76 ko_KR.qm 6
77 lv_LV.qm 6
78 nb_NO.qm 6
79 nl_NL.qm 6
80 pl_PL.qm 6
81 pt_BR.qm 6
82 pt_PT.qm 6
83 ro_RO.qm 6
84 ru_RU.qm 6
85 sv_SE.qm 6
86 tr_TR.qm 6
87 uz_UZ.qm 6
88 vi_VN.qm 6
89 zh_CN.qm 6
90 speedcrunch.png 5
91 speedcrunch.rc 3
92 thirdparty 2
93 binreloc.c 3
94 main.cpp 2
95 <Build Directory> 1
96 core 2
97 moc_book.cxx 3
98 moc_book.cxx.rule 3
99 moc_constants.cxx 3
100 moc_constants.cxx.rule 3
101 moc_evaluator.cxx 3
102 moc_evaluator.cxx.rule 3
103 moc_functions.cxx 3
104 moc_functions.cxx.rule 3
105 gui 2
106 moc_application.cxx 3
107 moc_application.cxx.rule 3
108 moc_autohidelabel.cxx 3
109 moc_autohidelabel.cxx.rule 3
110 moc_bookdock.cxx 3
111 moc_bookdock.cxx.rule 3
112 moc_constantsdock.cxx 3
113 moc_constantsdock.cxx.rule 3
114 moc_constantswidget.cxx 3
115 moc_constantswidget.cxx.rule 3
116 moc_editor.cxx 3
117 moc_editor.cxx.rule 3
118 moc_functionsdock.cxx 3
119 moc_functionsdock.cxx.rule 3
120 moc_functionswidget.cxx 3
121 moc_functionswidget.cxx.rule 3
122 moc_historydock.cxx 3
123 moc_historydock.cxx.rule 3
124 moc_historywidget.cxx 3
125 moc_historywidget.cxx.rule 3
126 moc_mainwindow.cxx 3
127 moc_mainwindow.cxx.rule 3
128 moc_resultdisplay.cxx 3
129 moc_resultdisplay.cxx.rule 3
130 moc_tipwidget.cxx 3
131 moc_tipwidget.cxx.rule 3
132 moc_variablelistwidget.cxx 3
133 moc_variablelistwidget.cxx.rule 3
134 moc_variablesdock.cxx 3
135 moc_variablesdock.cxx.rule 3
136 qrc_speedcrunch.cxx 2
137 testevaluator 0
138 <Source Directory> 1
139 core 2
140 evaluator.cpp 3
141 functions.cpp 3
142 settings.cpp 3
143 math 2
144 floatcommon.c 3
145 floatconst.c 3
146 floatconvert.c 3
147 floaterf.c 3
148 floatexp.c 3
149 floatgamma.c 3
150 floathmath.c 3
151 floatio.c 3
152 floatipower.c 3
153 floatlog.c 3
154 floatlogic.c 3
155 floatlong.c 3
156 floatnum.c 3
157 floatpower.c 3
158 floatseries.c 3
159 floattrig.c 3
160 hmath.cpp 3
161 number.c 3
162 tests 2
163 testevaluator.cpp 3
164 <Build Directory> 1
165 core 2
166 moc_evaluator.cxx 3
167 moc_evaluator.cxx.rule 3
168 moc_functions.cxx 3
169 moc_functions.cxx.rule 3
170 testfloatnum 0
171 <Source Directory> 1
172 math 2
173 floatcommon.c 3
174 floatconst.c 3
175 floatconvert.c 3
176 floaterf.c 3
177 floatexp.c 3
178 floatgamma.c 3
179 floathmath.c 3
180 floatio.c 3
181 floatipower.c 3
182 floatlog.c 3
183 floatlogic.c 3
184 floatlong.c 3
185 floatnum.c 3
186 floatpower.c 3
187 floatseries.c 3
188 floattrig.c 3
189 number.c 3
190 tests 2
191 testfloatnum.c 3
192 testhmath 0
193 <Source Directory> 1
194 math 2
195 floatcommon.c 3
196 floatconst.c 3
197 floatconvert.c 3
198 floaterf.c 3
199 floatexp.c 3
200 floatgamma.c 3
201 floathmath.c 3
202 floatio.c 3
203 floatipower.c 3
204 floatlog.c 3
205 floatlogic.c 3
206 floatlong.c 3
207 floatnum.c 3
208 floatpower.c 3
209 floatseries.c 3
210 floattrig.c 3
211 hmath.cpp 3
212 number.c 3
213 tests 2
214 testhmath.cpp 3
215 uninstall 0
216 <Build Directory> 1
217 CMakeFiles 2
218 uninstall 3
219 uninstall.rule 3
220 <Headers> 0
221 core 1
222 book.h 2
223 constants.h 2
224 errors.h 2
225 evaluator.h 2
226 functions.h 2
227 numberformatter.h 2
228 settings.h 2
229 gui 1
230 aboutbox.h 2
231 application.h 2
232 autohidelabel.h 2
233 bookdock.h 2
234 constantsdock.h 2
235 constantswidget.h 2
236 editor.h 2
237 functionsdock.h 2
238 functionswidget.h 2
239 historydock.h 2
240 historywidget.h 2
241 mainwindow.h 2
242 resultdisplay.h 2
243 syntaxhighlighter.h 2
244 tipwidget.h 2
245 variablelistwidget.h 2
246 variablesdock.h 2
247 math 1
248 floatcommon.h 2
249 floatconfig.h 2
250 floatconst.h 2
251 floatconvert.h 2
252 floaterf.h 2
253 floatexp.h 2
254 floatgamma.h 2
255 floathmath.h 2
256 floatincgamma.h 2
257 floatio.h 2
258 floatipower.h 2
259 floatlog.h 2
260 floatlogic.h 2
261 floatlong.h 2
262 floatnum.h 2
263 floatpower.h 2
264 floatseries.h 2
265 floattrig.h 2
266 hmath.h 2
267 number.h 2
268 thirdparty 1
269 binreloc.h 2
270 CMake Modules 0
271 <Source Directory> 1
272 cmake_uninstall.cmake.in 2
273 SourceFiles.cmake 2
274 resources 2
275 speedcrunch.qrc 3
276 <Build Directory> 1
277 CMakeFiles 2
278 feature_tests.cxx 3
279 CMakeCCompiler.cmake 4
280 CMakeCXXCompiler.cmake 4
281 CMakeSystem.cmake 4