diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-06-14 16:21:04 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-06-14 16:21:04 +0200 |
commit | afe1d5ee654c55d720545131d408d6baf24829cb (patch) | |
tree | 20814e3458e6675e5be0ea8f513b788f58c570f3 /tests | |
parent | 5ee8650eb4711e6a290667f6eb2b5a4c53a41945 (diff) | |
parent | 42c9c96361f113004fa0af23cfb2164b135f174d (diff) | |
download | qt-creator-afe1d5ee654c55d720545131d408d6baf24829cb.tar.gz |
Merge remote-tracking branch 'origin/2.8'
Conflicts:
src/plugins/coreplugin/documentmanager.cpp
Change-Id: I6dc025bc0f31eb694c8d9e2dd4ea5cc888ee8a94
Diffstat (limited to 'tests')
48 files changed, 138 insertions, 27 deletions
diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp index ba889c0ee7..fa6a3b7019 100644 --- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp +++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp @@ -198,6 +198,7 @@ private slots: void test_checksymbols_highlightingUsedTemplateFunctionParameter_QTCREATORBUG6861(); void test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_namespace(); void test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_insideFunction(); + void test_alias_decl_QTCREATORBUG9386(); }; void tst_CheckSymbols::test_checksymbols_TypeUse() @@ -1727,6 +1728,21 @@ void tst_CheckSymbols::test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORB TestData::check(source, expectedUses); } +void tst_CheckSymbols::test_alias_decl_QTCREATORBUG9386() +{ + const QByteArray source = + "using wobble = int;\n" + "wobble cobble = 1;\n" + ; + + const QList<Use> expectedUses = QList<Use>() + << Use(1, 7, 6, CppHighlightingSupport::TypeUse) + << Use(2, 1, 6, CppHighlightingSupport::TypeUse) + ; + + TestData::check(source, expectedUses); +} + void tst_CheckSymbols::test_checksymbols_highlightingUsedTemplateFunctionParameter_QTCREATORBUG6861() { const QByteArray source = diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/QDebug b/tests/auto/cplusplus/preprocessor/data/include-data/global/QDebug new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/QDebug @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/QDir b/tests/auto/cplusplus/preprocessor/data/include-data/global/QDir new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/QDir @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/QString b/tests/auto/cplusplus/preprocessor/data/include-data/global/QString new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/QString @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/except b/tests/auto/cplusplus/preprocessor/data/include-data/global/except new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/except @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/global.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/global.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/global.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/iostream b/tests/auto/cplusplus/preprocessor/data/include-data/global/iostream new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/iostream @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/fileother.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/fileother.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/lib/fileother.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/fileother.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/fileother.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/otherlib/fileother.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/string b/tests/auto/cplusplus/preprocessor/data/include-data/global/string new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/string @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/global/utils/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/global/utils/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/global/utils/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/a.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/a.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/a.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/b.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/b.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/b.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/fileother.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/fileother.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/fileother.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/header.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/header.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/header.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/fileother.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/fileother.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/lib/fileother.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/file.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/file.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/file.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/fileother.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/fileother.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/otherlib/fileother.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixa.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixa.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixa.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixb.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixb.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixb.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixc.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixc.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/prefixc.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/stuff b/tests/auto/cplusplus/preprocessor/data/include-data/local/stuff new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/stuff @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/utils/utils.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/utils/utils.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/utils/utils.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/y.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/y.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/y.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/include-data/local/z.h b/tests/auto/cplusplus/preprocessor/data/include-data/local/z.h new file mode 100644 index 0000000000..fef83a9cfe --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/include-data/local/z.h @@ -0,0 +1 @@ +// comment diff --git a/tests/auto/cplusplus/preprocessor/data/recursive.2.cpp b/tests/auto/cplusplus/preprocessor/data/recursive.2.cpp new file mode 100644 index 0000000000..0e3a6e64a5 --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/recursive.2.cpp @@ -0,0 +1,6 @@ +#define a(x) b(x) c(x) +#define b(x) c(x) a(x) +#define c(x) a(x) b(x) + +b(1) +a(1) diff --git a/tests/auto/cplusplus/preprocessor/data/recursive.2.out.cpp b/tests/auto/cplusplus/preprocessor/data/recursive.2.out.cpp new file mode 100644 index 0000000000..1068e6856e --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/recursive.2.out.cpp @@ -0,0 +1,12 @@ +# 1 "data/recursive.2.cpp" + + + + +# expansion begin 70,1 ~2 5:2 ~3 5:2 ~3 5:2 ~3 5:2 ~3 5:2 ~3 5:2 ~1 +b(1) c(1) b(1) b(1) a(1) b(1) +# expansion end +# expansion begin 75,1 ~2 6:2 ~3 6:2 ~3 6:2 ~3 6:2 ~3 6:2 ~3 6:2 ~1 +a(1) b(1) a(1) a(1) c(1) a(1) +# expansion end +# 7 "data/recursive.2.cpp" diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index bb08b578ae..834a579092 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -822,6 +822,8 @@ void tst_Preprocessor::comparisons_data() << "reserved.1.cpp" << "reserved.1.out.cpp" << ""; QTest::newRow("recursive 1") << "recursive.1.cpp" << "recursive.1.out.cpp" << ""; + QTest::newRow("recursive 2") + << "recursive.2.cpp" << "recursive.2.out.cpp" << ""; QTest::newRow("macro_pounder_fn") << "macro_pounder_fn.c" << "" << ""; QTest::newRow("macro_expand") diff --git a/tests/auto/cplusplus/semantic/tst_semantic.cpp b/tests/auto/cplusplus/semantic/tst_semantic.cpp index 860a9940bc..bc6631a8a8 100644 --- a/tests/auto/cplusplus/semantic/tst_semantic.cpp +++ b/tests/auto/cplusplus/semantic/tst_semantic.cpp @@ -154,6 +154,7 @@ private slots: void function_declaration_2(); void function_definition_1(); void nested_class_1(); + void alias_declaration_1(); void typedef_1(); void typedef_2(); void typedef_3(); @@ -320,6 +321,25 @@ void tst_Semantic::nested_class_1() QCOMPARE(namedTy->name()->asNameId()->identifier(), objectId); } +void tst_Semantic::alias_declaration_1() +{ + QSharedPointer<Document> doc = document( + "using wobble = int;\n" + , false, false, true); + + QCOMPARE(doc->errorCount, 0U); + QCOMPARE(doc->globals->memberCount(), 1U); + + Declaration *decl = doc->globals->memberAt(0)->asDeclaration(); + QVERIFY(decl->name()); + QVERIFY(decl->name()->identifier()); + QCOMPARE(decl->name()->identifier()->chars(), "wobble"); + + QVERIFY(decl->isTypedef()); + QVERIFY(decl->type().isTypedef()); + QVERIFY(decl->type()->isIntegerType()); +} + void tst_Semantic::typedef_1() { QSharedPointer<Document> doc = document( diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 1f61720f8e..573f32bb14 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1058,7 +1058,7 @@ void tst_Dumpers::dumper_data() << Data("#include <QByteArray>\n", "const char *str1 = \"\356\";\n" "const char *str2 = \"\xee\";\n" - "const char *str3 = \"\\ee\";\n" + "const char *str3 = \"\\\\ee\";\n" "QByteArray buf1(str1);\n" "QByteArray buf2(str2);\n" "QByteArray buf3(str3);\n" diff --git a/tests/auto/debugger/tst_gdb.cpp b/tests/auto/debugger/tst_gdb.cpp index fb44a01e48..78f72cc3fa 100644 --- a/tests/auto/debugger/tst_gdb.cpp +++ b/tests/auto/debugger/tst_gdb.cpp @@ -113,6 +113,10 @@ void tst_gdb::version_data() QTest::newRow("QNX") << "GNU gdb (GDB) 7.3 qnx (rev. 613)" << 70300 << 613 << false << true; + + QTest::newRow("rubenvb") + << "GNU gdb (rubenvb-4.7.2-release) 7.5.50.20120920-cvs" + << 70550 << 20120920 << false << false; } static QString chopConst(QString type) diff --git a/tests/system/README b/tests/system/README index a2797a5e89..8f4330ae7f 100644 --- a/tests/system/README +++ b/tests/system/README @@ -24,6 +24,7 @@ This folder must contain the following: * additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below Fifth - you'll have to make sure that some needed tools are available (no matter on which OS you're on). + * qmake * cmake * wget or curl Normally it should be okay to just install them as usual and add their executables' path(s) to the PATH variable. diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 6ec99af4c7..23ae419410 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -7,7 +7,7 @@ <valuemap type="QVariantMap"> <value type="int" key="Id">1</value> <value type="QString" key="Name">Harmattan Target (Qt SDK)</value> - <value type="QString" key="QMakePath">~/QtSDK/Madde/targets/harmattan_10.2011.34-1/bin/qmake</value> + <value type="QString" key="QMakePath">~/QtSDK/Madde/targets/harmattan_10.2011.34-1_rt1.2/bin/qmake</value> <value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Maemo</value> <value type="bool" key="isAutodetected">false</value> </valuemap> diff --git a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml index 8c47f59d40..8a3b2edf17 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml @@ -77,7 +77,7 @@ <valuemap type="QVariantMap"> <value type="int" key="Id">15</value> <value type="QString" key="Name">Harmattan Target (Qt SDK)</value> - <value type="QString" key="QMakePath">c:/qtsdk/madde/targets/harmattan_10.2011.34-1/bin/qmake.exe</value> + <value type="QString" key="QMakePath">c:/qtsdk/madde/targets/harmattan_10.2011.34-1_rt1.2/bin/qmake.exe</value> <value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Maemo</value> <value type="bool" key="isAutodetected">false</value> </valuemap> diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py index 425d7707c4..96ab52279b 100644 --- a/tests/system/shared/project_explorer.py +++ b/tests/system/shared/project_explorer.py @@ -184,7 +184,7 @@ def getQtInformationForQmlProject(): invokeMenuItem("Tools", "Options...") waitForObjectItem(":Options_QListView", "Build & Run") clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") targetsTreeView = waitForObject(":Kits_Or_Compilers_QTreeView") if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % kit, True): test.fatal("Found no matching kit - this shouldn't happen.") @@ -192,7 +192,7 @@ def getQtInformationForQmlProject(): return None, None, None, None qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText) test.log("Kit '%s' uses Qt Version '%s'" % (kit, qtVersionStr)) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions") treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget") if not __selectTreeItemOnBuildAndRun__(treeWidget, qtVersionStr): test.fatal("Found no matching Qt Version for kit - this shouldn't happen.") diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py index 7fa0347ea6..f492206fb3 100755 --- a/tests/system/shared/suites_qtta.py +++ b/tests/system/shared/suites_qtta.py @@ -66,7 +66,7 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True): def changeAutocompleteToManual(): invokeMenuItem("Tools", "Options...") mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Completion") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion") ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False) selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually") verifyEnabled(":Options.OK_QPushButton") diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 2e8d5ce2dc..e10d1b3012 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -94,7 +94,8 @@ def selectFromCombo(objectSpec, itemName): else: mouseClick(object, 5, 5, 0, Qt.LeftButton) mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton) - waitFor("str(object.currentText)==itemName", 5000) + test.verify(waitFor("str(object.currentText)==itemName", 5000), + "Switched combo item to '%s'" % itemName) return True def selectFromLocator(filter, itemName = None): @@ -293,7 +294,7 @@ def addHelpDocumentationFromSDK(): waitForObjectItem(":Options_QListView", "Help") clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton) waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}") - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Documentation") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation") # get rid of all docs already registered listWidget = waitForObject("{type='QListWidget' name='docsListWidget' visible='1'}") if listWidget.count > 0: @@ -484,7 +485,7 @@ def iterateQtVersions(keepOptionsOpen=False, alreadyOnOptionsDialog=False, invokeMenuItem("Tools", "Options...") waitForObjectItem(":Options_QListView", "Build & Run") clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions") pattern = re.compile("Qt version (?P<version>.*?) for (?P<target>.*)") treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget") root = treeWidget.invisibleRootItem() @@ -545,7 +546,7 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False, invokeMenuItem("Tools", "Options...") waitForObjectItem(":Options_QListView", "Build & Run") clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") treeView = waitForObject(":Kits_Or_Compilers_QTreeView") model = treeView.model() test.compare(model.rowCount(), 2, "Verifying expected target section count") @@ -588,7 +589,7 @@ def setAlwaysStartFullHelp(): invokeMenuItem("Tools", "Options...") waitForObjectItem(":Options_QListView", "Help") clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "General") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General") selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Start Full Help") clickButton(waitForObject(":Options.OK_QPushButton")) @@ -650,3 +651,13 @@ def readFile(filename): def simpleFileName(navigatorFileName): return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","") + +def clickOnTab(tabBarStr, tabText, timeout=5000): + if platform.system() == 'Darwin': + if not waitFor("object.exists(tabBarStr)", timeout): + raise LookupError("Could not find QTabBar: %s" % objectMap.realName(tabBarStr)) + tabBar = findObject(tabBarStr) + if not tabBar.visible: + test.log("Using workaround for Mac.") + setWindowState(tabBar, WindowState.Normal) + clickTab(waitForObject(tabBarStr, timeout), tabText) diff --git a/tests/system/suite_QMLS/tst_QMLS01/test.py b/tests/system/suite_QMLS/tst_QMLS01/test.py index 36ad9f9176..0b65f47b43 100644 --- a/tests/system/suite_QMLS/tst_QMLS01/test.py +++ b/tests/system/suite_QMLS/tst_QMLS01/test.py @@ -62,8 +62,10 @@ def testSuggestionsAuto(lineText, textToType, expectedText, keyToUseSuggestion): if not __beginTestSuggestions__(editorArea, lineText, textToType): return False # check if suggestions are shown - test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView"), - "Verifying if suggestions in automatic mode are shown.") + if not test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView"), + "Verifying if suggestions in automatic mode are shown."): + __endTestSuggestions__(editorArea) + return False # verify proposed suggestions verifySuggestions(textToType) # test if suggestion can be selected with keyToUseSuggestion @@ -83,8 +85,10 @@ def testSuggestionsManual(lineText, textToType, expectedText): if not __beginTestSuggestions__(editorArea, lineText, textToType): return False # wait if automatic popup displayed - if yes then fail, because we are in manual mode - test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView", False), - "Verifying if suggestions in manual mode are properly not automatically shown") + if not test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView", False), + "Verifying if suggestions in manual mode are not automatically shown"): + __endTestSuggestions__(editorArea) + return False # test if suggestion can be invoked manually if platform.system() == "Darwin": type(editorArea, "<Meta+Space>") diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 6be228399d..27ad61f7d6 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -127,7 +127,7 @@ def safeClickTab(tab): for bar in [":*Qt Creator.JavaScript_QTabBar", ":*Qt Creator.Events_QTabBar"]: try: - clickTab(waitForObject(bar, 1000), tab) + clickOnTab(bar, tab, 1000) return True except: pass diff --git a/tests/system/suite_editors/tst_basic_cpp_support/test.py b/tests/system/suite_editors/tst_basic_cpp_support/test.py index ca769a0a43..b009b5d6f6 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -46,7 +46,8 @@ def main(): if not startedWithoutPluginError(): return overrideInstallLazySignalHandler() - installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()", + # used simplified object to omit the visible property - causes Squish problem here otherwise + installLazySignalHandler("{type='CppEditor::Internal::CPPEditorWidget'}", "textChanged()", "__handleTextChanged__") openQmakeProject(proFile) progressBarWait(20000) @@ -120,6 +121,13 @@ def __typeAndWaitForAction__(editor, keyCombination): textChanged = False cursorPos = editor.textCursor().position() type(editor, keyCombination) - waitFor("textChanged or editor.textCursor().position() != cursorPos", 2000) - if not (textChanged or editor.textCursor().position()!=cursorPos): + waitFor("textChanged or cppEditorPositionChanged(cursorPos)", 2000) + if not (textChanged or cppEditorPositionChanged(cursorPos)): test.warning("Waiting timed out...") + +def cppEditorPositionChanged(origPos): + try: + editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget", 500) + return editor.textCursor().position() != origPos + except: + return False diff --git a/tests/system/suite_editors/tst_modify_readonly/test.py b/tests/system/suite_editors/tst_modify_readonly/test.py index d31b244b0c..11a29a5c72 100644 --- a/tests/system/suite_editors/tst_modify_readonly/test.py +++ b/tests/system/suite_editors/tst_modify_readonly/test.py @@ -103,8 +103,8 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles): try: filesTree = waitForObject("{name='treeWidget' type='QTreeWidget' visible='1' " "window=':WritePermissions_Core::Internal::ReadOnlyFilesDialog'}") - items = map(os.path.join, dumpItems(filesTree.model(), column=4), - dumpItems(filesTree.model(), column=3)) + items = map(os.path.expanduser, map(os.path.join, dumpItems(filesTree.model(), column=4), + dumpItems(filesTree.model(), column=3))) difference = set(readOnlyFiles) ^ set(items) test.verify(len(difference) == 0, "Verifying whether all modified files without write " "permission are listed.") diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index a28779104d..ab8e02fc30 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -64,7 +64,7 @@ def __checkBuildAndRun__(): expectedCompilers = __getExpectedCompilers__() foundCompilers = [] foundCompilerNames = [] - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Compilers") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Compilers") compilerTV = waitForObject(":Kits_Or_Compilers_QTreeView") __iterateTree__(compilerTV, __compFunc__, foundCompilers, foundCompilerNames) test.verify(__compareCompilers__(foundCompilers, expectedCompilers), @@ -72,13 +72,13 @@ def __checkBuildAndRun__(): # check Qt versions qmakePath = which("qmake") foundQt = [] - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions") qtTW = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget") __iterateTree__(qtTW, __qtFunc__, foundQt, qmakePath) if foundQt: foundQt = foundQt[0] # check kits - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") kitsTV = waitForObject(":Kits_Or_Compilers_QTreeView") __iterateTree__(kitsTV, __kitFunc__, foundQt, foundCompilerNames) diff --git a/tests/system/suite_general/tst_installed_languages/test.py b/tests/system/suite_general/tst_installed_languages/test.py index 0ca89bff74..52f525e611 100644 --- a/tests/system/suite_general/tst_installed_languages/test.py +++ b/tests/system/suite_general/tst_installed_languages/test.py @@ -38,7 +38,7 @@ def main(): invokeMenuItem("Tools", "Options...") waitForObjectItem(":Options_QListView", "Environment") clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton) - clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "General") + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General") languageName = testData.field(lang, "language") selectFromCombo(":User Interface.languageBox_QComboBox", languageName) clickButton(waitForObject(":Options.OK_QPushButton")) diff --git a/tests/tools/cplusplus-ast2png/dumpers.inc b/tests/tools/cplusplus-ast2png/dumpers.inc index bc9c485713..caf4b8d772 100644 --- a/tests/tools/cplusplus-ast2png/dumpers.inc +++ b/tests/tools/cplusplus-ast2png/dumpers.inc @@ -865,8 +865,7 @@ virtual bool visit(AliasDeclarationAST *ast) { if (ast->using_token) terminal(ast->using_token, ast); - if (ast->identifier_token) - terminal(ast->identifier_token, ast); + nonterminal(ast->name); if (ast->equal_token) terminal(ast->equal_token, ast); nonterminal(ast->typeId); |