forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.3'
Change-Id: I126f3a05212a3d5df78812e66285bc9e8078360b
This commit is contained in:
@@ -15,7 +15,6 @@ QtcProduct {
|
|||||||
project.buildDirectory + '/' + qtc.ide_library_path,
|
project.buildDirectory + '/' + qtc.ide_library_path,
|
||||||
project.buildDirectory + '/' + qtc.ide_plugin_path
|
project.buildDirectory + '/' + qtc.ide_plugin_path
|
||||||
]
|
]
|
||||||
cpp.minimumOsxVersion: "10.7"
|
|
||||||
cpp.defines: base.filter(function(d) { return d != "QT_RESTRICTED_CAST_FROM_ASCII"; })
|
cpp.defines: base.filter(function(d) { return d != "QT_RESTRICTED_CAST_FROM_ASCII"; })
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import qbs 1.0
|
import qbs 1.0
|
||||||
import qbs.FileInfo
|
import qbs.FileInfo
|
||||||
|
import qbs.Utilities
|
||||||
import QtcFunctions
|
import QtcFunctions
|
||||||
|
|
||||||
Product {
|
Product {
|
||||||
@@ -19,9 +20,13 @@ Product {
|
|||||||
Depends { name: "qtc" }
|
Depends { name: "qtc" }
|
||||||
Depends { name: product.name + " dev headers"; required: false }
|
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.cxxLanguageVersion: "c++14"
|
||||||
cpp.defines: qtc.generalDefines
|
cpp.defines: qtc.generalDefines
|
||||||
cpp.minimumOsxVersion: "10.7"
|
|
||||||
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
||||||
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
|
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
|
||||||
cpp.visibility: "minimal"
|
cpp.visibility: "minimal"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ defineReplace(stripSrcDir) {
|
|||||||
return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
|
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
|
# Qt 5.6 still sets deployment target 10.7, which does not work
|
||||||
# with all C++11/14 features (e.g. std::future)
|
# with all C++11/14 features (e.g. std::future)
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
|
||||||
|
|||||||
@@ -25,13 +25,14 @@
|
|||||||
|
|
||||||
from dumper import *
|
from dumper import *
|
||||||
|
|
||||||
|
def typeTarget(type):
|
||||||
|
target = type.target()
|
||||||
|
if target:
|
||||||
|
return target
|
||||||
|
return type
|
||||||
|
|
||||||
def stripTypeName(value):
|
def stripTypeName(value):
|
||||||
type = value.type
|
return typeTarget(value.type).unqualified().name
|
||||||
try:
|
|
||||||
type = type.target()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return str(type.unqualified())
|
|
||||||
|
|
||||||
def extractPointerType(d, value):
|
def extractPointerType(d, value):
|
||||||
postfix = ""
|
postfix = ""
|
||||||
@@ -41,7 +42,7 @@ def extractPointerType(d, value):
|
|||||||
try:
|
try:
|
||||||
return readLiteral(d, value["_name"]) + postfix
|
return readLiteral(d, value["_name"]) + postfix
|
||||||
except:
|
except:
|
||||||
typeName = str(value.type.unqualified().target())
|
typeName = typeTarget(value.type.unqualified()).name
|
||||||
if typeName == "CPlusPlus::IntegerType":
|
if typeName == "CPlusPlus::IntegerType":
|
||||||
return "int" + postfix
|
return "int" + postfix
|
||||||
elif typeName == "CPlusPlus::VoidType":
|
elif typeName == "CPlusPlus::VoidType":
|
||||||
@@ -67,20 +68,15 @@ def readTemplateName(d, value):
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
def readLiteral(d, value):
|
def readLiteral(d, value):
|
||||||
if d.isNull(value):
|
if not value.integer():
|
||||||
return "<null>"
|
return "<null>"
|
||||||
type = value.type.unqualified()
|
type = typeTarget(value.type.unqualified())
|
||||||
try:
|
if type and (type.name == "CPlusPlus::TemplateNameId"):
|
||||||
type = type.target()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
typestr = str(type)
|
|
||||||
if typestr == "CPlusPlus::TemplateNameId":
|
|
||||||
return readTemplateName(d, value)
|
return readTemplateName(d, value)
|
||||||
elif typestr == "CPlusPlus::QualifiedNameId":
|
elif type and (type.name == "CPlusPlus::QualifiedNameId"):
|
||||||
return readLiteral(d, value["_base"]) + "::" + readLiteral(d, value["_name"])
|
return readLiteral(d, value["_base"]) + "::" + readLiteral(d, value["_name"])
|
||||||
try:
|
try:
|
||||||
return d.extractBlob(value["_chars"], value["_size"]).toString()
|
return bytes(d.readRawMemory(value["_chars"], value["_size"])).decode('latin1')
|
||||||
except:
|
except:
|
||||||
return "<unsupported>"
|
return "<unsupported>"
|
||||||
|
|
||||||
@@ -118,7 +114,7 @@ def qdump__Debugger__Internal__WatchItem(d, value):
|
|||||||
d.putPlainChildren(value)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
def qdump__Debugger__Internal__BreakpointModelId(d, 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)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
def qdump__Debugger__Internal__ThreadId(d, value):
|
def qdump__Debugger__Internal__ThreadId(d, value):
|
||||||
@@ -130,7 +126,10 @@ def qdump__CPlusPlus__ByteArrayRef(d, value):
|
|||||||
d.putPlainChildren(value)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
def qdump__CPlusPlus__Identifier(d, 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)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
def qdump__CPlusPlus__Symbol(d, value):
|
def qdump__CPlusPlus__Symbol(d, value):
|
||||||
@@ -202,8 +201,12 @@ def qdump__Utf8String(d, value):
|
|||||||
|
|
||||||
def qdump__CPlusPlus__Token(d, value):
|
def qdump__CPlusPlus__Token(d, value):
|
||||||
k = value["f"]["kind"]
|
k = value["f"]["kind"]
|
||||||
e = int(k)
|
e = k.lvalue
|
||||||
type = str(k.cast(d.lookupType("CPlusPlus::Kind")))[11:] # Strip "CPlusPlus::"
|
if e:
|
||||||
|
kindType = d.lookupType("CPlusPlus::Kind")
|
||||||
|
type = kindType.typeData().enumDisplay(e, k.address())[11:]
|
||||||
|
else:
|
||||||
|
type = ''
|
||||||
try:
|
try:
|
||||||
if e == 6:
|
if e == 6:
|
||||||
type = readLiteral(d, value["identifier"]) + " (%s)" % type
|
type = readLiteral(d, value["identifier"]) + " (%s)" % type
|
||||||
@@ -216,8 +219,8 @@ def qdump__CPlusPlus__Token(d, value):
|
|||||||
|
|
||||||
def qdump__CPlusPlus__Internal__PPToken(d, value):
|
def qdump__CPlusPlus__Internal__PPToken(d, value):
|
||||||
data, size, alloc = d.byteArrayData(value["m_src"])
|
data, size, alloc = d.byteArrayData(value["m_src"])
|
||||||
length = int(value["f"]["utf16chars"])
|
length = value["f"]["utf16chars"].integer()
|
||||||
offset = int(value["utf16charOffset"])
|
offset = value["utf16charOffset"].integer()
|
||||||
#warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s"
|
#warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s"
|
||||||
# % (size, alloc, offset, length, data))
|
# % (size, alloc, offset, length, data))
|
||||||
d.putValue(d.readMemory(data + offset, min(100, length)), "latin1")
|
d.putValue(d.readMemory(data + offset, min(100, length)), "latin1")
|
||||||
@@ -227,8 +230,8 @@ def qdump__ProString(d, value):
|
|||||||
try:
|
try:
|
||||||
s = value["m_string"]
|
s = value["m_string"]
|
||||||
data, size, alloc = d.stringData(s)
|
data, size, alloc = d.stringData(s)
|
||||||
data += 2 * int(value["m_offset"])
|
data += 2 * value["m_offset"].integer()
|
||||||
size = int(value["m_length"])
|
size = value["m_length"].integer()
|
||||||
s = d.readMemory(data, 2 * size)
|
s = d.readMemory(data, 2 * size)
|
||||||
d.putValue(s, "utf16")
|
d.putValue(s, "utf16")
|
||||||
except:
|
except:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -253,6 +253,6 @@
|
|||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>@SHORT_VERSION@</string>
|
<string>@SHORT_VERSION@</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.7.0</string>
|
<string>10.8</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ win32 {
|
|||||||
--app-icon qtcreator \
|
--app-icon qtcreator \
|
||||||
--output-partial-info-plist $$shell_quote($(TMPDIR)/qtcreator.Info.plist) \
|
--output-partial-info-plist $$shell_quote($(TMPDIR)/qtcreator.Info.plist) \
|
||||||
--platform macosx \
|
--platform macosx \
|
||||||
--minimum-deployment-target 10.7 \
|
--minimum-deployment-target $$QMAKE_MACOSX_DEPLOYMENT_TARGET \
|
||||||
--compile $$shell_quote($$IDE_DATA_PATH) \
|
--compile $$shell_quote($$IDE_DATA_PATH) \
|
||||||
$$shell_quote($$PWD/qtcreator.xcassets) > /dev/null
|
$$shell_quote($$PWD/qtcreator.xcassets) > /dev/null
|
||||||
ASSETCATALOG.input = ASSETCATALOG.files
|
ASSETCATALOG.input = ASSETCATALOG.files
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
|
|
||||||
#include "algorithm.h"
|
#include "algorithm.h"
|
||||||
|
#include "qtcassert.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
@@ -372,6 +373,7 @@ void Environment::modify(const QList<EnvironmentItem> & list)
|
|||||||
} else {
|
} else {
|
||||||
// TODO use variable expansion
|
// TODO use variable expansion
|
||||||
QString value = item.value;
|
QString value = item.value;
|
||||||
|
int replaceCount = 0;
|
||||||
for (int i=0; i < value.size(); ++i) {
|
for (int i=0; i < value.size(); ++i) {
|
||||||
if (value.at(i) == '$') {
|
if (value.at(i) == '$') {
|
||||||
if ((i + 1) < value.size()) {
|
if ((i + 1) < value.size()) {
|
||||||
@@ -386,6 +388,8 @@ void Environment::modify(const QList<EnvironmentItem> & list)
|
|||||||
Environment::const_iterator it = constFind(name);
|
Environment::const_iterator it = constFind(name);
|
||||||
if (it != constEnd())
|
if (it != constEnd())
|
||||||
value.replace(i, end-i+1, it.value());
|
value.replace(i, end-i+1, it.value());
|
||||||
|
++replaceCount;
|
||||||
|
QTC_ASSERT(replaceCount < 100, break);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@
|
|||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <projectexplorer/buildmanager.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -102,6 +102,7 @@ void AutotestPlugin::initializeMenuEntries()
|
|||||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+A")));
|
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+A")));
|
||||||
connect(action, &QAction::triggered,
|
connect(action, &QAction::triggered,
|
||||||
this, &AutotestPlugin::onRunAllTriggered);
|
this, &AutotestPlugin::onRunAllTriggered);
|
||||||
|
action->setEnabled(false);
|
||||||
menu->addAction(command);
|
menu->addAction(command);
|
||||||
|
|
||||||
action = new QAction(tr("&Run Selected Tests"), this);
|
action = new QAction(tr("&Run Selected Tests"), this);
|
||||||
@@ -109,6 +110,7 @@ void AutotestPlugin::initializeMenuEntries()
|
|||||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+R")));
|
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+R")));
|
||||||
connect(action, &QAction::triggered,
|
connect(action, &QAction::triggered,
|
||||||
this, &AutotestPlugin::onRunSelectedTriggered);
|
this, &AutotestPlugin::onRunSelectedTriggered);
|
||||||
|
action->setEnabled(false);
|
||||||
menu->addAction(command);
|
menu->addAction(command);
|
||||||
|
|
||||||
action = new QAction(tr("Re&scan Tests"), this);
|
action = new QAction(tr("Re&scan Tests"), this);
|
||||||
@@ -121,7 +123,12 @@ void AutotestPlugin::initializeMenuEntries()
|
|||||||
|
|
||||||
ActionContainer *toolsMenu = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
ActionContainer *toolsMenu = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
toolsMenu->addMenu(menu);
|
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);
|
this, &AutotestPlugin::updateMenuItemsEnabledState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +183,8 @@ void AutotestPlugin::onRunSelectedTriggered()
|
|||||||
|
|
||||||
void AutotestPlugin::updateMenuItemsEnabledState()
|
void AutotestPlugin::updateMenuItemsEnabledState()
|
||||||
{
|
{
|
||||||
const bool enabled = !TestRunner::instance()->isTestRunning()
|
const bool enabled = !ProjectExplorer::BuildManager::isBuilding()
|
||||||
|
&& !TestRunner::instance()->isTestRunning()
|
||||||
&& TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle;
|
&& TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle;
|
||||||
const bool hasTests = TestTreeModel::instance()->hasTests();
|
const bool hasTests = TestTreeModel::instance()->hasTests();
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private:
|
|||||||
void updateMenuItemsEnabledState();
|
void updateMenuItemsEnabledState();
|
||||||
QList<QObject *> createTestObjects() const override;
|
QList<QObject *> createTestObjects() const override;
|
||||||
const QSharedPointer<TestSettings> m_settings;
|
const QSharedPointer<TestSettings> m_settings;
|
||||||
TestFrameworkManager *m_frameworkManager = 0;
|
TestFrameworkManager *m_frameworkManager = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ TestConfiguration *GTestTreeItem::testConfiguration() const
|
|||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
if (config)
|
||||||
|
config->setInternalTargets(internalTargets());
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +126,7 @@ QList<TestConfiguration *> GTestTreeItem::getAllTestConfigurations() const
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
QHash<QString, int> proFilesWithTestSets;
|
QHash<QString, int> proFilesWithTestSets;
|
||||||
|
QHash<QString, QSet<QString> > proFilesWithInternalTargets;
|
||||||
for (int row = 0, count = childCount(); row < count; ++row) {
|
for (int row = 0, count = childCount(); row < count; ++row) {
|
||||||
const GTestTreeItem *child = static_cast<const GTestTreeItem *>(childItem(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 TestTreeItem *grandChild = child->childItem(grandChildRow);
|
||||||
const QString &key = grandChild->proFile();
|
const QString &key = grandChild->proFile();
|
||||||
proFilesWithTestSets.insert(key, proFilesWithTestSets[key] + 1);
|
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->setTestCaseCount(it.value());
|
||||||
tc->setProjectFile(it.key());
|
tc->setProjectFile(it.key());
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(proFilesWithInternalTargets.value(it.key()));
|
||||||
result << tc;
|
result << tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +167,7 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
QHash<QString, TestCases> proFilesWithCheckedTestSets;
|
QHash<QString, TestCases> proFilesWithCheckedTestSets;
|
||||||
|
QHash<QString, QSet<QString> > proFilesWithInternalTargets;
|
||||||
for (int row = 0, count = childCount(); row < count; ++row) {
|
for (int row = 0, count = childCount(); row < count; ++row) {
|
||||||
const GTestTreeItem *child = static_cast<const GTestTreeItem *>(childItem(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()];
|
auto &testCases = proFilesWithCheckedTestSets[child->childItem(0)->proFile()];
|
||||||
testCases.filters.append(gtestFilter(child->state()).arg(child->name()).arg('*'));
|
testCases.filters.append(gtestFilter(child->state()).arg(child->name()).arg('*'));
|
||||||
testCases.additionalTestCaseCount += grandChildCount - 1;
|
testCases.additionalTestCaseCount += grandChildCount - 1;
|
||||||
|
proFilesWithInternalTargets.insert(child->childItem(0)->proFile(),
|
||||||
|
child->internalTargets());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Qt::PartiallyChecked: {
|
case Qt::PartiallyChecked: {
|
||||||
@@ -183,6 +191,8 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
|
|||||||
if (grandChild->checked() == Qt::Checked) {
|
if (grandChild->checked() == Qt::Checked) {
|
||||||
proFilesWithCheckedTestSets[grandChild->proFile()].filters.append(
|
proFilesWithCheckedTestSets[grandChild->proFile()].filters.append(
|
||||||
gtestFilter(child->state()).arg(child->name()).arg(grandChild->name()));
|
gtestFilter(child->state()).arg(child->name()).arg(grandChild->name()));
|
||||||
|
proFilesWithInternalTargets.insert(grandChild->proFile(),
|
||||||
|
grandChild->internalTargets());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -198,6 +208,7 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const
|
|||||||
tc->setTestCaseCount(tc->testCaseCount() + it.value().additionalTestCaseCount);
|
tc->setTestCaseCount(tc->testCaseCount() + it.value().additionalTestCaseCount);
|
||||||
tc->setProjectFile(it.key());
|
tc->setProjectFile(it.key());
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(proFilesWithInternalTargets[it.key()]);
|
||||||
result << tc;
|
result << tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ TestConfiguration *QtTestTreeItem::testConfiguration() const
|
|||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
if (config)
|
||||||
|
config->setInternalTargets(internalTargets());
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,6 +162,7 @@ QList<TestConfiguration *> QtTestTreeItem::getAllTestConfigurations() const
|
|||||||
tc->setTestCaseCount(child->childCount());
|
tc->setTestCaseCount(child->childCount());
|
||||||
tc->setProjectFile(child->proFile());
|
tc->setProjectFile(child->proFile());
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(child->internalTargets());
|
||||||
result << tc;
|
result << tc;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -185,6 +188,7 @@ QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const
|
|||||||
testConfiguration->setTestCaseCount(child->childCount());
|
testConfiguration->setTestCaseCount(child->childCount());
|
||||||
testConfiguration->setProjectFile(child->proFile());
|
testConfiguration->setProjectFile(child->proFile());
|
||||||
testConfiguration->setProject(project);
|
testConfiguration->setProject(project);
|
||||||
|
testConfiguration->setInternalTargets(child->internalTargets());
|
||||||
result << testConfiguration;
|
result << testConfiguration;
|
||||||
continue;
|
continue;
|
||||||
case Qt::PartiallyChecked:
|
case Qt::PartiallyChecked:
|
||||||
@@ -210,6 +214,7 @@ QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const
|
|||||||
testConfiguration->setTestCases(testCases);
|
testConfiguration->setTestCases(testCases);
|
||||||
testConfiguration->setProjectFile(child->proFile());
|
testConfiguration->setProjectFile(child->proFile());
|
||||||
testConfiguration->setProject(project);
|
testConfiguration->setProject(project);
|
||||||
|
testConfiguration->setInternalTargets(child->internalTargets());
|
||||||
result << testConfiguration;
|
result << testConfiguration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <qmljs/qmljsdialect.h>
|
#include <qmljs/qmljsdialect.h>
|
||||||
#include <qmljstools/qmljsmodelmanager.h>
|
#include <qmljstools/qmljsmodelmanager.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
@@ -238,6 +239,49 @@ bool QuickTestParser::handleQtQuickTest(QFutureInterface<TestParseResultPtr> fut
|
|||||||
return result;
|
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()
|
QuickTestParser::QuickTestParser()
|
||||||
: CppParser()
|
: CppParser()
|
||||||
{
|
{
|
||||||
@@ -246,11 +290,12 @@ QuickTestParser::QuickTestParser()
|
|||||||
const QStringList &dirs = m_directoryWatcher.directories();
|
const QStringList &dirs = m_directoryWatcher.directories();
|
||||||
if (!dirs.isEmpty())
|
if (!dirs.isEmpty())
|
||||||
m_directoryWatcher.removePaths(dirs);
|
m_directoryWatcher.removePaths(dirs);
|
||||||
|
m_watchedFiles.clear();
|
||||||
});
|
});
|
||||||
connect(&m_directoryWatcher, &QFileSystemWatcher::directoryChanged,
|
connect(&m_directoryWatcher, &QFileSystemWatcher::directoryChanged,
|
||||||
[this] { TestTreeModel::instance()->parser()->emitUpdateTestTree(this); });
|
this, &QuickTestParser::handleDirectoryChanged);
|
||||||
connect(this, &QuickTestParser::updateWatchPaths,
|
connect(this, &QuickTestParser::updateWatchPaths,
|
||||||
&m_directoryWatcher, &QFileSystemWatcher::addPaths, Qt::QueuedConnection);
|
this, &QuickTestParser::doUpdateWatchPaths, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
QuickTestParser::~QuickTestParser()
|
QuickTestParser::~QuickTestParser()
|
||||||
|
|||||||
@@ -56,10 +56,13 @@ signals:
|
|||||||
private:
|
private:
|
||||||
bool handleQtQuickTest(QFutureInterface<TestParseResultPtr> futureInterface,
|
bool handleQtQuickTest(QFutureInterface<TestParseResultPtr> futureInterface,
|
||||||
CPlusPlus::Document::Ptr document, const Core::Id &id) const;
|
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;
|
QList<QmlJS::Document::Ptr> scanDirectoryForQuickTestQmlFiles(const QString &srcDir) const;
|
||||||
QmlJS::Snapshot m_qmlSnapshot;
|
QmlJS::Snapshot m_qmlSnapshot;
|
||||||
QHash<QString, QString> m_proFilesForQmlFiles;
|
QHash<QString, QString> m_proFilesForQmlFiles;
|
||||||
QFileSystemWatcher m_directoryWatcher;
|
QFileSystemWatcher m_directoryWatcher;
|
||||||
|
QMap<QString, QMap<QString, QDateTime> > m_watchedFiles;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "quicktestconfiguration.h"
|
#include "quicktestconfiguration.h"
|
||||||
#include "quicktestparser.h"
|
#include "quicktestparser.h"
|
||||||
|
|
||||||
|
#include <cpptools/cppmodelmanager.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -138,6 +139,8 @@ TestConfiguration *QuickTestTreeItem::testConfiguration() const
|
|||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
if (config)
|
||||||
|
config->setInternalTargets(internalTargets());
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +153,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
QHash<QString, int> foundProFiles;
|
QHash<QString, int> foundProFiles;
|
||||||
|
QHash<QString, QSet<QString> > proFilesWithTargets;
|
||||||
for (int row = 0, count = childCount(); row < count; ++row) {
|
for (int row = 0, count = childCount(); row < count; ++row) {
|
||||||
const TestTreeItem *child = childItem(row);
|
const TestTreeItem *child = childItem(row);
|
||||||
// unnamed Quick Tests must be handled separately
|
// unnamed Quick Tests must be handled separately
|
||||||
@@ -158,12 +162,14 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
|
|||||||
const TestTreeItem *grandChild = child->childItem(childRow);
|
const TestTreeItem *grandChild = child->childItem(childRow);
|
||||||
const QString &proFile = grandChild->proFile();
|
const QString &proFile = grandChild->proFile();
|
||||||
foundProFiles.insert(proFile, foundProFiles[proFile] + 1);
|
foundProFiles.insert(proFile, foundProFiles[proFile] + 1);
|
||||||
|
proFilesWithTargets.insert(proFile, grandChild->internalTargets());
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// named Quick Test
|
// named Quick Test
|
||||||
const QString &proFile = child->proFile();
|
const QString &proFile = child->proFile();
|
||||||
foundProFiles.insert(proFile, foundProFiles[proFile] + child->childCount());
|
foundProFiles.insert(proFile, foundProFiles[proFile] + child->childCount());
|
||||||
|
proFilesWithTargets.insert(proFile, child->internalTargets());
|
||||||
}
|
}
|
||||||
// create TestConfiguration for each project file
|
// create TestConfiguration for each project file
|
||||||
QHash<QString, int>::ConstIterator it = foundProFiles.begin();
|
QHash<QString, int>::ConstIterator it = foundProFiles.begin();
|
||||||
@@ -173,6 +179,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
|
|||||||
tc->setTestCaseCount(it.value());
|
tc->setTestCaseCount(it.value());
|
||||||
tc->setProjectFile(it.key());
|
tc->setProjectFile(it.key());
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(proFilesWithTargets[it.key()]);
|
||||||
result << tc;
|
result << tc;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -203,6 +210,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co
|
|||||||
tc->setUnnamedOnly(true);
|
tc->setUnnamedOnly(true);
|
||||||
tc->setProjectFile(proFile);
|
tc->setProjectFile(proFile);
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(grandChild->internalTargets());
|
||||||
foundProFiles.insert(proFile, tc);
|
foundProFiles.insert(proFile, tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,6 +254,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co
|
|||||||
tc->setTestCases(testFunctions);
|
tc->setTestCases(testFunctions);
|
||||||
tc->setProjectFile(child->proFile());
|
tc->setProjectFile(child->proFile());
|
||||||
tc->setProject(project);
|
tc->setProject(project);
|
||||||
|
tc->setInternalTargets(child->internalTargets());
|
||||||
foundProFiles.insert(child->proFile(), tc);
|
foundProFiles.insert(child->proFile(), tc);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -306,6 +315,20 @@ bool QuickTestTreeItem::lessThan(const TestTreeItem *other, TestTreeItem::SortMo
|
|||||||
return TestTreeItem::lessThan(other, mode);
|
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
|
TestTreeItem *QuickTestTreeItem::unnamedQuickTests() const
|
||||||
{
|
{
|
||||||
if (type() != Root)
|
if (type() != Root)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
TestTreeItem *find(const TestParseResult *result) override;
|
TestTreeItem *find(const TestParseResult *result) override;
|
||||||
bool modify(const TestParseResult *result) override;
|
bool modify(const TestParseResult *result) override;
|
||||||
bool lessThan(const TestTreeItem *other, SortMode mode) const override;
|
bool lessThan(const TestTreeItem *other, SortMode mode) const override;
|
||||||
|
QSet<QString> internalTargets() const override;
|
||||||
private:
|
private:
|
||||||
TestTreeItem *unnamedQuickTests() const;
|
TestTreeItem *unnamedQuickTests() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ static bool isLocal(RunConfiguration *runConfiguration)
|
|||||||
void TestConfiguration::completeTestInformation(int runMode)
|
void TestConfiguration::completeTestInformation(int runMode)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_projectFile.isEmpty(), return);
|
QTC_ASSERT(!m_projectFile.isEmpty(), return);
|
||||||
|
QTC_ASSERT(!m_buildTargets.isEmpty(), return);
|
||||||
|
|
||||||
Project *project = SessionManager::startupProject();
|
Project *project = SessionManager::startupProject();
|
||||||
if (!project)
|
if (!project)
|
||||||
@@ -73,23 +74,16 @@ void TestConfiguration::completeTestInformation(int runMode)
|
|||||||
if (!target)
|
if (!target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto cppMM = CppTools::CppModelManager::instance();
|
const QSet<QString> buildSystemTargets = m_buildTargets;
|
||||||
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 BuildTargetInfo targetInfo
|
const BuildTargetInfo targetInfo
|
||||||
= Utils::findOrDefault(target->applicationTargets().list,
|
= Utils::findOrDefault(target->applicationTargets().list,
|
||||||
[&buildSystemTargets, &fn] (const BuildTargetInfo &bti) {
|
[&buildSystemTargets] (const BuildTargetInfo &bti) {
|
||||||
return Utils::anyOf(buildSystemTargets, [&fn, &bti](const QString &b) {
|
return Utils::anyOf(buildSystemTargets, [&bti](const QString &b) {
|
||||||
return b == bti.targetName || (b.contains(bti.targetName) && bti.projectFilePath == fn);
|
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
|
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
|
if (!isLocal(runConfig)) // TODO add device support
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (buildSystemTargets.contains(runConfig->buildSystemTarget())) {
|
const QString bst = runConfig->buildSystemTarget() + '|' + m_projectFile;
|
||||||
|
if (buildSystemTargets.contains(bst)) {
|
||||||
Runnable runnable = runConfig->runnable();
|
Runnable runnable = runConfig->runnable();
|
||||||
if (!runnable.is<StandardRunnable>())
|
if (!runnable.is<StandardRunnable>())
|
||||||
continue;
|
continue;
|
||||||
@@ -146,7 +141,7 @@ void TestConfiguration::completeTestInformation(int runMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_displayName.isEmpty()) // happens e.g. when guessing the TestConfiguration or error
|
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;
|
m_project = project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestConfiguration::setInternalTargets(const QSet<QString> &targets)
|
||||||
|
{
|
||||||
|
m_buildTargets = targets;
|
||||||
|
}
|
||||||
|
|
||||||
QString TestConfiguration::executableFilePath() const
|
QString TestConfiguration::executableFilePath() const
|
||||||
{
|
{
|
||||||
if (m_executableFile.isEmpty())
|
if (m_executableFile.isEmpty())
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
void setDisplayName(const QString &displayName);
|
void setDisplayName(const QString &displayName);
|
||||||
void setEnvironment(const Utils::Environment &env);
|
void setEnvironment(const Utils::Environment &env);
|
||||||
void setProject(ProjectExplorer::Project *project);
|
void setProject(ProjectExplorer::Project *project);
|
||||||
|
void setInternalTargets(const QSet<QString> &targets);
|
||||||
|
|
||||||
QStringList testCases() const { return m_testCases; }
|
QStringList testCases() const { return m_testCases; }
|
||||||
int testCaseCount() const { return m_testCaseCount; }
|
int testCaseCount() const { return m_testCaseCount; }
|
||||||
@@ -97,6 +98,7 @@ private:
|
|||||||
QPointer<ProjectExplorer::Project> m_project;
|
QPointer<ProjectExplorer::Project> m_project;
|
||||||
bool m_guessedConfiguration = false;
|
bool m_guessedConfiguration = false;
|
||||||
TestRunConfiguration *m_runConfig = 0;
|
TestRunConfiguration *m_runConfig = 0;
|
||||||
|
QSet<QString> m_buildTargets;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DebuggableTestConfiguration : public TestConfiguration
|
class DebuggableTestConfiguration : public TestConfiguration
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <utils/progressindicator.h>
|
#include <utils/progressindicator.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
|
#include <projectexplorer/buildmanager.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@@ -113,7 +114,8 @@ TestNavigationWidget::~TestNavigationWidget()
|
|||||||
|
|
||||||
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
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;
|
&& m_model->parser()->state() == TestCodeParser::Idle;
|
||||||
const bool hasTests = m_model->hasTests();
|
const bool hasTests = m_model->hasTests();
|
||||||
|
|
||||||
@@ -170,8 +172,6 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll);
|
connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll);
|
||||||
connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll);
|
connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll);
|
||||||
|
|
||||||
runAll->setEnabled(enabled && hasTests);
|
|
||||||
runSelected->setEnabled(enabled && hasTests);
|
|
||||||
selectAll->setEnabled(enabled && hasTests);
|
selectAll->setEnabled(enabled && hasTests);
|
||||||
deselectAll->setEnabled(enabled && hasTests);
|
deselectAll->setEnabled(enabled && hasTests);
|
||||||
rescan->setEnabled(enabled);
|
rescan->setEnabled(enabled);
|
||||||
|
|||||||
@@ -34,12 +34,14 @@
|
|||||||
#include "testcodeparser.h"
|
#include "testcodeparser.h"
|
||||||
|
|
||||||
#include <aggregation/aggregate.h>
|
#include <aggregation/aggregate.h>
|
||||||
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/find/basetextfind.h>
|
#include <coreplugin/find/basetextfind.h>
|
||||||
#include <coreplugin/find/itemviewfind.h>
|
#include <coreplugin/find/itemviewfind.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
@@ -511,7 +513,9 @@ void TestResultsPane::onTestRunStarted()
|
|||||||
m_testRunning = true;
|
m_testRunning = true;
|
||||||
m_stopTestRun->setEnabled(true);
|
m_stopTestRun->setEnabled(true);
|
||||||
m_runAll->setEnabled(false);
|
m_runAll->setEnabled(false);
|
||||||
|
Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(false);
|
||||||
m_runSelected->setEnabled(false);
|
m_runSelected->setEnabled(false);
|
||||||
|
Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(false);
|
||||||
m_summaryWidget->setVisible(false);
|
m_summaryWidget->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,8 +523,14 @@ void TestResultsPane::onTestRunFinished()
|
|||||||
{
|
{
|
||||||
m_testRunning = false;
|
m_testRunning = false;
|
||||||
m_stopTestRun->setEnabled(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();
|
updateSummaryLabel();
|
||||||
m_summaryWidget->setVisible(true);
|
m_summaryWidget->setVisible(true);
|
||||||
m_model->removeCurrentTestMessage();
|
m_model->removeCurrentTestMessage();
|
||||||
@@ -541,6 +551,7 @@ void TestResultsPane::updateRunActions()
|
|||||||
QString whyNot;
|
QString whyNot;
|
||||||
TestTreeModel *model = TestTreeModel::instance();
|
TestTreeModel *model = TestTreeModel::instance();
|
||||||
const bool enable = !m_testRunning && !model->parser()->isParsing() && model->hasTests()
|
const bool enable = !m_testRunning && !model->parser()->isParsing() && model->hasTests()
|
||||||
|
&& !ProjectExplorer::BuildManager::isBuilding()
|
||||||
&& ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject(
|
&& ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject(
|
||||||
ProjectExplorer::Constants::NORMAL_RUN_MODE, &whyNot);
|
ProjectExplorer::Constants::NORMAL_RUN_MODE, &whyNot);
|
||||||
m_runAll->setEnabled(enable);
|
m_runAll->setEnabled(enable);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "testtreeitem.h"
|
#include "testtreeitem.h"
|
||||||
|
|
||||||
#include <cplusplus/Icons.h>
|
#include <cplusplus/Icons.h>
|
||||||
|
#include <cpptools/cppmodelmanager.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#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()
|
void TestTreeItem::revalidateCheckState()
|
||||||
{
|
{
|
||||||
const Type ttiType = type();
|
const Type ttiType = type();
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ public:
|
|||||||
virtual TestTreeItem *find(const TestParseResult *result) = 0;
|
virtual TestTreeItem *find(const TestParseResult *result) = 0;
|
||||||
virtual bool modify(const TestParseResult *result) = 0;
|
virtual bool modify(const TestParseResult *result) = 0;
|
||||||
|
|
||||||
|
virtual QSet<QString> internalTargets() const;
|
||||||
protected:
|
protected:
|
||||||
typedef std::function<bool(const TestTreeItem *)> CompareFunction;
|
typedef std::function<bool(const TestTreeItem *)> CompareFunction;
|
||||||
TestTreeItem *findChildBy(CompareFunction compare) const;
|
TestTreeItem *findChildBy(CompareFunction compare) const;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString
|
|||||||
|
|
||||||
void AutotoolsProject::loadProjectTree()
|
void AutotoolsProject::loadProjectTree()
|
||||||
{
|
{
|
||||||
if (m_makefileParserThread != 0) {
|
if (m_makefileParserThread) {
|
||||||
// The thread is still busy parsing a previus configuration.
|
// The thread is still busy parsing a previus configuration.
|
||||||
// Wait until the thread has been finished and delete it.
|
// Wait until the thread has been finished and delete it.
|
||||||
// TODO: Discuss whether blocking is acceptable.
|
// 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
|
// The parsing has been cancelled by the user. Don't show any
|
||||||
// project data at all.
|
// project data at all.
|
||||||
m_makefileParserThread->deleteLater();
|
m_makefileParserThread->deleteLater();
|
||||||
m_makefileParserThread = 0;
|
m_makefileParserThread = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ void AutotoolsProject::makefileParsingFinished()
|
|||||||
// Apply sources to m_files, which are returned at AutotoolsProject::files()
|
// Apply sources to m_files, which are returned at AutotoolsProject::files()
|
||||||
const QFileInfo fileInfo = projectFilePath().toFileInfo();
|
const QFileInfo fileInfo = projectFilePath().toFileInfo();
|
||||||
const QDir dir = fileInfo.absoluteDir();
|
const QDir dir = fileInfo.absoluteDir();
|
||||||
QStringList files = m_makefileParserThread->sources();
|
const QStringList files = m_makefileParserThread->sources();
|
||||||
foreach (const QString& file, files)
|
foreach (const QString& file, files)
|
||||||
m_files.append(dir.absoluteFilePath(file));
|
m_files.append(dir.absoluteFilePath(file));
|
||||||
|
|
||||||
@@ -187,35 +187,36 @@ void AutotoolsProject::makefileParsingFinished()
|
|||||||
// has been changed, the project tree must be reparsed.
|
// has been changed, the project tree must be reparsed.
|
||||||
const QStringList makefiles = m_makefileParserThread->makefiles();
|
const QStringList makefiles = m_makefileParserThread->makefiles();
|
||||||
foreach (const QString &makefile, makefiles) {
|
foreach (const QString &makefile, makefiles) {
|
||||||
files.append(makefile);
|
const QString absMakefile = dir.absoluteFilePath(makefile);
|
||||||
|
|
||||||
const QString watchedFile = dir.absoluteFilePath(makefile);
|
m_files.append(absMakefile);
|
||||||
m_fileWatcher->addFile(watchedFile, Utils::FileSystemWatcher::WatchAllChanges);
|
|
||||||
m_watchedFiles.append(watchedFile);
|
m_fileWatcher->addFile(absMakefile, Utils::FileSystemWatcher::WatchAllChanges);
|
||||||
|
m_watchedFiles.append(absMakefile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add configure.ac file to project and watch for changes.
|
// Add configure.ac file to project and watch for changes.
|
||||||
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
||||||
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
|
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
|
||||||
if (configureAcFile.exists()) {
|
if (configureAcFile.exists()) {
|
||||||
files.append(configureAc);
|
const QString absConfigureAc = dir.absoluteFilePath(configureAc);
|
||||||
const QString configureAcFilePath = dir.absoluteFilePath(configureAc);
|
m_files.append(absConfigureAc);
|
||||||
m_fileWatcher->addFile(configureAcFilePath, Utils::FileSystemWatcher::WatchAllChanges);
|
|
||||||
m_watchedFiles.append(configureAcFilePath);
|
m_fileWatcher->addFile(absConfigureAc, Utils::FileSystemWatcher::WatchAllChanges);
|
||||||
|
m_watchedFiles.append(absConfigureAc);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newRoot = new AutotoolsProjectNode(projectDirectory());
|
auto newRoot = new AutotoolsProjectNode(projectDirectory());
|
||||||
for (const QString &f : files) {
|
for (const QString &f : m_files) {
|
||||||
const Utils::FileName path = Utils::FileName::fromString(dir.absoluteFilePath(f));
|
const Utils::FileName path = Utils::FileName::fromString(f);
|
||||||
FileType ft = (f == "Makefile.am" || f == "configure.ac") ? FileType::Project : FileType::Resource;
|
newRoot->addNestedNode(new FileNode(path, FileNode::fileTypeForFileName(path), false));
|
||||||
newRoot->addNestedNode(new FileNode(path, ft, false));
|
|
||||||
}
|
}
|
||||||
setRootProjectNode(newRoot);
|
setRootProjectNode(newRoot);
|
||||||
|
|
||||||
updateCppCodeModel();
|
updateCppCodeModel();
|
||||||
|
|
||||||
m_makefileParserThread->deleteLater();
|
m_makefileParserThread->deleteLater();
|
||||||
m_makefileParserThread = 0;
|
m_makefileParserThread = nullptr;
|
||||||
|
|
||||||
emit parsingFinished();
|
emit parsingFinished();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,6 +334,8 @@ QList<CMakeBuildTarget> BuildDirManager::buildTargets() const
|
|||||||
m_buildTargets.append(utilityTarget(CMakeBuildStep::allTarget(), this));
|
m_buildTargets.append(utilityTarget(CMakeBuildStep::allTarget(), this));
|
||||||
m_buildTargets.append(utilityTarget(CMakeBuildStep::cleanTarget(), this));
|
m_buildTargets.append(utilityTarget(CMakeBuildStep::cleanTarget(), this));
|
||||||
m_buildTargets.append(utilityTarget(CMakeBuildStep::installTarget(), this));
|
m_buildTargets.append(utilityTarget(CMakeBuildStep::installTarget(), this));
|
||||||
|
m_buildTargets.append(utilityTarget(CMakeBuildStep::testTarget(), this));
|
||||||
|
|
||||||
m_buildTargets.append(m_reader->buildTargets());
|
m_buildTargets.append(m_reader->buildTargets());
|
||||||
}
|
}
|
||||||
return m_buildTargets;
|
return m_buildTargets;
|
||||||
|
|||||||
@@ -404,9 +404,14 @@ QString CMakeBuildStep::installTarget()
|
|||||||
return QString("install");
|
return QString("install");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CMakeBuildStep::testTarget()
|
||||||
|
{
|
||||||
|
return QString("test");
|
||||||
|
}
|
||||||
|
|
||||||
QStringList CMakeBuildStep::specialTargets()
|
QStringList CMakeBuildStep::specialTargets()
|
||||||
{
|
{
|
||||||
return { allTarget(), cleanTarget(), installTarget() };
|
return { allTarget(), cleanTarget(), installTarget(), testTarget() };
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public:
|
|||||||
static QString cleanTarget();
|
static QString cleanTarget();
|
||||||
static QString allTarget();
|
static QString allTarget();
|
||||||
static QString installTarget();
|
static QString installTarget();
|
||||||
|
static QString testTarget();
|
||||||
static QStringList specialTargets();
|
static QStringList specialTargets();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -498,8 +498,10 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
|
|||||||
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType)
|
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType)
|
||||||
deploymentData.addFile(ct.executable.toString(), deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()), DeployableFile::TypeExecutable);
|
deploymentData.addFile(ct.executable.toString(), deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()), DeployableFile::TypeExecutable);
|
||||||
if (ct.targetType == ExecutableType) {
|
if (ct.targetType == ExecutableType) {
|
||||||
|
FileName srcWithTrailingSlash = FileName::fromString(ct.sourceDirectory.toString());
|
||||||
|
srcWithTrailingSlash.appendString('/');
|
||||||
// TODO: Put a path to corresponding .cbp file into projectFilePath?
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, Core::I
|
|||||||
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
||||||
const QString title(buildTargetFromId(id));
|
const QString title(buildTargetFromId(id));
|
||||||
const CMakeBuildTarget &ct = project->buildTargetForTitle(title);
|
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
|
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)
|
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)
|
QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id)
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps)
|
|||||||
|
|
||||||
CppTools::RawProjectPart rpp;
|
CppTools::RawProjectPart rpp;
|
||||||
rpp.setProjectFileLocation(fg->target->sourceDirectory.toString() + "/CMakeLists.txt");
|
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.setDisplayName(fg->target->name + QString::number(counter));
|
||||||
rpp.setDefines(defineArg.toUtf8());
|
rpp.setDefines(defineArg.toUtf8());
|
||||||
rpp.setIncludePaths(includes);
|
rpp.setIncludePaths(includes);
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ void TeaLeafReader::updateCodeModel(CppTools::RawProjectParts &rpps)
|
|||||||
includePaths += m_parameters.buildDirectory.toString();
|
includePaths += m_parameters.buildDirectory.toString();
|
||||||
CppTools::RawProjectPart rpp;
|
CppTools::RawProjectPart rpp;
|
||||||
rpp.setProjectFileLocation(QString()); // No project file information available!
|
rpp.setProjectFileLocation(QString()); // No project file information available!
|
||||||
rpp.setBuildSystemTarget(cbt.title);
|
rpp.setBuildSystemTarget(cbt.title + '|');
|
||||||
rpp.setIncludePaths(includePaths);
|
rpp.setIncludePaths(includePaths);
|
||||||
|
|
||||||
CppTools::RawProjectPartFlags cProjectFlags;
|
CppTools::RawProjectPartFlags cProjectFlags;
|
||||||
|
|||||||
@@ -94,21 +94,6 @@ public:
|
|||||||
return nullptr;
|
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()
|
void clearCache()
|
||||||
{
|
{
|
||||||
m_cachedMatches.clear();
|
m_cachedMatches.clear();
|
||||||
|
|||||||
@@ -588,7 +588,8 @@ public:
|
|||||||
for (Scope::iterator it = clazz->memberBegin(); it != clazz->memberEnd(); ++it) {
|
for (Scope::iterator it = clazz->memberBegin(); it != clazz->memberEnd(); ++it) {
|
||||||
if (const Function *func = (*it)->type()->asFunctionType()) {
|
if (const Function *func = (*it)->type()->asFunctionType()) {
|
||||||
// Filter virtual destructors
|
// Filter virtual destructors
|
||||||
if (func->name()->asDestructorNameId())
|
const Name *name = func->name();
|
||||||
|
if (!name || name->asDestructorNameId())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const Function *firstVirtual = 0;
|
const Function *firstVirtual = 0;
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ void CompilerOptionsBuilder::addDefineFloat128ForMingw()
|
|||||||
// CLANG-UPGRADE-CHECK: Workaround still needed?
|
// CLANG-UPGRADE-CHECK: Workaround still needed?
|
||||||
// https://llvm.org/bugs/show_bug.cgi?id=30685
|
// https://llvm.org/bugs/show_bug.cgi?id=30685
|
||||||
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
|
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
|
||||||
addDefine("#define __float128 void");
|
addDefine("#define __float128 short");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CompilerOptionsBuilder::includeDirOption() const
|
QString CompilerOptionsBuilder::includeDirOption() const
|
||||||
|
|||||||
@@ -27,6 +27,10 @@
|
|||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class FileName;
|
class FileName;
|
||||||
class MimeType;
|
class MimeType;
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ QList<ProjectExplorer::RunConfiguration *> QbsProductNode::runConfigurations() c
|
|||||||
QbsRunConfiguration *qbsRc = qobject_cast<QbsRunConfiguration *>(rc);
|
QbsRunConfiguration *qbsRc = qobject_cast<QbsRunConfiguration *>(rc);
|
||||||
if (!qbsRc)
|
if (!qbsRc)
|
||||||
continue;
|
continue;
|
||||||
if (qbsRc->buildSystemTarget() == QbsProject::uniqueProductName(qbsProductData()))
|
if (qbsRc->uniqueProductName() == QbsProject::uniqueProductName(qbsProductData()))
|
||||||
result << qbsRc;
|
result << qbsRc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ QbsProject::~QbsProject()
|
|||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = 0;
|
||||||
}
|
}
|
||||||
qDeleteAll(m_extraCompilers);
|
qDeleteAll(m_extraCompilers);
|
||||||
|
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
|
||||||
|
[](Core::IDocument *doc) { doc->deleteLater(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
QbsRootProjectNode *QbsProject::rootProjectNode() const
|
QbsRootProjectNode *QbsProject::rootProjectNode() const
|
||||||
@@ -974,7 +976,7 @@ void QbsProject::updateCppCodeModel()
|
|||||||
rpp.setDisplayName(grp.name());
|
rpp.setDisplayName(grp.name());
|
||||||
rpp.setProjectFileLocation(grp.location().filePath(),
|
rpp.setProjectFileLocation(grp.location().filePath(),
|
||||||
grp.location().line(), grp.location().column());
|
grp.location().line(), grp.location().column());
|
||||||
rpp.setBuildSystemTarget(uniqueProductName(prd));
|
rpp.setBuildSystemTarget(prd.name() + '|' + rpp.projectFile);
|
||||||
|
|
||||||
QHash<QString, qbs::ArtifactData> filePathToSourceArtifact;
|
QHash<QString, qbs::ArtifactData> filePathToSourceArtifact;
|
||||||
bool hasCFiles = false;
|
bool hasCFiles = false;
|
||||||
|
|||||||
@@ -300,6 +300,11 @@ void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString QbsRunConfiguration::buildSystemTarget() const
|
QString QbsRunConfiguration::buildSystemTarget() const
|
||||||
|
{
|
||||||
|
return productDisplayNameFromId(id());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QbsRunConfiguration::uniqueProductName() const
|
||||||
{
|
{
|
||||||
return m_uniqueProductName;
|
return m_uniqueProductName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
void addToBaseEnvironment(Utils::Environment &env) const;
|
void addToBaseEnvironment(Utils::Environment &env) const;
|
||||||
|
|
||||||
QString buildSystemTarget() const final;
|
QString buildSystemTarget() const final;
|
||||||
|
QString uniqueProductName() const;
|
||||||
bool isConsoleApplication() const;
|
bool isConsoleApplication() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ void QmakeProject::updateCppCodeModel()
|
|||||||
CppTools::RawProjectPart rpp;
|
CppTools::RawProjectPart rpp;
|
||||||
rpp.setDisplayName(pro->displayName());
|
rpp.setDisplayName(pro->displayName());
|
||||||
rpp.setProjectFileLocation(pro->filePath().toString());
|
rpp.setProjectFileLocation(pro->filePath().toString());
|
||||||
rpp.setBuildSystemTarget(pro->targetInformation().target);
|
rpp.setBuildSystemTarget(pro->targetInformation().target + '|' + rpp.projectFile);
|
||||||
// TODO: Handle QMAKE_CFLAGS
|
// TODO: Handle QMAKE_CFLAGS
|
||||||
rpp.setFlagsForCxx({cxxToolChain, pro->variableValue(Variable::CppFlags)});
|
rpp.setFlagsForCxx({cxxToolChain, pro->variableValue(Variable::CppFlags)});
|
||||||
rpp.setDefines(pro->cxxDefines());
|
rpp.setDefines(pro->cxxDefines());
|
||||||
|
|||||||
@@ -95,13 +95,22 @@ void QmakeManager::addLibrary()
|
|||||||
|
|
||||||
void QmakeManager::addLibraryContextMenu()
|
void QmakeManager::addLibraryContextMenu()
|
||||||
{
|
{
|
||||||
|
QString projectPath;
|
||||||
|
|
||||||
Node *node = contextNode();
|
Node *node = contextNode();
|
||||||
if (dynamic_cast<QmakeProFileNode *>(node))
|
if (ContainerNode *cn = node->asContainerNode())
|
||||||
addLibraryImpl(node->filePath().toString(), nullptr);
|
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)
|
void QmakeManager::addLibraryImpl(const QString &fileName, BaseTextEditor *editor)
|
||||||
{
|
{
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
Internal::AddLibraryWizard wizard(fileName, Core::ICore::dialogParent());
|
Internal::AddLibraryWizard wizard(fileName, Core::ICore::dialogParent());
|
||||||
if (wizard.exec() != QDialog::Accepted)
|
if (wizard.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -225,19 +225,18 @@ bool QMakeStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
m_makeArguments.clear();
|
m_makeArguments.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString makefile = workingDirectory;
|
QString makefile = workingDirectory + '/';
|
||||||
|
|
||||||
if (qmakeBc->subNodeBuild()) {
|
if (qmakeBc->subNodeBuild()) {
|
||||||
QmakeProFile *pro = qmakeBc->subNodeBuild()->proFile();
|
QmakeProFile *pro = qmakeBc->subNodeBuild()->proFile();
|
||||||
if (pro && !pro->makefile().isEmpty())
|
if (pro && !pro->makefile().isEmpty())
|
||||||
makefile.append(pro->makefile());
|
makefile.append(pro->makefile());
|
||||||
else
|
else
|
||||||
makefile.append(QLatin1String("/Makefile"));
|
makefile.append("Makefile");
|
||||||
} else if (!qmakeBc->makefile().isEmpty()) {
|
} else if (!qmakeBc->makefile().isEmpty()) {
|
||||||
makefile.append(QLatin1Char('/'));
|
|
||||||
makefile.append(qmakeBc->makefile());
|
makefile.append(qmakeBc->makefile());
|
||||||
} else {
|
} else {
|
||||||
makefile.append(QLatin1String("/Makefile"));
|
makefile.append("Makefile");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether we need to run qmake
|
// Check whether we need to run qmake
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ bool UpdateInfoPlugin::initialize(const QStringList & /* arguments */, QString *
|
|||||||
addAutoReleasedObject(new SettingsPage(this));
|
addAutoReleasedObject(new SettingsPage(this));
|
||||||
|
|
||||||
QAction *checkForUpdatesAction = new QAction(tr("Check for Updates"), this);
|
QAction *checkForUpdatesAction = new QAction(tr("Check for Updates"), this);
|
||||||
|
checkForUpdatesAction->setMenuRole(QAction::ApplicationSpecificRole);
|
||||||
Core::Command *checkForUpdatesCommand = Core::ActionManager::registerAction(checkForUpdatesAction, "Updates.CheckForUpdates");
|
Core::Command *checkForUpdatesCommand = Core::ActionManager::registerAction(checkForUpdatesAction, "Updates.CheckForUpdates");
|
||||||
connect(checkForUpdatesAction, &QAction::triggered, this, &UpdateInfoPlugin::startCheckForUpdates);
|
connect(checkForUpdatesAction, &QAction::triggered, this, &UpdateInfoPlugin::startCheckForUpdates);
|
||||||
ActionContainer *const helpContainer = ActionManager::actionContainer(Core::Constants::M_HELP);
|
ActionContainer *const helpContainer = ActionManager::actionContainer(Core::Constants::M_HELP);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/session.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -722,22 +723,10 @@ QIcon VcsBaseSubmitEditor::submitIcon()
|
|||||||
void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory,
|
void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory,
|
||||||
QStringList *untrackedFiles)
|
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);
|
const QDir repoDir(repositoryDirectory);
|
||||||
for (QStringList::iterator it = untrackedFiles->begin(); it != untrackedFiles->end(); ) {
|
for (QStringList::iterator it = untrackedFiles->begin(); it != untrackedFiles->end(); ) {
|
||||||
const QString path = repoDir.absoluteFilePath(*it);
|
const QString path = repoDir.absoluteFilePath(*it);
|
||||||
if (projectFiles.contains(path))
|
if (ProjectExplorer::SessionManager::projectForFile(FileName::fromString(path)))
|
||||||
++it;
|
++it;
|
||||||
else
|
else
|
||||||
it = untrackedFiles->erase(it);
|
it = untrackedFiles->erase(it);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QOpenGLWidget>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -310,6 +311,12 @@ WelcomeMode::WelcomeMode()
|
|||||||
layout->addWidget(new StyledBar(m_modeWidget));
|
layout->addWidget(new StyledBar(m_modeWidget));
|
||||||
layout->addItem(hbox);
|
layout->addItem(hbox);
|
||||||
|
|
||||||
|
if (Utils::HostOsInfo::isMacHost()) { // workaround QTBUG-61384
|
||||||
|
auto openglWidget = new QOpenGLWidget;
|
||||||
|
openglWidget->hide();
|
||||||
|
layout->addWidget(openglWidget);
|
||||||
|
}
|
||||||
|
|
||||||
setWidget(m_modeWidget);
|
setWidget(m_modeWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,8 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QVersionNumber>
|
||||||
|
|
||||||
#ifdef MOBILE_DEV_DIRECT_LINK
|
#ifdef MOBILE_DEV_DIRECT_LINK
|
||||||
#include "MobileDevice.h"
|
#include "MobileDevice.h"
|
||||||
@@ -259,6 +261,100 @@ static QString mobileDeviceErrorString(MobileDeviceLib *lib, am_res_t code)
|
|||||||
return s;
|
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" {
|
extern "C" {
|
||||||
typedef void (*DeviceAvailableCallback)(QString deviceId, AMDeviceRef, void *userData);
|
typedef void (*DeviceAvailableCallback)(QString deviceId, AMDeviceRef, void *userData);
|
||||||
}
|
}
|
||||||
@@ -309,7 +405,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool developerDiskImagePath(QString *path, QString *signaturePath);
|
bool developerDiskImagePath(QString *path, QString *signaturePath);
|
||||||
bool findDeveloperDiskImage(QString *diskImagePath, QString versionString, QString buildString);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool checkRead(qptrdiff nRead, int &maxRetry);
|
bool checkRead(qptrdiff nRead, int &maxRetry);
|
||||||
@@ -1232,7 +1327,6 @@ MobileDeviceLib *CommandSession::lib()
|
|||||||
|
|
||||||
bool CommandSession::developerDiskImagePath(QString *path, QString *signaturePath)
|
bool CommandSession::developerDiskImagePath(QString *path, QString *signaturePath)
|
||||||
{
|
{
|
||||||
bool success = false;
|
|
||||||
if (device && path && connectDevice()) {
|
if (device && path && connectDevice()) {
|
||||||
CFPropertyListRef cfProductVersion = lib()->deviceCopyValue(device, 0, CFSTR("ProductVersion"));
|
CFPropertyListRef cfProductVersion = lib()->deviceCopyValue(device, 0, CFSTR("ProductVersion"));
|
||||||
QString versionString;
|
QString versionString;
|
||||||
@@ -1249,80 +1343,17 @@ bool CommandSession::developerDiskImagePath(QString *path, QString *signaturePat
|
|||||||
CFRelease(cfBuildVersion);
|
CFRelease(cfBuildVersion);
|
||||||
disconnectDevice();
|
disconnectDevice();
|
||||||
|
|
||||||
if (findDeveloperDiskImage(path, versionString, buildString)) {
|
if (findDeveloperDiskImage(versionString, buildString, path)) {
|
||||||
success = QFile::exists(*path);
|
if (debugAll)
|
||||||
if (success && debugAll)
|
|
||||||
qDebug() << "Developers disk image found at" << path;
|
qDebug() << "Developers disk image found at" << path;
|
||||||
if (success && signaturePath) {
|
if (signaturePath) {
|
||||||
*signaturePath = QString("%1.%2").arg(*path).arg("signature");
|
*signaturePath = QString("%1.%2").arg(*path).arg("signature");
|
||||||
success = QFile::exists(*signaturePath);
|
return QFile::exists(*signaturePath);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppOpSession::AppOpSession(const QString &deviceId, const QString &bundlePath,
|
AppOpSession::AppOpSession(const QString &deviceId, const QString &bundlePath,
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ def addHighlighterDefinition(language):
|
|||||||
clickItem(table, "%d/0" % row, 5, 5, 0, Qt.LeftButton)
|
clickItem(table, "%d/0" % row, 5, 5, 0, Qt.LeftButton)
|
||||||
clickButton("{name='downloadButton' text='Download Selected Definitions' "
|
clickButton("{name='downloadButton' text='Download Selected Definitions' "
|
||||||
"type='QPushButton' visible='1'}")
|
"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",
|
languageFile = os.path.join(tmpSettingsDir, "QtProject", "qtcreator",
|
||||||
"generic-highlighter", "%s.xml"
|
"generic-highlighter", "%s.xml"
|
||||||
% language.lower().replace(" ", "-"))
|
% language.lower().replace(" ", "-"))
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ def main():
|
|||||||
return
|
return
|
||||||
progressBarWait(30000)
|
progressBarWait(30000)
|
||||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
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):
|
if not cmakeSupportsServerMode() and JIRA.isBugStillOpen(18290):
|
||||||
test.xfail("Building with cmake in Tealeafreader mode may fail", "QTCREATORBUG-18290")
|
test.xfail("Building with cmake in Tealeafreader mode may fail", "QTCREATORBUG-18290")
|
||||||
|
|||||||
281
tests/system/suite_general/tst_cmake_speedcrunch/testdata/projecttree_speedcrunch_server.tsv
vendored
Normal file
281
tests/system/suite_general/tst_cmake_speedcrunch/testdata/projecttree_speedcrunch_server.tsv
vendored
Normal 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"
|
||||||
|
Reference in New Issue
Block a user