forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.3'
This commit is contained in:
@@ -134,6 +134,7 @@ unix {
|
|||||||
win32-msvc* {
|
win32-msvc* {
|
||||||
#Don't warn about sprintf, fopen etc being 'unsafe'
|
#Don't warn about sprintf, fopen etc being 'unsafe'
|
||||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||||
|
QMAKE_CXXFLAGS_WARN_ON *= -w44996
|
||||||
# Speed up startup time when debugging with cdb
|
# Speed up startup time when debugging with cdb
|
||||||
QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
|
QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,20 +26,25 @@ QMLWIZARD_TR_H = $$OUT_PWD/qmlwizard_tr.h
|
|||||||
QTQUICKWIZARD_TR_H = $$OUT_PWD/qtquickwizard_tr.h
|
QTQUICKWIZARD_TR_H = $$OUT_PWD/qtquickwizard_tr.h
|
||||||
EXTERNALTOOLS_TR_H = $$OUT_PWD/externaltools_tr.h
|
EXTERNALTOOLS_TR_H = $$OUT_PWD/externaltools_tr.h
|
||||||
|
|
||||||
|
win32: \
|
||||||
|
PREFIX = "file:///"
|
||||||
|
else: \
|
||||||
|
PREFIX = "file://"
|
||||||
|
|
||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
||||||
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, "|$$PREFIX", "$$PREFIX")\"
|
||||||
|
|
||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*, true))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*, true))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
|
||||||
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
|
CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, "|$$PREFIX", "$$PREFIX")\"
|
||||||
|
|
||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/qml/*))):QMLWIZARD_FILES += $$files($$dir/template.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/qml/*))):QMLWIZARD_FILES += $$files($$dir/template.xml)
|
||||||
QMLWIZARD_FILES = \"$$join(QMLWIZARD_FILES, |)\"
|
QMLWIZARD_FILES = \"$$join(QMLWIZARD_FILES, "|$$PREFIX", "$$PREFIX")\"
|
||||||
|
|
||||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/qtquick/*))):QTQUICKWIZARD_FILES += $$files($$dir/template.xml)
|
for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/qtquick/*))):QTQUICKWIZARD_FILES += $$files($$dir/template.xml)
|
||||||
QTQUICKWIZARD_FILES = \"$$join(QTQUICKWIZARD_FILES, |)\"
|
QTQUICKWIZARD_FILES = \"$$join(QTQUICKWIZARD_FILES, "|$$PREFIX", "$$PREFIX")\"
|
||||||
|
|
||||||
for(file, $$list($$files($$IDE_SOURCE_TREE/src/share/qtcreator/externaltools/*))):EXTERNALTOOLS_FILES += $$files($$file)
|
for(file, $$list($$files($$IDE_SOURCE_TREE/src/share/qtcreator/externaltools/*))):EXTERNALTOOLS_FILES += $$files($$file)
|
||||||
EXTERNALTOOLS_FILES = \"$$join(EXTERNALTOOLS_FILES, |)\"
|
EXTERNALTOOLS_FILES = \"$$join(EXTERNALTOOLS_FILES, "|$$PREFIX", "$$PREFIX")\"
|
||||||
|
|
||||||
extract.commands += \
|
extract.commands += \
|
||||||
$$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
|
$$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
|
||||||
@@ -58,7 +63,11 @@ plugin_sources -= src/plugins/plugins.pro \
|
|||||||
src/plugins/qtestlib \
|
src/plugins/qtestlib \
|
||||||
src/plugins/snippets \
|
src/plugins/snippets \
|
||||||
src/plugins/regexp
|
src/plugins/regexp
|
||||||
sources = src/app src/libs $$plugin_sources src/shared share/qtcreator/qmldesigner \
|
shared_sources = $$files($$IDE_SOURCE_TREE/src/shared/*)
|
||||||
|
shared_sources ~= s,^$$re_escape($$IDE_SOURCE_TREE/),,g$$i_flag
|
||||||
|
shared_sources -= \
|
||||||
|
src/shared/qbs
|
||||||
|
sources = src/app src/libs $$plugin_sources $$shared_sources share/qtcreator/qmldesigner \
|
||||||
share/qtcreator/welcomescreen share/qtcreator/welcomescreen/widgets
|
share/qtcreator/welcomescreen share/qtcreator/welcomescreen/widgets
|
||||||
|
|
||||||
files = $$files($$PWD/*_??.ts) $$PWD/qtcreator_untranslated.ts
|
files = $$files($$PWD/*_??.ts) $$PWD/qtcreator_untranslated.ts
|
||||||
|
|||||||
@@ -57,6 +57,15 @@ QDebug operator<<(QDebug dbg, const Utils::FileName &c)
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#ifdef Q_OS_OSX
|
||||||
|
// for file drops from Finder, working around QTBUG-40449
|
||||||
|
namespace Utils {
|
||||||
|
namespace Internal {
|
||||||
|
extern QUrl filePathUrl(const QUrl &url);
|
||||||
|
} // Internal
|
||||||
|
} // Utils
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
/*! \class Utils::FileUtils
|
/*! \class Utils::FileUtils
|
||||||
@@ -774,7 +783,12 @@ static bool isFileDrop(const QMimeData *d, QList<FileDropSupport::FileSpec> *fil
|
|||||||
bool hasFiles = false;
|
bool hasFiles = false;
|
||||||
const QList<QUrl>::const_iterator cend = urls.constEnd();
|
const QList<QUrl>::const_iterator cend = urls.constEnd();
|
||||||
for (QList<QUrl>::const_iterator it = urls.constBegin(); it != cend; ++it) {
|
for (QList<QUrl>::const_iterator it = urls.constBegin(); it != cend; ++it) {
|
||||||
const QString fileName = it->toLocalFile();
|
QUrl url = *it;
|
||||||
|
#ifdef Q_OS_OSX
|
||||||
|
// for file drops from Finder, working around QTBUG-40449
|
||||||
|
url = Internal::filePathUrl(url);
|
||||||
|
#endif
|
||||||
|
const QString fileName = url.toLocalFile();
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
hasFiles = true;
|
hasFiles = true;
|
||||||
if (files)
|
if (files)
|
||||||
|
|||||||
51
src/libs/utils/fileutils_mac.mm
Normal file
51
src/libs/utils/fileutils_mac.mm
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://www.qt.io/licensing. For further information
|
||||||
|
** use the contact form at http://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 or version 3 as published by the Free
|
||||||
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||||
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||||
|
** following information to ensure the GNU Lesser General Public License
|
||||||
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
|
#include <Foundation/NSURL.h>
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
QUrl filePathUrl(const QUrl &url)
|
||||||
|
{
|
||||||
|
QUrl ret = url;
|
||||||
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
NSURL *nsurl = url.toNSURL();
|
||||||
|
if ([nsurl isFileReferenceURL])
|
||||||
|
ret = QUrl::fromNSURL([nsurl filePathURL]);
|
||||||
|
[pool release];
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Internal
|
||||||
|
} // Utils
|
||||||
@@ -196,3 +196,9 @@ FORMS += $$PWD/filewizardpage.ui \
|
|||||||
$$PWD/proxycredentialsdialog.ui
|
$$PWD/proxycredentialsdialog.ui
|
||||||
|
|
||||||
RESOURCES += $$PWD/utils.qrc
|
RESOURCES += $$PWD/utils.qrc
|
||||||
|
|
||||||
|
osx {
|
||||||
|
OBJECTIVE_SOURCES += \
|
||||||
|
$$PWD/fileutils_mac.mm
|
||||||
|
LIBS += -framework Foundation
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ QtcLibrary {
|
|||||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx")
|
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx")
|
||||||
cpp.dynamicLibraries: ["X11"]
|
cpp.dynamicLibraries: ["X11"]
|
||||||
}
|
}
|
||||||
|
Properties {
|
||||||
|
condition: qbs.targetOS.contains("osx")
|
||||||
|
cpp.frameworks: ["Foundation"]
|
||||||
|
}
|
||||||
|
|
||||||
Depends { name: "Qt"; submodules: ["widgets", "network", "script", "concurrent"] }
|
Depends { name: "Qt"; submodules: ["widgets", "network", "script", "concurrent"] }
|
||||||
Depends { name: "app_version_header" }
|
Depends { name: "app_version_header" }
|
||||||
@@ -240,6 +244,14 @@ QtcLibrary {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Group {
|
||||||
|
name: "FileUtils_osx"
|
||||||
|
condition: qbs.targetOS.contains("osx")
|
||||||
|
files: [
|
||||||
|
"fileutils_mac.mm",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
Export {
|
Export {
|
||||||
Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] }
|
Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,12 @@ defineReplace(findClangOnWindows) {
|
|||||||
for (suffix, $$list(lib bin)) {
|
for (suffix, $$list(lib bin)) {
|
||||||
for (libname, $$list(clang libclang)) {
|
for (libname, $$list(clang libclang)) {
|
||||||
for (ext, FILE_EXTS) {
|
for (ext, FILE_EXTS) {
|
||||||
exists("$${LLVM_INSTALL_DIR}/$${suffix}/$${libname}.$${ext}")
|
exists("$${LLVM_INSTALL_DIR}/$${suffix}/$${libname}.$${ext}") {
|
||||||
return($${LLVM_INSTALL_DIR}/$${suffix}/)
|
return($${LLVM_INSTALL_DIR}/$${suffix}/)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
error("Cannot find clang shared library at $${LLVM_INSTALL_DIR}")
|
error("Cannot find clang shared library at $${LLVM_INSTALL_DIR}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
static const char urlC[] = "http://pastebin.ca/";
|
static const char urlC[] = "http://pastebin.ca/";
|
||||||
|
static const char internalUrlC[] = "http://pbin.ca/";
|
||||||
static const char protocolNameC[] = "Pastebin.Ca";
|
static const char protocolNameC[] = "Pastebin.Ca";
|
||||||
|
|
||||||
static inline QByteArray expiryValue(int expiryDays)
|
static inline QByteArray expiryValue(int expiryDays)
|
||||||
@@ -135,7 +136,7 @@ void PasteBinDotCaProtocol::paste(const QString &text,
|
|||||||
data += "&name="; // Title or name.
|
data += "&name="; // Title or name.
|
||||||
data += QUrl::toPercentEncoding(description);
|
data += QUrl::toPercentEncoding(description);
|
||||||
// fire request
|
// fire request
|
||||||
const QString link = QLatin1String(urlC) + QLatin1String("quiet-paste.php");
|
const QString link = QLatin1String(internalUrlC) + QLatin1String("quiet-paste.php");
|
||||||
m_pasteReply = httpPost(link, data);
|
m_pasteReply = httpPost(link, data);
|
||||||
connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished()));
|
connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ exists(shared/qbs/qbs.pro) {
|
|||||||
isEmpty(QBS_INSTALL_DIR):QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
|
isEmpty(QBS_INSTALL_DIR):QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
|
||||||
isEmpty(QBS_INSTALL_DIR):SUBDIRS += $$QBS_DIRS
|
isEmpty(QBS_INSTALL_DIR):SUBDIRS += $$QBS_DIRS
|
||||||
}
|
}
|
||||||
TR_EXCLUDE = $$QBS_DIRS
|
TR_EXCLUDE = shared/qbs
|
||||||
|
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
libs \
|
libs \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
##
|
##
|
||||||
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
## Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
||||||
## Contact: http://www.qt-project.org/legal
|
## Contact: http://www.qt-project.org/legal
|
||||||
##
|
##
|
||||||
## This file is part of Qt Creator.
|
## This file is part of Qt Creator.
|
||||||
@@ -41,7 +41,7 @@ def main():
|
|||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
protocolsToTest = ["Paste.KDE.Org"]#, "Pastebin.Ca"]
|
protocolsToTest = ["Paste.KDE.Org", "Pastebin.Ca"]
|
||||||
# Be careful with Pastebin.Com, there are only 10 pastes per 24h
|
# Be careful with Pastebin.Com, there are only 10 pastes per 24h
|
||||||
# for all machines using the same IP-address like you.
|
# for all machines using the same IP-address like you.
|
||||||
# protocolsToTest += ["Pastebin.Com"]
|
# protocolsToTest += ["Pastebin.Com"]
|
||||||
@@ -104,6 +104,14 @@ def main():
|
|||||||
selectFromCombo(":CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox", protocol)
|
selectFromCombo(":CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox", protocol)
|
||||||
pasteModel = waitForObject(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget").model()
|
pasteModel = waitForObject(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget").model()
|
||||||
waitFor("pasteModel.rowCount() > 1", 20000)
|
waitFor("pasteModel.rowCount() > 1", 20000)
|
||||||
|
if (pasteId not in dumpItems(pasteModel)):
|
||||||
|
test.warning("Fetching too fast for server of %s - waiting 3s and trying to refresh."
|
||||||
|
% protocol)
|
||||||
|
snooze(3)
|
||||||
|
clickButton("{text='Refresh' type='QPushButton' unnamed='1' visible='1' "
|
||||||
|
"window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}")
|
||||||
|
waitFor("pasteModel.rowCount() == 1", 1000)
|
||||||
|
waitFor("pasteModel.rowCount() > 1", 20000)
|
||||||
if protocol == 'Pastebin.Ca':
|
if protocol == 'Pastebin.Ca':
|
||||||
description = description[:32]
|
description = description[:32]
|
||||||
if pasteId == -1:
|
if pasteId == -1:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
##
|
##
|
||||||
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
## Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
|
||||||
## Contact: http://www.qt-project.org/legal
|
## Contact: http://www.qt-project.org/legal
|
||||||
##
|
##
|
||||||
## This file is part of Qt Creator.
|
## This file is part of Qt Creator.
|
||||||
@@ -78,23 +78,26 @@ def checkOrFixCommitterInformation(labelName, lineEditName, expected):
|
|||||||
test.log("Commit information invalid or missing - entering dummy value (%s)" % expected)
|
test.log("Commit information invalid or missing - entering dummy value (%s)" % expected)
|
||||||
replaceEditorContent(lineEd, expected)
|
replaceEditorContent(lineEd, expected)
|
||||||
|
|
||||||
def verifyClickCommit():
|
# Opens a commit's diff from a diff log
|
||||||
|
# param count is the number of the commit (1-based) in chronologic order
|
||||||
|
def __clickCommit__(count):
|
||||||
gitEditor = waitForObject(":Qt Creator_Git::Internal::GitEditor")
|
gitEditor = waitForObject(":Qt Creator_Git::Internal::GitEditor")
|
||||||
fileName = waitForObject(":Qt Creator_FilenameQComboBox")
|
fileName = waitForObject(":Qt Creator_FilenameQComboBox")
|
||||||
test.verify(waitFor('str(fileName.currentText).startswith("Git Log")', 1000),
|
test.verify(waitFor('str(fileName.currentText).startswith("Git Log")', 1000),
|
||||||
"Verifying Qt Creator still displays git log inside editor.")
|
"Verifying Qt Creator still displays git log inside editor.")
|
||||||
|
waitFor("'Initial Commit' in str(gitEditor.plainText)", 3000)
|
||||||
content = str(gitEditor.plainText)
|
content = str(gitEditor.plainText)
|
||||||
noOfCommits = content.count("commit")
|
|
||||||
commit = None
|
commit = None
|
||||||
# find second commit
|
# find commit
|
||||||
try:
|
try:
|
||||||
line = filter(lambda line: line.startswith("commit"), content.splitlines())[-2]
|
# Commits are listed in reverse chronologic order, so we have to invert count
|
||||||
|
line = filter(lambda line: line.startswith("commit"), content.splitlines())[-count]
|
||||||
commit = line.split(" ", 1)[1]
|
commit = line.split(" ", 1)[1]
|
||||||
except:
|
except:
|
||||||
test.fail("Could not find the second commit - leaving test")
|
test.fail("Could not find the %d. commit - leaving test" % count)
|
||||||
return
|
return False
|
||||||
placeCursorToLine(gitEditor, line)
|
placeCursorToLine(gitEditor, line)
|
||||||
for i in range(5):
|
for i in range(30):
|
||||||
type(gitEditor, "<Left>")
|
type(gitEditor, "<Left>")
|
||||||
# get the current cursor rectangle which should be positioned on the commit ID
|
# get the current cursor rectangle which should be positioned on the commit ID
|
||||||
rect = gitEditor.cursorRect()
|
rect = gitEditor.cursorRect()
|
||||||
@@ -103,9 +106,9 @@ def verifyClickCommit():
|
|||||||
expected = 'Git Show "%s"' % commit
|
expected = 'Git Show "%s"' % commit
|
||||||
test.verify(waitFor('str(fileName.currentText) == expected', 5000),
|
test.verify(waitFor('str(fileName.currentText) == expected', 5000),
|
||||||
"Verifying editor switches to Git Show.")
|
"Verifying editor switches to Git Show.")
|
||||||
diffShow = waitForObject(":Qt Creator_DiffEditor::Internal::DescriptionEditorWidget")
|
description = waitForObject(":Qt Creator_DiffEditor::Internal::DescriptionEditorWidget")
|
||||||
waitFor('len(str(diffShow.plainText)) != 0', 5000)
|
waitFor('len(str(description.plainText)) != 0', 5000)
|
||||||
show = str(diffShow.plainText)
|
show = str(description.plainText)
|
||||||
expected = [{"commit %s" % commit:False},
|
expected = [{"commit %s" % commit:False},
|
||||||
{"Author: Nobody <nobody@nowhere.com>": False},
|
{"Author: Nobody <nobody@nowhere.com>": False},
|
||||||
{"Date:\s+\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2} \d{4}.*":True}]
|
{"Date:\s+\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2} \d{4}.*":True}]
|
||||||
@@ -116,6 +119,14 @@ def verifyClickCommit():
|
|||||||
test.verify(re.match(expLine, line), "Verifying commit header line '%s'" % line)
|
test.verify(re.match(expLine, line), "Verifying commit header line '%s'" % line)
|
||||||
else:
|
else:
|
||||||
test.compare(line, expLine, "Verifying commit header line.")
|
test.compare(line, expLine, "Verifying commit header line.")
|
||||||
|
test.verify(description.readOnly,
|
||||||
|
"Verifying description editor widget is readonly.")
|
||||||
|
return True
|
||||||
|
|
||||||
|
def verifyClickCommit():
|
||||||
|
for i in range(1, 3):
|
||||||
|
if not __clickCommit__(i):
|
||||||
|
continue
|
||||||
changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget")
|
changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget")
|
||||||
original = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget2")
|
original = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget2")
|
||||||
waitFor('str(changed.plainText) != "Waiting for data..." '
|
waitFor('str(changed.plainText) != "Waiting for data..." '
|
||||||
@@ -123,6 +134,14 @@ def verifyClickCommit():
|
|||||||
# content of diff editors is merge of modified files
|
# content of diff editors is merge of modified files
|
||||||
diffOriginal = str(original.plainText)
|
diffOriginal = str(original.plainText)
|
||||||
diffChanged = str(changed.plainText)
|
diffChanged = str(changed.plainText)
|
||||||
|
if i == 1:
|
||||||
|
# diffChanged must completely contain main.cpp
|
||||||
|
mainCPP = readFile(os.path.join(srcPath, projectName, "main.cpp"))
|
||||||
|
test.verify(mainCPP in diffChanged,
|
||||||
|
"Verifying whether diff editor contains main.cpp file.")
|
||||||
|
test.verify(mainCPP not in diffOriginal,
|
||||||
|
"Verifying whether original does not contain main.cpp file.")
|
||||||
|
elif i == 2:
|
||||||
# diffChanged must completely contain the pointless_header.h
|
# diffChanged must completely contain the pointless_header.h
|
||||||
pointlessHeader = readFile(os.path.join(srcPath, projectName, "pointless_header.h"))
|
pointlessHeader = readFile(os.path.join(srcPath, projectName, "pointless_header.h"))
|
||||||
test.verify(pointlessHeader in diffChanged,
|
test.verify(pointlessHeader in diffChanged,
|
||||||
@@ -134,8 +153,9 @@ def verifyClickCommit():
|
|||||||
test.verify("HEADERS += mainwindow.h\n\n" in diffOriginal
|
test.verify("HEADERS += mainwindow.h\n\n" in diffOriginal
|
||||||
and "pointless_header.h" not in diffOriginal,
|
and "pointless_header.h" not in diffOriginal,
|
||||||
"Verifying whether original has no additional header in pro file.")
|
"Verifying whether original has no additional header in pro file.")
|
||||||
test.verify(original.readOnly and changed.readOnly and diffShow.readOnly,
|
test.verify(original.readOnly and changed.readOnly,
|
||||||
"Verifying all diff editor widgets are readonly.")
|
"Verifying that the actual diff editor widgets are readonly.")
|
||||||
|
invokeMenuItem("Tools", "Git", "Local Repository", "Log")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user