Commit c531351d authored by Eike Ziller's avatar Eike Ziller Committed by The Qt Project

Merge "Merge remote-tracking branch 'origin/4.4'"

parents 1c7d1672 696a9789
......@@ -306,6 +306,37 @@ QTCREATOR_UTILS_EXPORT int parseUsedPortFromNetstatOutput(const QByteArray &line
const int len = spacePos - firstDigitPos;
base = 10;
portString = trimmed.mid(firstDigitPos, len);
} else if (trimmed.startsWith("tcp") || trimmed.startsWith("udp")) {
// macOS. Expected output is something like
//
// Active Internet connections (including servers)
// Proto Recv-Q Send-Q Local Address Foreign Address (state)
// tcp4 0 0 192.168.1.12.55687 88.198.14.66.443 ESTABLISHED
// tcp6 0 0 2a01:e34:ee42:d0.55684 2a02:26f0:ff::5c.443 ESTABLISHED
// [...]
// tcp4 0 0 *.631 *.* LISTEN
// tcp6 0 0 *.631 *.* LISTEN
// [...]
// udp4 0 0 192.168.79.1.123 *.*
// udp4 0 0 192.168.8.1.123 *.*
int firstDigitPos = -1;
int spacePos = -1;
if (trimmed[3] == '6') {
// IPV6
firstDigitPos = trimmed.indexOf('.') + 1;
spacePos = trimmed.indexOf(' ', firstDigitPos);
} else {
// IPV4
firstDigitPos = trimmed.indexOf('.') + 1;
spacePos = trimmed.indexOf(' ', firstDigitPos);
firstDigitPos = trimmed.lastIndexOf('.', spacePos) + 1;
}
if (spacePos < 0)
return -1;
base = 10;
portString = trimmed.mid(firstDigitPos, spacePos - firstDigitPos);
if (portString == "*")
return -1;
} else {
// Expected output on Linux something like
//
......
......@@ -61,7 +61,6 @@ namespace Android {
using namespace Internal;
const QVersionNumber gradleScriptRevokedSdkVersion(25, 3, 0);
const QVersionNumber gradleScriptsContainedQtVersion(5, 9, 0);
const char DeployActionKey[] = "Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction";
const char KeystoreLocationKey[] = "KeystoreLocation";
const char BuildTargetSdkKey[] = "BuildTargetSdk";
......@@ -144,11 +143,10 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
const QVersionNumber sdkToolsVersion = AndroidConfigurations::currentConfig().sdkToolsVersion();
if (sdkToolsVersion >= gradleScriptRevokedSdkVersion &&
QVersionNumber::fromString(version->qtVersionString()) < gradleScriptsContainedQtVersion) {
!version->sourcePath().appendPath("src/3rdparty/gradle").exists()) {
emit addOutput(tr("The installed SDK tools version (%1) does not include Gradle scripts. The "
"minimum Qt version required for Gradle build to work is %2")
.arg(sdkToolsVersion.toString())
.arg(gradleScriptsContainedQtVersion.toString()), OutputFormat::Stderr);
.arg(sdkToolsVersion.toString()).arg("5.9.0/5.6.3"), OutputFormat::Stderr);
return false;
}
......
......@@ -155,7 +155,7 @@ class DesktopPortsGatheringMethod : public PortsGatheringMethod
Q_UNUSED(protocol)
StandardRunnable runnable;
if (HostOsInfo::isWindowsHost()) {
if (HostOsInfo::isWindowsHost() || HostOsInfo::isMacHost()) {
runnable.executable = "netstat";
runnable.commandLineArguments = "-a -n";
} else if (HostOsInfo::isLinuxHost()) {
......
......@@ -863,6 +863,18 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
)
<< QString();
QTest::newRow("ld: undefined member function reference")
<< "obj/gtest-clang-printing.o:gtest-clang-printing.cpp:llvm::VerifyDisableABIBreakingChecks: error: undefined reference to 'llvm::DisableABIBreakingChecks'"
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<Task>()
<< Task(Task::Error,
QLatin1String("error: undefined reference to 'llvm::DisableABIBreakingChecks'"),
Utils::FileName::fromString("gtest-clang-printing.cpp"), -1,
categoryCompile)
)
<< QString();
QTest::newRow("Mac: ranlib warning")
<< QString::fromLatin1("ranlib: file: lib/libtest.a(Test0.cpp.o) has no symbols")
<< OutputParserTester::STDERR
......
......@@ -35,7 +35,7 @@ namespace {
// opt. drive letter + filename: (2 brackets)
const char * const FILE_PATTERN = "(([A-Za-z]:)?[^:]+\\.[^:]+):";
// line no. or elf segment + offset (1 bracket)
const char * const POSITION_PATTERN = "(\\d+|\\(\\..+?[+-]0x[a-fA-F0-9]+\\)):";
const char * const POSITION_PATTERN = "(\\S+|\\(\\..+?[+-]0x[a-fA-F0-9]+\\)):";
const char * const COMMAND_PATTERN = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(ld|gold)(-[0-9\\.]+)?(\\.exe)?: ";
const char *const RANLIB_PATTERN = "ranlib(.exe)?: (file: (.*) has no symbols)$";
}
......
......@@ -63,10 +63,10 @@ llvm::SmallString<256> absolutePath(clang::StringRef path)
return absolutePath;
}
template <typename Container>
Utils::PathString fromNativePath(Container container)
inline
Utils::PathString fromNativePath(const llvm::SmallString<256> &string)
{
Utils::PathString path(container.data(), container.size());
Utils::PathString path(string.data(), string.size());
#ifdef _WIN32
std::replace(path.begin(), path.end(), '\\', '/');
......@@ -91,7 +91,7 @@ void appendSourceLocationsToSourceLocationsContainer(
const auto fileEntry = sourceManager.getFileEntryForID(fileId);
sourceLocationsContainer.insertFilePath(fileId.getHashValue(),
fromNativePath(fileEntry->tryGetRealPathName()));
fromNativePath(absolutePath(fileEntry->getName())));
sourceLocationsContainer.insertSourceLocation(fileId.getHashValue(),
fullSourceLocation.getSpellingLineNumber(),
fullSourceLocation.getSpellingColumnNumber(),
......
......@@ -69,6 +69,7 @@ std::reverse_iterator<Iterator> make_reverse_iterator(Iterator iterator)
{
return std::reverse_iterator<Iterator>(iterator);
}
}
const char *SourceRangeExtractor::findStartOfLineInBuffer(llvm::StringRef buffer, uint startOffset)
......@@ -152,7 +153,7 @@ FilePathIndex SourceRangeExtractor::findFileId(clang::FileID fileId, const clang
return found->second;
}
auto filePath = absolutePath(fileEntry->tryGetRealPathName());
auto filePath = absolutePath(fileEntry->getName());
return filePathCache.stringId(fromNativePath(filePath));
}
......@@ -175,7 +176,7 @@ void SourceRangeExtractor::addSourceRange(const clang::SourceRange &sourceRange)
endOffset);
insertSourceRange(findFileId(fileId, fileEntry),
fromNativePath(fileEntry->tryGetRealPathName()),
fromNativePath(absolutePath(fileEntry->getName())),
startSourceLocation,
startOffset,
endSourceLocation,
......
......@@ -6,6 +6,8 @@ QtcTool {
Depends { name: "Qt.core" }
Depends { name: "app_version_header" }
property string libsDir: path + "/../../libs"
cpp.defines: base.concat([
"UTILS_LIBRARY",
qbs.targetOS.contains("macos")
......@@ -21,6 +23,7 @@ QtcTool {
condition: qbs.targetOS.contains("macos")
cpp.frameworks: ["Foundation"]
}
cpp.includePaths: base.concat([libsDir])
files: [
"addcmakeoperation.cpp", "addcmakeoperation.h",
......@@ -60,7 +63,7 @@ QtcTool {
Group {
name: "Utils"
prefix: "../../libs/utils/"
prefix: libsDir + "/utils/"
files: [
"fileutils.cpp", "fileutils.h",
"hostosinfo.cpp", "hostosinfo.h",
......
......@@ -246,7 +246,7 @@ def verifyBreakPoint(bpToVerify):
textPos = editor.textCursor().position()
line = str(editor.plainText)[:textPos].count("\n") + 1
windowTitle = str(waitForObject(":Qt Creator_Core::Internal::MainWindow").windowTitle)
test.verify(os.path.basename(fileName) in windowTitle,
test.verify(windowTitle.startswith(os.path.basename(fileName) + " "),
"Verify that Creator's window title changed according to current file")
return test.compare(line, bpToVerify.values()[0],
"Compare hit breakpoint to expected line number in %s" % fileName)
......
......@@ -267,7 +267,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
if treeViewSyntax:
expected = simpleFileName(curFile)
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
if not waitFor("expected in str(mainWindow.windowTitle)", 5000):
if not waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000):
test.fatal("Window title (%s) did not switch to expected file (%s)."
% (str(mainWindow.windowTitle), expected))
try:
......@@ -387,7 +387,7 @@ def openDocument(treeElement):
doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton)
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
expected = str(item.text).split("/")[-1]
if waitFor("expected in str(mainWindow.windowTitle)", 5000):
if waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000):
return True
test.log("Expected file (%s) was not being opened in openDocument()" % expected)
return False
......
......@@ -82,7 +82,7 @@ def main():
# Creator should show the declaration of the function again.
selectFromLocator("dummy.cpp")
mainWin = findObject(":Qt Creator_Core::Internal::MainWindow")
if not waitFor("'dummy.cpp ' in str(mainWin.windowTitle) and ' @ cplusplus-tools ' in str(mainWin.windowTitle)", 5000):
if not waitFor("str(mainWin.windowTitle).startswith('dummy.cpp ') and ' @ cplusplus-tools ' in str(mainWin.windowTitle)", 5000):
test.warning("Opening dummy.cpp seems to have failed")
# Reset cursor to the start of the document
if platform.system() == 'Darwin':
......
......@@ -39,7 +39,7 @@ def main():
expectedHeaderName=headerFileName)
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
if test.verify(waitFor("sourceFileName in str(mainWindow.windowTitle)", 1000),
if test.verify(waitFor("str(mainWindow.windowTitle).startswith(sourceFileName + ' ')", 1000),
"Source file was opened on time?"):
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
editorText = str(editor.plainText)
......@@ -52,7 +52,7 @@ def main():
type(editor, "<Return>")
invokeMenuItem("File", "Save All")
clickButton(waitForObject(":Qt Creator.CloseDoc_QToolButton"))
if test.verify(waitFor("headerFileName in str(mainWindow.windowTitle)", 2000),
if test.verify(waitFor("str(mainWindow.windowTitle).startswith(headerFileName + ' ')", 2000),
"Header file was shown after closing source?"):
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
editorText = str(editor.plainText)
......
......@@ -58,7 +58,7 @@ def main():
"Verifying window title contains created session name.")
checkNavigator(52, "Verifying whether all projects have been re-opened.")
checkOpenDocuments(2, "Verifying whether 2 files have been re-opened.")
if test.verify("main.cpp" in str(mainWindow.windowTitle),
if test.verify(str(mainWindow.windowTitle).startswith("main.cpp "),
"Verifying whether utility.h has been opened."):
current = str(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget").plainText)
test.verify(originalText == current, "Verifying that same file has been opened.")
......
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