Merge remote-tracking branch 'origin/3.3'

Conflicts:
	src/plugins/debugger/watchhandler.cpp
	src/plugins/projectexplorer/kitmodel.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/shared/qbs

Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
This commit is contained in:
Eike Ziller
2015-02-12 17:36:29 +01:00
44 changed files with 302 additions and 214 deletions

View File

@@ -192,6 +192,7 @@ private slots:
void test_checksymbols_macroUses();
void test_checksymbols_macroUses_data();
void test_checksymbols_infiniteLoop_data();
void test_checksymbols_infiniteLoop();
};
@@ -1755,36 +1756,12 @@ void tst_CheckSymbols::test_checksymbols_macroUses_data()
void tst_CheckSymbols::test_checksymbols_infiniteLoop()
{
const QByteArray source1 =
"#include \"file2.h\"\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ios {\n"
" typedef basic_ostream<_Elem, _Traits> _Myos;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ostream {\n"
" typedef basic_ostream<_Elem, _Traits> _Myt;\n"
" typedef ostreambuf_iterator<_Elem, _Traits> _Iter;\n"
"};\n"
;
QFETCH(QByteArray, source1);
QFETCH(QByteArray, source2);
const QString filePath1 = QDir::tempPath() + QLatin1String("/file1.h");
Tests::TestCase::writeFile(filePath1, source1);
const QByteArray source2 =
"template<class _Elem, class _Traits>\n"
"class basic_streambuf {\n"
" typedef basic_streambuf<_Elem, _Traits> _Myt;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class ostreambuf_iterator {\n"
" typedef _Traits traits_type;\n"
" typedef basic_streambuf<_Elem, _Traits> streambuf_type;\n"
" typedef basic_ostream<_Elem, _Traits> ostream_type;\n"
"};\n"
;
const QString filePath2 = QDir::tempPath() + QLatin1String("/file2.h");
Tests::TestCase::writeFile(filePath2, source2);
@@ -1797,5 +1774,77 @@ void tst_CheckSymbols::test_checksymbols_infiniteLoop()
TestCase::runCheckSymbols(document1, snapshot);
}
void tst_CheckSymbols::test_checksymbols_infiniteLoop_data()
{
QTest::addColumn<QByteArray>("source1");
QTest::addColumn<QByteArray>("source2");
QTest::newRow("1")
<<
_("#include \"file2.h\"\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ios {\n"
" typedef basic_ostream<_Elem, _Traits> _Myos;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ostream {\n"
" typedef basic_ostream<_Elem, _Traits> _Myt;\n"
" typedef ostreambuf_iterator<_Elem, _Traits> _Iter;\n"
"};\n")
<<
_("template<class _Elem, class _Traits>\n"
"class basic_streambuf {\n"
" typedef basic_streambuf<_Elem, _Traits> _Myt;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class ostreambuf_iterator {\n"
" typedef _Traits traits_type;\n"
" typedef basic_streambuf<_Elem, _Traits> streambuf_type;\n"
" typedef basic_ostream<_Elem, _Traits> ostream_type;\n"
"};\n")
;
QTest::newRow("2")
<<
_("#include \"file2.h\"\n"
"\n"
"template<class _Ty >\n"
"struct _List_base_types\n"
"{\n"
" typedef typename _Wrap_alloc<_Alloc>::template rebind<_Ty>::other _Alty;\n"
" typedef typename _Alty::template rebind<_Node>::other _Alnod_type;\n"
"};\n"
"\n"
"template<class _Alloc_types>\n"
"struct _List_alloc \n"
"{\n"
" const _Alloc_types::_Alnod_type& _Getal() const {}\n"
"};\n"
"\n"
"template<class _Ty, class _Alloc>\n"
"struct _List_buy : public _List_alloc< _List_base_types<_Ty> >\n"
"{\n"
" void foo()\n"
" {\n"
" this->_Getal().construct(1, 2);\n"
" this->_Getal().deallocate(0, 1);\n"
" }\n"
"};\n")
<<
_("template<class _Alloc>\n"
"struct _Wrap_alloc : public _Alloc\n"
"{\n"
" typedef _Alloc _Mybase;\n"
" template<class _Other> struct rebind { typedef _Wrap_alloc<_Other_alloc> other; };\n"
"\n"
" void deallocate(pointer _Ptr, size_type _Count) {}\n"
" void construct(value_type *_Ptr) {}\n"
"};\n")
;
}
QTEST_APPLESS_MAIN(tst_CheckSymbols)
#include "tst_checksymbols.moc"

