Commit 90cf4487 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.1'

 Conflicts:
	src/plugins/autotest/qtest/qttestoutputreader.cpp

Change-Id: I4b323f2f3041d015fa04b9a25ec925f3b3e2411f
parents f036877a 8902fbc6
......@@ -19,15 +19,14 @@ makeAbsolute() {
me=`which "$0"` # Search $PATH if necessary
if test -L "$me"; then
# Try readlink(1)
readlink=`type readlink 2>/dev/null` || readlink=
if test -n "$readlink"; then
# We have readlink(1), so we can use it. Assuming GNU readlink (for -f).
me=`readlink -nf "$me"`
# Try GNU readlink(1)
nme=`readlink -nf "$me" 2>/dev/null`
if test -n "$nme"; then
me=$nme
else
# No readlink(1), so let's try ls -l
me=`ls -l "$me" | sed 's/^.*-> //'`
# No GNU readlink(1), so let's try ls -l
base=`dirname "$me"`
me=`ls -l "$me" | sed 's/^.*-> //'`
me=`makeAbsolute "$me" "$base"`
fi
fi
......
......@@ -516,8 +516,12 @@ void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths,
void PluginDumper::runQmlDump(const QmlJS::ModelManagerInterface::ProjectInfo &info,
const QStringList &arguments, const QString &importPath)
{
QDir wd = QDir(importPath);
wd.cdUp();
QProcess *process = new QProcess(this);
process->setEnvironment(info.qmlDumpEnvironment.toStringList());
QString workingDir = wd.canonicalPath();
process->setWorkingDirectory(workingDir);
connect(process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
this, &PluginDumper::qmlPluginTypeDumpDone);
connect(process, &QProcess::errorOccurred, this, &PluginDumper::qmlPluginTypeDumpError);
......@@ -567,7 +571,7 @@ void PluginDumper::dump(const Plugin &plugin)
args << QLatin1String("-nonrelocatable");
args << plugin.importUri;
args << plugin.importVersion;
args << plugin.importPath;
args << (plugin.importPath.isEmpty() ? QLatin1String(".") : plugin.importPath);
runQmlDump(info, args, plugin.qmldirPath);
}
......
......@@ -195,7 +195,7 @@ void QtTestOutputReader::processOutput(const QByteArray &outputLine)
m_lineNumber = attributes.value(QStringLiteral("line")).toInt();
} else if (currentTag == QStringLiteral("BenchmarkResult")) {
const QXmlStreamAttributes &attributes = m_xmlReader.attributes();
const QString metric = attributes.value(QStringLiteral("metrics")).toString();
const QString metric = attributes.value(QStringLiteral("metric")).toString();
const double value = attributes.value(QStringLiteral("value")).toDouble();
const int iterations = attributes.value(QStringLiteral("iterations")).toInt();
m_description = constructBenchmarkInformation(metric, value, iterations);
......
......@@ -1782,7 +1782,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_modeWindow = createModeWindow(Constants::MODE_DEBUG, m_mainWindow);
m_mode->setWidget(m_modeWindow);
m_plugin->addAutoReleasedObject(new DebugModeContext(m_mainWindow));
m_plugin->addAutoReleasedObject(new DebugModeContext(m_modeWindow));
m_plugin->addObject(m_mode);
......
......@@ -178,6 +178,8 @@ void MacroManager::MacroManagerPrivate::removeMacro(const QString &name)
// Remove macro from the map
Macro *macro = macros.take(name);
if (macro == currentMacro)
currentMacro = 0;
delete macro;
}
......
......@@ -39,6 +39,7 @@ WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runCon
m_runControls(runControls)
{
setWindowTitle(tr("Waiting for Applications to Stop"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto layout = new QVBoxLayout();
setLayout(layout);
......
......@@ -494,22 +494,6 @@ void QbsProject::handleQbsParsingDone(bool success)
m_qbsUpdateFutureInterface->reportCanceled();
}
bool hasTargetArtifacts = false;
if (dataChanged) {
qCDebug(qbsPmLog) << "Project data changed.";
foreach (const qbs::ProductData &product, m_projectData.allProducts()) {
if (!product.targetArtifacts().isEmpty()) {
hasTargetArtifacts = true;
break;
}
}
if (!hasTargetArtifacts) {
qCDebug(qbsPmLog) << "No target artifacts present, executing rules";
m_qbsProjectParser->startRuleExecution();
return;
}
}
m_qbsProjectParser->deleteLater();
m_qbsProjectParser = 0;
m_qbsUpdateFutureInterface->reportFinished();
......
......@@ -111,8 +111,9 @@ void FlameGraphModelTest::testIndex()
void FlameGraphModelTest::testCounts()
{
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.rowCount(), 2);
QCOMPARE(model.rowCount(model.index(0, 0)), 1);
QCOMPARE(model.rowCount(model.index(1, 0)), 1);
QCOMPARE(model.columnCount(), 1);
}
......@@ -122,40 +123,65 @@ void FlameGraphModelTest::testData()
FlameGraphModel::tr("JavaScript"),
FlameGraphModel::tr("Signal"),
FlameGraphModel::tr("Binding"),
FlameGraphModel::tr("Create"),
FlameGraphModel::tr("Compile"),
FlameGraphModel::tr("Create")
});
QModelIndex index = model.index(0, 0);
QModelIndex index2 = model.index(1, 0);
QCOMPARE(model.data(index, FlameGraphModel::TypeIdRole).toInt(), 0);
QCOMPARE(model.data(index2, FlameGraphModel::TypeIdRole).toInt(), 4);
QCOMPARE(model.data(index, FlameGraphModel::TypeRole).toString(),
FlameGraphModel::tr("JavaScript"));
QCOMPARE(model.data(index2, FlameGraphModel::TypeRole).toString(),
FlameGraphModel::tr("Compile"));
QCOMPARE(model.data(index, FlameGraphModel::DurationRole).toLongLong(), 20);
QCOMPARE(model.data(index2, FlameGraphModel::DurationRole).toLongLong(), 12);
QCOMPARE(model.data(index, FlameGraphModel::CallCountRole).toInt(), 1);
QCOMPARE(model.data(index2, FlameGraphModel::CallCountRole).toInt(), 1);
QCOMPARE(model.data(index, FlameGraphModel::DetailsRole).toString(),
QLatin1String("funcfunc"));
QCOMPARE(model.data(index2, FlameGraphModel::DetailsRole).toString(),
QLatin1String("funcfunc"));
QCOMPARE(model.data(index, FlameGraphModel::FilenameRole).toString(),
QLatin1String("somefile.js"));
QCOMPARE(model.data(index2, FlameGraphModel::FilenameRole).toString(),
QLatin1String("somefile.js"));
QCOMPARE(model.data(index, FlameGraphModel::LineRole).toInt(), 0);
QCOMPARE(model.data(index2, FlameGraphModel::LineRole).toInt(), 4);
QCOMPARE(model.data(index, FlameGraphModel::ColumnRole).toInt(), 20);
QCOMPARE(model.data(index2, FlameGraphModel::ColumnRole).toInt(), 16);
QCOMPARE(model.data(index, FlameGraphModel::NoteRole).toString(), QString("dings"));
QCOMPARE(model.data(index2, FlameGraphModel::NoteRole).toString(), QString());
QCOMPARE(model.data(index, FlameGraphModel::TimePerCallRole).toLongLong(), 20);
QCOMPARE(model.data(index, FlameGraphModel::TimeInPercentRole).toInt(), 100);
QCOMPARE(model.data(index2, FlameGraphModel::TimePerCallRole).toLongLong(), 12);
QCOMPARE(model.data(index, FlameGraphModel::TimeInPercentRole).toInt(), 62);
QCOMPARE(model.data(index2, FlameGraphModel::TimeInPercentRole).toInt(), 37);
QCOMPARE(model.data(index, FlameGraphModel::RangeTypeRole).toInt(),
static_cast<int>(Javascript));
QCOMPARE(model.data(index2, FlameGraphModel::RangeTypeRole).toInt(),
static_cast<int>(Compiling));
QCOMPARE(model.data(index, FlameGraphModel::LocationRole).toString(),
QLatin1String("somefile.js:0"));
QCOMPARE(model.data(index2, FlameGraphModel::LocationRole).toString(),
QLatin1String("somefile.js:4"));
QVERIFY(!model.data(index, -10).isValid());
QVERIFY(!model.data(index2, -10).isValid());
QVERIFY(!model.data(QModelIndex(), FlameGraphModel::LineRole).isValid());
for (int i = 1; i < 10; ++i) {
for (int i = 1; i < 8; ++i) {
index = model.index(0, 0, index);
QCOMPARE(model.data(index, FlameGraphModel::TypeRole).toString(),
typeRoles[i % typeRoles.length()]);
QCOMPARE(model.data(index, FlameGraphModel::NoteRole).toString(),
(i % typeRoles.length() == 0) ? QString("dings") : QString());
}
QCOMPARE(model.data(index, FlameGraphModel::CallCountRole).toInt(), 2);
QCOMPARE(model.data(index, FlameGraphModel::CallCountRole).toInt(), 1);
index2 = model.index(0, 0, index2);
QCOMPARE(model.data(index2, FlameGraphModel::TypeRole).toString(),
FlameGraphModel::tr("Compile"));
QCOMPARE(model.data(index2, FlameGraphModel::NoteRole).toString(), QString());
QCOMPARE(model.data(index2, FlameGraphModel::CallCountRole).toInt(), 2);
}
void FlameGraphModelTest::testRoleNames()
......
......@@ -344,20 +344,10 @@ def validateSearchResult(expectedCount):
def invokeContextMenuItem(editorArea, command1, command2 = None):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
snooze(1)
if platform.system() == 'Darwin':
item1 = waitForObjectItem(ctxtMenu, command1)
subMenu = item1.menu()
activateItem(item1)
# subMenu could have been triggered by hovering, but closed again by clicking
if subMenu and not subMenu.visible:
activateItem(item1)
if command2:
activateItem(subMenu, command2)
else:
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000))
if command2:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}"
% (command1, objectMap.realName(ctxtMenu)), command2, 2000))
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000))
if command2:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}"
% (command1, objectMap.realName(ctxtMenu)), command2, 2000))
# this function invokes the "Find Usages" item from context menu
# param editor an editor object
......
......@@ -85,9 +85,9 @@ def main():
target=targets)
virtualFunctionsAdded = False
for kit, config in iterateBuildConfigs(len(checkedTargets), "Debug"):
is480Kit = "480" in Targets.getStringForTarget(checkedTargets[kit])
verifyBuildConfig(len(checkedTargets), kit, config, True, True)
if (virtualFunctionsAdded and platform.system() in ('Microsoft', 'Windows')
and "480" in Targets.getStringForTarget(checkedTargets[kit])):
if virtualFunctionsAdded and platform.system() in ('Microsoft', 'Windows') and is480Kit:
test.warning("Skipping building of Qt4.8 targets because of QTCREATORBUG-12251.")
continue
invokeMenuItem('Build', 'Build Project "%s"' % projectName)
......@@ -125,12 +125,14 @@ def main():
addReturn(editor, "QObject \*%s::create.*" % className, "0")
virtualFunctionsAdded = True
invokeMenuItem('File', 'Save All')
if (platform.system() in ('Microsoft', 'Windows') # QTCREATORBUG-12251
and "480" in Targets.getStringForTarget(checkedTargets[kit])):
if platform.system() in ('Microsoft', 'Windows') and is480Kit: # QTCREATORBUG-12251
test.warning("Skipping building of Qt4.8 targets because of QTCREATORBUG-12251.")
continue
invokeMenuItem('Build', 'Rebuild Project "%s"' % projectName)
waitForCompile(10000)
if platform.system() == "Darwin" and is480Kit:
test.log("Skipping compile check (gcc on OSX is only clang with gcc frontend nowadays)")
continue
checkCompile()
invokeMenuItem("File", "Exit")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment