Commit c01ddc46 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.4'

 Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsproject.h

Change-Id: I6b9cdf704be95ade02488c8b19582b6621282fb8
parents 712297cb 36968528
doc/images/qtcreator-autotests.png

20.1 KB | W: | H:

doc/images/qtcreator-autotests.png

68.1 KB | W: | H:

doc/images/qtcreator-autotests.png
doc/images/qtcreator-autotests.png
doc/images/qtcreator-autotests.png
doc/images/qtcreator-autotests.png
  • 2-up
  • Swipe
  • Onion skin
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
......@@ -131,6 +131,9 @@
\endlist
\QC creates the test in the specified project directory.
For more information about creating Google tests, see the
\l{https://github.com/google/googletest/blob/master/googletest/docs/Primer.md}
{Google Test Primer}.
\section1 Setting Up the Google C++ Testing Framework
......@@ -175,28 +178,6 @@
\li \c {LIBS += -lgmock -L<path_to_gmock_lib>}
\endlist
To specify settings for running Google tests, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Google Test}.
\image qtcreator-autotests-options-google.png
To run disabled tests, select the \uicontrol {Run disabled tests} check box.
To run several iterations of the tests, select the \uicontrol {Repeat tests}
check box and enter the number of times the tests should be run in the
\uicontrol Iterations field. To make sure that the tests are independent and
repeatable, you can run them in a different order each time by selecting the
\uicontrol {Shuffle tests} check box.
To turn failures into debugger breakpoints, select the
\uicontrol {Break on failure while debugging} check box. To turn assertion
failures into C++ exceptions, select the \uicontrol {Throw on failure} check
box.
For more information about creating Google tests, see the
\l{https://github.com/google/googletest/blob/master/googletest/docs/Primer.md}
{Google Test Primer}.
\section1 Building and Running Tests
To build and run tests:
......@@ -205,16 +186,14 @@
\li Open a project that contains tests.
\li In the \uicontrol Tests view, select the tests to run.
\li In the \uicontrol {Test Results} output pane, select
\inlineimage run_small.png
(\uicontrol {Run All Tests}) to run all test or
\inlineimage qtcreator-run-selected-tests.png
(\uicontrol {Run Selected Tests}) to run the selected tests.
You can select the tests to run in the \uicontrol Tests view in the
\uicontrol Projects pane. For more information, see
\l{Viewing Tests}.
\note By default, \QC builds a project before deploying and running
it.
......@@ -224,10 +203,40 @@
stop the test execution. To increase the timeout, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol General.
\image qtcreator-autotests-options.png
\section2 Selecting Tests to Run
The \uicontrol Tests view shows all the tests found for the currently active
test frameworks in the current project. Select the test cases to run.
\image qtcreator-tests-view.png
If a Qt Quick test case does not have a name, it is marked
\uicontrol Unnamed in the list. Unnamed test cases are executed when you
select \uicontrol {Run All Tests}. You cannot select or deselect them.
\QC scans the project for tests when you open the project and updates the
test list for the currently active test frameworks when you edit tests.
To refresh the view, select \uicontrol {Rescan Tests} in the context menu.
You can add filters to specify the directories within the current project
to scan for tests. Select \uicontrol Tools > \uicontrol Options >
\uicontrol {Test Settings} > \uicontrol General > \uicontrol Add, and
specify paths to the directories to scan for tests. Wildcards are not
supported in the filter expressions.
\image qtcreator-autotests-options.png
To show or hide init and cleanup or data functions in the \uicontrol Tests
view, select \inlineimage filtericon.png
(\uicontrol {Filter Test Tree}), and then select \uicontrol {Show Init and
Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a
function in the list to open its source code in the code editor.
The test cases are listed in alphabetic order. To list them in the order in
which they are defined in the source code, select \inlineimage leafsort.png
(\uicontrol {Sort Naturally}).
\section2 Specifying Settings for Running Qt Tests
The code inside a benchmark test is measured, and possibly also repeated
several times in order to get an accurate measurement. This depends on the
......@@ -239,12 +248,52 @@
\image qtcreator-autotests-options-qt.png
To receive verbose output when running benchmarks, select the
\uicontrol {Verbose benchmarks} check box.
To allow the debugger to interrupt Qt tests on assertions, select the
\uicontrol {Disable crash handler while debugging} check box.
To record information about signals and slots in the test log, select the
\uicontrol {Log signals and slots} check box.
\section2 Specifying Settings for Running Google Tests
To specify settings for running Google tests, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Google Test}.
\image qtcreator-autotests-options-google.png
To run disabled tests, select the \uicontrol {Run disabled tests} check box.
To run several iterations of the tests, select the \uicontrol {Repeat tests}
check box and enter the number of times the tests should be run in the
\uicontrol Iterations field. To make sure that the tests are independent and
repeatable, you can run them in a different order each time by selecting the
\uicontrol {Shuffle tests} check box.
To turn failures into debugger breakpoints, select the
\uicontrol {Break on failure while debugging} check box. To turn assertion
failures into C++ exceptions, select the \uicontrol {Throw on failure} check
box.
\section1 Viewing Test Output
The test results are displayed in the \uicontrol {Test Results} output pane.
The test results are displayed in the \uicontrol {Test Results} output pane
in XML format. XML can be parsed more easily and reliably than plain text.
However, if a Qt test crashes, it might not produce complete XML code that
can be parsed, which might lead to information loss. The lost information
might be retrievable when viewing the results as plain text.
To view the results of Qt tests as plain text, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Qt Test}, and
then deselect the \uicontrol {Use XML output} check box. Then select the
\inlineimage text.png
(\uicontrol {Switch Between Visual and Text Display}) button in the
\uicontrol {Test Results} output pane to switch to the text display.
The following table lists the messages that the \uicontrol {Test Results}
output pane displays:
\table
\header
......@@ -272,6 +321,13 @@
\row
\li FAIL
\li Test case failed. Double-click the line for more information.
\row
\li FATAL
\li A fatal error occurred that stops the test case from being run,
for example.
\row
\li INFO
\li Informative message.
\row
\li INTERNAL
\li Internal message.
......@@ -281,6 +337,9 @@
\row
\li SKIP
\li Test case was skipped.
\row
\li SYSTEM
\li An error message received from or influenced by the OS.
\row
\li XPASS
\li Test case passed even though it was expected to fail.
......@@ -294,7 +353,14 @@
(\uicontrol {Filter Test Results}), and then select the types of messages to
show.
To hide internal messages and run configuration warnings, select
\uicontrol Tools > \uicontrol Options > \uicontrol {Test Settings} >
\uicontrol General.
By default, test result output is limited to 100,000 characters. The output
pane is automatically scrolled down when new results are added. To display
full results, select \uicontrol Tools > \uicontrol Options >
\uicontrol {Test Settings} > \uicontrol General, and then deselect the
\uicontrol {Limit result output} check box. To disable automatic scrolling,
deselect the \uicontrol {Automatically scroll results} check box.
Internal messages and run configuration warnings for guessed configurations
are omitted by default. To view them, deselect the \uicontrol {Omit internal
messages} and \uicontrol {Omit run configuration warnings} check boxes.
*/
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
......@@ -141,6 +141,7 @@
hierarchy of a QML file.
\li \uicontrol Tests lists autotests and Qt Quick tests in the project.
For more information, see \l {Running Autotests}.
\li \uicontrol {Type Hierarchy} shows the base classes of a class.
......@@ -303,28 +304,6 @@
\endlist
\section2 Viewing Tests
The \uicontrol Tests view shows the autotests and Qt Quick tests in the
current project. Select the test cases to run. If a Qt
Quick test case does not have a name, it is marked \uicontrol Unnamed in the
list. Unnamed test cases are always executed when the application that
contains them is run, and therefore you cannot select or deselect them.
To show or hide init and cleanup or data functions, select
\uicontrol {Filter Test Tree} > \uicontrol {Show Init and Cleanup Functions}
or \uicontrol {Show Data Functions}. Double-click a function in the list
to open its source code in the code editor.
The test cases are listed in alphabetic order. To list them in the order in
which they are defined in the source code, select \inlineimage leafsort.png
(\uicontrol {Sort Naturally}).
To run tests, select \uicontrol {Run All Tests} or
\uicontrol {Run Selected Tests} in the context menu.
To refresh the view, select \uicontrol {Rescan Tests} in the context menu.
\section2 Viewing Type Hierarchy
To view the base classes of a class, right-click the class and select
......@@ -375,8 +354,7 @@
To open the \uicontrol{General Messages} and \l{Using Version Control Systems}
{Version Control} panes, select
\uicontrol {Window > Output Panes}. To display the \uicontrol {To-Do Entries} pane,
enable the Todo plugin and to display the \l{Running Autotests}
{Test Results} pane, enable the Auto Tests plugin.
enable the Todo plugin.
\section2 Issues
......
......@@ -57,17 +57,16 @@ def parse_arguments():
source_include_patterns = [
# directories
r"^scripts/.*$", # everything under scripts/
r"^doc/.*$", # everything under doc/
r"^(?!(share|tests)/.*$)(.*/)?$", # look into all directories except under share/ and tests/
r"^share/(qtcreator/(qml/(qmlpuppet/(.*/)?)?)?)?$", # for shared headers for qt quick designer plugins
r"^src/(.*/)?$", # all directories under src/
r"^plugins/(.*/)?$", # all directories under plugins/ (if this is run on extra plugin repositories)
# files
r"^HACKING$",
r"^LICENSE.*$",
r"^README.md$",
r"^.*\.pri$",
r"^.*\.h$",
r"^scripts/.*$", # include everything under scripts/
r"^doc/.*$", # include everything under doc/
r"^.*\.pri$", # .pri files in all directories that are looked into
r"^.*\.h$", # .h files in all directories that are looked into
]
build_include_patterns = [
......
......@@ -20,9 +20,11 @@ win32 {
# We need the version in two separate formats for the .rc file
# RC_VERSION=4,3,82,0 (quadruple)
# RC_VERSION_STRING="4.4.0-beta1" (free text)
# Also, we need to replace space with \x20 to be able to work with both rc and windres
COPYRIGHT = "2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd"
DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \
RC_VERSION_STRING=\\\"$${QTCREATOR_DISPLAY_VERSION}\\\" \
RC_COPYRIGHT='"\\\"2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd\\\""'
RC_VERSION_STRING=\"$${QTCREATOR_DISPLAY_VERSION}\" \
RC_COPYRIGHT=\"$$replace(COPYRIGHT, " ", "\\x20")\"
RC_FILE = qtcreator.rc
} else:macx {
LIBS += -framework CoreFoundation
......
......@@ -54,9 +54,11 @@ QtcProduct {
// We need the version in two separate formats for the .rc file
// RC_VERSION=4,3,82,0 (quadruple)
// RC_VERSION_STRING="4.4.0-beta1" (free text)
// Also, we need to replace space with \x20 to be able to work with both rc and windres
cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
"RC_VERSION_STRING=\"" + qtc.qtcreator_display_version + "\"",
"RC_COPYRIGHT=\"2008-" + qtc.qtcreator_copyright_year + " The Qt Company Ltd\""])
"RC_VERSION_STRING=" + qtc.qtcreator_display_version,
"RC_COPYRIGHT=2008-" + qtc.qtcreator_copyright_year
+ " The Qt Company Ltd".replace(/ /g, "\\x20")])
files: "qtcreator.rc"
}
......
#include <windows.h>
#define STRINGIFY1(x) #x
#define STRINGIFY(x) STRINGIFY1(x)
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
......@@ -19,10 +22,10 @@ VS_VERSION_INFO VERSIONINFO
BLOCK "040904E4"
{
VALUE "FileDescription", "Qt Creator"
VALUE "FileVersion", RC_VERSION_STRING
VALUE "FileVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "ProductName", "Qt Creator"
VALUE "ProductVersion", RC_VERSION_STRING
VALUE "LegalCopyright", RC_COPYRIGHT
VALUE "ProductVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "LegalCopyright", STRINGIFY(RC_COPYRIGHT)
}
}
BLOCK "VarFileInfo"
......
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "Lexer.h"
#include "Token.h"
......
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ObjectiveCTypeQualifiers.h"
......
#ifndef CPLUSPLUS_OBJC_TYPEQUALIFIERS_H
#define CPLUSPLUS_OBJC_TYPEQUALIFIERS_H
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#pragma once
#include "CPlusPlusForwardDeclarations.h"
namespace CPlusPlus {
enum {
......@@ -27,6 +45,3 @@ enum {
CPLUSPLUS_EXPORT int classifyObjectiveCContextKeyword(const char *s, int n);
} // namespace CPlusPlus
#endif // CPLUSPLUS_OBJC_TYPEQUALIFIERS_H
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "QtContextKeywords.h"
......
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#pragma once
......
......@@ -23,8 +23,7 @@
**
****************************************************************************/
#ifndef CPLUSPLUS_SAFETYPEMATCHER_H
#define CPLUSPLUS_SAFETYPEMATCHER_H
#pragma once
#include "Matcher.h"
......@@ -56,5 +55,3 @@ private:
};
} // CPlusPlus namespace
#endif // CPLUSPLUS_SAFETYPEMATCHER_H
......@@ -40,7 +40,6 @@ SOURCES += \
$$PWD/ASTMatch0.cpp \
$$PWD/ASTVisitor.cpp \
$$PWD/ASTClone.cpp \
$$PWD/ASTPatternBuilder.cpp \
$$PWD/ASTMatcher.cpp \
$$PWD/Matcher.cpp \
$$PWD/Control.cpp \
......
......@@ -30,7 +30,6 @@ Project {
"ASTMatch0.cpp",
"ASTMatcher.cpp",
"ASTMatcher.h",
"ASTPatternBuilder.cpp",
"ASTPatternBuilder.h",
"ASTVisit.cpp",
"ASTVisitor.cpp",
......
......@@ -32,6 +32,7 @@
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <QCoreApplication>
#include <QDebug>
......@@ -631,26 +632,6 @@ static inline QString msgInvalidFormat(const char *key, const QString &content)
.arg(QLatin1String(key), content);
}
bool PluginSpec::readMultiLineString(const QJsonValue &value, QString *out)
{
QTC_ASSERT(out, return false);
if (value.isString()) {
*out = value.toString();
} else if (value.isArray()) {
QJsonArray array = value.toArray();
QStringList lines;
foreach (const QJsonValue &v, array) {
if (!v.isString())
return false;
lines.append(v.toString());
}
*out = lines.join(QLatin1Char('\n'));
} else {
return false;
}
return true;
}
/*!
\internal
*/
......@@ -735,7 +716,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
copyright = value.toString();
value = metaData.value(QLatin1String(DESCRIPTION));
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &description))
if (!value.isUndefined() && !Utils::readMultiLineString(value, &description))
return reportError(msgValueIsNotAString(DESCRIPTION));
value = metaData.value(QLatin1String(URL));
......@@ -749,7 +730,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
category = value.toString();
value = metaData.value(QLatin1String(LICENSE));
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &license))
if (!value.isUndefined() && !Utils::readMultiLineString(value, &license))
return reportError(msgValueIsNotAMultilineString(LICENSE));
value = metaData.value(QLatin1String(PLATFORM));
......@@ -799,7 +780,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
} else if (typeValue.toLower() == QLatin1String(DEPENDENCY_TYPE_TEST)) {
dep.type = PluginDependency::Test;
} else {
return reportError(tr("Dependency: \"%1\" must be \"%2\" or \"%3\" (is \"%4\")")
return reportError(tr("Dependency: \"%1\" must be \"%2\" or \"%3\" (is \"%4\").")
.arg(QLatin1String(DEPENDENCY_TYPE),
QLatin1String(DEPENDENCY_TYPE_HARD),
QLatin1String(DEPENDENCY_TYPE_SOFT),
......
......@@ -131,8 +131,6 @@ public:
bool hasError() const;
QString errorString() const;
static bool readMultiLineString(const QJsonValue &value, QString *out);
private:
PluginSpec();
......
......@@ -758,6 +758,13 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
QMT_ASSERT(object, return);
QMT_ASSERT(object != m_rootPackage, return);
// verify that newOwner is not a child of object
MObject *newOwnerObject = newOwner;
while (newOwnerObject && newOwnerObject != object)
newOwnerObject = newOwnerObject->owner();
if (newOwnerObject == object)
return;
if (newOwner != object->owner()) {
int formerRow = 0;
MObject *formerOwner = object->owner();
......
......@@ -2,6 +2,8 @@ import qbs
import qbs.Environment
import qbs.File
import qbs.FileInfo
import qbs.Process
import qbs.Utilities
QtcLibrary {
condition: qbs.toolchain.contains("msvc") && cdbPath
......@@ -45,11 +47,98 @@ QtcLibrary {
}
return undefined;
}
cpp.includePaths: [FileInfo.joinPaths(cdbPath, "inc")]
cpp.dynamicLibraries: [
"user32.lib",
FileInfo.joinPaths(cdbLibPath, "dbgeng.lib")
]
property string pythonInstallDir: Environment.getEnv("PYTHON_INSTALL_DIR")
Probe {
id: pythonDllProbe
condition: product.condition
property string pythonDir: pythonInstallDir // Input
property string buildVariant: qbs.buildVariant // Input
property string fileNamePrefix // Output
configure: {
function printWarning(msg) {
console.warn(msg + " The python dumpers for cdb will not be available.");
}
if (!pythonDir) {
printWarning("PYTHON_INSTALL_DIR not set.");
return;
}
if (!File.exists(pythonDir)) {
printWarning("The provided python installation directory '" + pythonDir
+ "' does not exist.");
return;
}
var p = new Process();
try {
var pythonFilePath = FileInfo.joinPaths(pythonDir, "python.exe");
p.exec(pythonFilePath, ["--version"], true);
var output = p.readStdOut().trim();
var magicPrefix = "Python ";
if (!output.startsWith(magicPrefix)) {
printWarning("Unexpected python output when checking for version: '"
+ output + "'");
return;
}
var versionNumberString = output.slice(magicPrefix.length);
var versionNumbers = versionNumberString.split('.');
if (versionNumbers.length < 2) {
printWarning("Unexpected python output when checking for version: '"
+ output + "'");
return;
}
if (Utilities.versionCompare(versionNumberString, "3.5") < 0) {
printWarning("The python installation at '" + pythonDir
+ "' has version " + versionNumberString + ", but 3.5 or higher "
+ "is required.");
return;
}
found = true;
fileNamePrefix = "python" + versionNumbers[0] + versionNumbers[1];
if (buildVariant === "debug")
fileNamePrefix += "_d"
} finally {
p.close();
}
}
}
Group {
name: "pythonDumper"
condition: pythonDllProbe.found
files: [
"pycdbextmodule.cpp",
"pycdbextmodule.h",
"pyfield.cpp",
"pyfield.h",
"pystdoutredirect.cpp",
"pystdoutredirect.h",
"pytype.cpp",
"pytype.h",
"pyvalue.cpp",
"pyvalue.h",
]
}
Properties {
condition: pythonDllProbe.found
cpp.defines: ["WITH_PYTHON=1"]
}
cpp.includePaths: {
var paths = [FileInfo.joinPaths(cdbPath, "inc")];
if (pythonDllProbe.found)
paths.push(FileInfo.joinPaths(pythonInstallDir, "include"));
return paths;
}
cpp.dynamicLibraries: {