View File

@@ -390,6 +390,7 @@ private slots:
void empty_trailing_lines_data();
void undef();
void concat();
void excessive_nesting();
};
// Remove all #... lines, and 'simplify' string, to allow easily comparing the result
@@ -1901,6 +1902,23 @@ void tst_Preprocessor::concat()
QCOMPARE(prep.constData(), output.constData());
}
void tst_Preprocessor::excessive_nesting()
{
Environment env;
Preprocessor preprocess(0, &env);
QByteArray input;
const QByteArray output =
"# 1 \"<stdin>\"\n"
"# 2001 \"<stdin>\"\n";
for (int i = 0; i < 1000; ++i)
input += "#if FOO\n";
for (int i = 0; i < 1000; ++i)
input += "#endif\n";
QByteArray prep = preprocess.run(QLatin1String("<stdin>"), input);
// Output cannot be precisely determined, but it shouldn't crash.
QCOMPARE(prep, output);
}
void tst_Preprocessor::compare_input_output(bool keepComments)
{
QFETCH(QByteArray, input);

View File

@@ -83,7 +83,17 @@ void tst_offsets::offsets_data()
QFilePrivate *p = 0;
QTestData &data = QTest::newRow("QFilePrivate::fileName")
<< int((char *)&p->fileName - (char *)p);
if (qtVersion > 0x50200)
if (qtVersion >= 0x50400)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
data << 196 << 272;
# else // MinGW
data << 188 << 272;
# endif
#else
data << 180 << 272;
#endif
else if (qtVersion > 0x50200)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
data << 184 << 272;

View File

@@ -153,9 +153,12 @@ def verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, e
for ty in additionalKeyPresses:
type(editor, ty)
rect = editor.cursorRect(editor.textCursor())
expectedToolTip = "{type='%s' visible='1'}" % expectedType
# wait for similar tooltips to disappear
checkIfObjectExists(expectedToolTip, False, 1000, True)
sendEvent("QMouseEvent", editor, QEvent.MouseMove, rect.x+rect.width/2, rect.y+rect.height/2, Qt.NoButton, 0)
try:
tip = waitForObject("{type='%s' visible='1'}" % expectedType)
tip = waitForObject(expectedToolTip)
except:
tip = None
if tip == None:

View File

@@ -39,6 +39,8 @@ import sys
import errno;
from datetime import datetime,timedelta;
isQt53Build = os.getenv("SYSTEST_ISQT53BUILD") != "0"
srcPath = ''
SettingsPath = ''
tmpSettingsDir = ''

View File

@@ -578,9 +578,6 @@ def dumpChildren(item):
return [item.child(index) for index in range(item.childCount())]
def writeTestResults(folder):
if squishinfo.version < 0x040200FF:
print "Skipping writing test results (Squish < 4.2)"
return
if not os.path.exists(folder):
print "Skipping writing test results (folder '%s' does not exist)." % folder
return

View File

@@ -45,7 +45,13 @@ def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
def textForQtVersion(text):
return text + " | QtCreator"
if isQt53Build:
return text + " | QtCreator"
else:
suffix = "Qt Creator Manual"
if text != suffix:
text += " | " + suffix
return text
def main():
startApplication("qtcreator" + SettingsPath)

View File

@@ -83,7 +83,10 @@ def main():
test.verify(checkIfObjectExists(gettingStartedText),
"Verifying: Qt Creator displays Welcome Page with 'Get Started Now' button.")
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
if isQt53Build:
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
else:
expectedText = "Qt Creator Manual"
testDetails = "Verifying: Help with Creator Documentation is being opened."
clickItemVerifyHelpCombo(gettingStartedText, expectedText, testDetails)

View File

@@ -39,7 +39,12 @@ def main():
if not startedWithoutPluginError():
return
openQbsProject(pathCreator)
progressBarWait(200000)
test.log("Start parsing project")
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='qtcreator( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(naviTreeView)
if waitFor("ntwObject.model().rowCount(ntwObject) > 2", 200000): # No need to wait for C++-parsing
test.log("Parsing project done") # we only need the project
else:
test.warning("Parsing project timed out")
compareProjectTree(naviTreeView, "projecttree_creator.tsv")
invokeMenuItem("File", "Exit")

View File

@@ -41,7 +41,7 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
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
# for all machines using the same IP-address like you.
# protocolsToTest += ["Pastebin.Com"]