From dc04d92af6a5b7b2fbb7385f437b34b27a964a8a Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 22 Nov 2013 00:19:46 +0100 Subject: qmljs: fix persistent trie tests Change-Id: I77baa46fd6f01d252fdd7a035d477433659c56dc Reviewed-by: Thomas Hartmann --- tests/auto/qml/persistenttrie/persistenttrie.pro | 6 +++--- tests/auto/qml/persistenttrie/tst_testtrie.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/qml/persistenttrie/persistenttrie.pro b/tests/auto/qml/persistenttrie/persistenttrie.pro index d4273773c5..c9da2c9dac 100644 --- a/tests/auto/qml/persistenttrie/persistenttrie.pro +++ b/tests/auto/qml/persistenttrie/persistenttrie.pro @@ -3,9 +3,9 @@ include(../../qttest.pri) DEFINES+=QTCREATORDIR=\\\"$$IDE_SOURCE_TREE\\\" DEFINES+=TESTSRCDIR=\\\"$$PWD\\\" -include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri) -include($$IDE_SOURCE_TREE/src/libs/languageutils/languageutils.pri) -include($$IDE_SOURCE_TREE/src/libs/qmljs/qmljs.pri) +include($$IDE_SOURCE_TREE/src/libs/utils/utils-lib.pri) +include($$IDE_SOURCE_TREE/src/libs/languageutils/languageutils-lib.pri) +include($$IDE_SOURCE_TREE/src/libs/qmljs/qmljs-lib.pri) TARGET = tst_trie_check diff --git a/tests/auto/qml/persistenttrie/tst_testtrie.cpp b/tests/auto/qml/persistenttrie/tst_testtrie.cpp index 52370b221d..958e6b65da 100644 --- a/tests/auto/qml/persistenttrie/tst_testtrie.cpp +++ b/tests/auto/qml/persistenttrie/tst_testtrie.cpp @@ -350,7 +350,7 @@ void interactiveCompletionTester(){ res = matchStrengthSort(line,res); qDebug() << "possible completions:["; foreach (const QString &s, res) { - qDebug() << s; + qDebug() << matchStrength(line,s) << " " << s; } qDebug() << "]"; } -- cgit v1.2.1 From eac518aee6ea7173e5462fe16768ebb1b3f54b29 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 24 Nov 2013 18:25:32 +0200 Subject: C++: Support __thread and thread_local Task-number: QTCREATORBUG-7679 Change-Id: I794f52b2bcfb6c78ceef86ec53b6ed32b3d53d9f Reviewed-by: Orgad Shaneh Reviewed-by: Erik Verbruggen --- tests/auto/cplusplus/ast/tst_ast.cpp | 11 +++++++++++ tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp | 1 + tests/auto/cplusplus/cxx11/tst_cxx11.cpp | 1 + 3 files changed, 13 insertions(+) create mode 100644 tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp (limited to 'tests') diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index 449c8db6e5..b7474ae874 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -107,6 +107,7 @@ private slots: void gcc_attributes_2(); void gcc_attributes_3(); void crash_test_1(); + void thread_local_1(); // expressions void simple_name_1(); @@ -246,6 +247,16 @@ void tst_AST::crash_test_1() QVERIFY(ast); } +void tst_AST::thread_local_1() +{ + QSharedPointer unit(parseStatement("__thread int i;\n")); + AST *ast = unit->ast(); + QVERIFY(ast); + QCOMPARE(diag.errorCount, 0); + QCOMPARE(Token::name(T_THREAD_LOCAL), "thread_local"); + QCOMPARE(Token::name(T___THREAD), "__thread"); +} + void tst_AST::simple_declaration_1() { QSharedPointer unit(parseStatement("\n" diff --git a/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp b/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp new file mode 100644 index 0000000000..b286b0bcee --- /dev/null +++ b/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp @@ -0,0 +1 @@ +thread_local int i; diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp index 8ac002e376..9320ab24e3 100644 --- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp +++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp @@ -151,6 +151,7 @@ void tst_cxx11::parse_data() QTest::newRow("templateGreaterGreater.1") << "templateGreaterGreater.1.cpp" << ""; QTest::newRow("packExpansion.1") << "packExpansion.1.cpp" << ""; QTest::newRow("declType.1") << "declType.1.cpp" << ""; + QTest::newRow("threadLocal.1") << "threadLocal.1.cpp" << ""; } void tst_cxx11::parse() -- cgit v1.2.1 From 574d702893d32c0e6ed9074495d7bf5fe08e4d71 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 25 Nov 2013 17:31:32 +0100 Subject: Squish: Expect fails in tst_git_clone Task-number: QTCREATORBUG-10531 Change-Id: Ifb7a05826824e4e8da13a851ebcdd5b444579a94 Reviewed-by: Christian Stenger --- tests/system/suite_tools/tst_git_clone/test.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_tools/tst_git_clone/test.py b/tests/system/suite_tools/tst_git_clone/test.py index 6ccbfb760b..576cc6d094 100644 --- a/tests/system/suite_tools/tst_git_clone/test.py +++ b/tests/system/suite_tools/tst_git_clone/test.py @@ -33,24 +33,28 @@ cloneUrl = "https://codereview.qt-project.org/p/qt-labs/jom" cloneDir = "myCloneOfJom" def verifyCloneLog(targetDir, canceled): + # Expect fails because of QTCREATORBUG-10531 cloneLog = waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit") - waitFor('"The process terminated " in str(cloneLog.plainText)', 30000) - test.verify(("Executing in " + targetDir + ":" in str(cloneLog.plainText)), - "Searching for target directory in clone log") - test.verify((" ".join(["clone", cloneUrl, cloneDir]) in str(cloneLog.plainText)), - "Searching for git parameters in clone log") - test.verify(("Stopping..." in str(cloneLog.plainText)) ^ (not canceled), - "Searching for 'Stopping...' in clone log") + finish = findObject(":Git Repository Clone.Finish_QPushButton") + waitFor("finish.enabled", 30000) + test.xverify(("Executing in " + targetDir + ":" in str(cloneLog.plainText)), + "Searching for target directory in clone log") + test.xverify((" ".join(["clone", cloneUrl, cloneDir]) in str(cloneLog.plainText)), + "Searching for git parameters in clone log") if canceled: + test.xverify("Stopping..." in str(cloneLog.plainText), + "Searching for 'Stopping...' in clone log") result = "The process terminated in an abnormal way." summary = "Failed." else: + test.verify(not "Stopping..." in str(cloneLog.plainText), + "Searching for 'Stopping...' in clone log") test.verify(("'" + cloneDir + "'..." in str(cloneLog.plainText)), "Searching for clone directory in clone log") result = "The process terminated with exit code 0." summary = "Succeeded." - test.verify((result in str(cloneLog.plainText)), - "Searching for result (%s) in clone log:\n%s" + test.xverify((result in str(cloneLog.plainText)), + "Searching for result (%s) in clone log:\n%s" % (result, str(cloneLog.plainText))) test.compare(waitForObject(":Git Repository Clone.Result._QLabel").text, summary) -- cgit v1.2.1 From cef8ff2944413678129a87218ff4595f0e9c0c83 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 23 Nov 2013 01:03:10 +0100 Subject: Debugger: Fix some of the QMap dumper autotests The order of entries was changed ab52154010. Task-number: QTCREATORBUG-10888 Change-Id: I50f97396fd0f94e4bbaefb30fae8419e89bd4f4d Reviewed-by: Christian Stenger Reviewed-by: Ulf Hermann --- tests/auto/debugger/tst_dumpers.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 4a5568a19a..b48602e7f6 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1962,14 +1962,12 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Check("map", "<3 items>", "@QMap<@QString, @QPointer<@QObject>>") % Check("map.0", "[0]", "", "@QMapNode<@QString, @QPointer<@QObject>>") - % Check("map.0.key", Value4("\".\""), "@QString") - % Check("map.0.key", Value5("\"Hallo\""), "@QString") + % Check("map.0.key", "\".\"", "@QString") % Check("map.0.value", "", "@QPointer<@QObject>") //% Check("map.0.value.o", Pointer(), "@QObject") // FIXME: it's '.wp' in Qt 5 % Check("map.1", "[1]", "", "@QMapNode<@QString, @QPointer<@QObject>>") - % Check("map.1.key", Value4("\"Hallo\""), "@QString") - % Check("map.1.key", Value5("\".\""), "@QString") + % Check("map.1.key", "\"Hallo\"", "@QString") % Check("map.2", "[2]", "", "@QMapNode<@QString, @QPointer<@QObject>>") % Check("map.2.key", "\"Welt\"", "@QString"); @@ -1989,8 +1987,7 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Check("map", "<4 items>", "@QMap<@QString, @QList>") % Check("map.0", "[0]", "", "@QMapNode<@QString, @QList>") - % Check("map.0.key", Value4("\"1\""), "@QString") - % Check("map.0.key", Value5("\"bar\""), "@QString") + % Check("map.0.key", "\"1\"", "@QString") % Check("map.0.value", "<3 items>", "@QList") % Check("map.0.value.0", "[0]", "", "nsA::nsB::SomeType") % Check("map.0.value.0.a", "1", "int") @@ -1999,8 +1996,7 @@ void tst_Dumpers::dumper_data() % Check("map.0.value.2", "[2]", "", "nsA::nsB::SomeType") % Check("map.0.value.2.a", "3", "int") % Check("map.3", "[3]", "", "@QMapNode<@QString, @QList>") - % Check("map.3.key", Value4("\"foo\""), "@QString") - % Check("map.3.key", Value5("\"2\""), "@QString") + % Check("map.3.key", "\"foo\"", "@QString") % Check("map.3.value", "<3 items>", "@QList") % Check("map.3.value.2", "[2]", "", "nsA::nsB::SomeType") % Check("map.3.value.2.a", "3", "int") @@ -2071,17 +2067,14 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Check("map", "<4 items>", "@QMultiMap<@QString, @QPointer<@QObject>>") % Check("map.0", "[0]", "", "@QMapNode<@QString, @QPointer<@QObject>>") - % Check("map.0.key", Value4("\".\""), "@QString") - % Check("map.0.key", Value5("\"Hallo\""), "@QString") + % Check("map.0.key", "\".\"", "@QString") % Check("map.0.value", "", "@QPointer<@QObject>") % Check("map.1", "[1]", "", "@QMapNode<@QString, @QPointer<@QObject>>") % Check("map.1.key", "\".\"", "@QString") % Check("map.2", "[2]", "", "@QMapNode<@QString, @QPointer<@QObject>>") - % Check("map.2.key", Value4("\"Hallo\""), "@QString") - % Check("map.2.key", Value5("\"Welt\""), "@QString") + % Check("map.2.key", "\"Hallo\"", "@QString") % Check("map.3", "[3]", "", "@QMapNode<@QString, @QPointer<@QObject>>") - % Check("map.3.key", Value4("\"Welt\""), "@QString") - % Check("map.3.key", Value5("\".\""), "@QString"); + % Check("map.3.key", "\"Welt\"", "@QString"); QTest::newRow("QObject1") @@ -3703,15 +3696,11 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Check("vm", "<6 items>", "@QVariantMap") % Check("vm.0", "[0]", "", "@QMapNode<@QString, @QVariant>") - % Check("vm.0.key", Value4("\"a\""), "@QString") - % Check("vm.0.value", Value4("1"), "@QVariant (int)") - % Check("vm.0.key", Value5("\"b\""), "@QString") - % Check("vm.0.value", Value5("2"), "@QVariant (int)") + % Check("vm.0.key", "\"a\"", "@QString") + % Check("vm.0.value", "1", "@QVariant (int)") % Check("vm.5", "[5]", "", "@QMapNode<@QString, @QVariant>") - % Check("vm.5.key", Value4("\"f\""), "@QString") - % Check("vm.5.value", Value4("\"2Some String\""), "@QVariant (QString)") - % Check("vm.5.key", Value5("\"f\""), "@QString") - % Check("vm.5.value", Value5("\"2Some String\""), "@QVariant (QString)"); + % Check("vm.5.key", "\"f\"", "@QString") + % Check("vm.5.value", "\"2Some String\"", "@QVariant (QString)"); QTest::newRow("QVariantHash1") << Data("#include \n", -- cgit v1.2.1 From da7b861e694ab433b5a44af663dbdab9e88d7ca5 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 26 Nov 2013 09:48:05 +0100 Subject: Designer: Tests: Remove reference data ...it's mostly bloat. We can easily check for the function declarations in the definitions in the resulting document. Change-Id: I9022faf97a78ae599825ec891011117d65ea0aa5 Reviewed-by: Friedemann Kleint Reviewed-by: Erik Verbruggen --- .../gotoslot_withoutProject/reference_form.cpp | 22 ------------------ .../gotoslot_withoutProject/reference_form.h | 27 ---------------------- 2 files changed, 49 deletions(-) delete mode 100644 tests/designer/gotoslot_withoutProject/reference_form.cpp delete mode 100644 tests/designer/gotoslot_withoutProject/reference_form.h (limited to 'tests') diff --git a/tests/designer/gotoslot_withoutProject/reference_form.cpp b/tests/designer/gotoslot_withoutProject/reference_form.cpp deleted file mode 100644 index fc313de178..0000000000 --- a/tests/designer/gotoslot_withoutProject/reference_form.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright header - -#include "form.h" -#include "ui_form.h" - -Form::Form(QWidget *parent) : - QWidget(parent), - ui(new Ui::Form) -{ - ui->setupUi(this); -} - -Form::~Form() -{ - delete ui; -} - - -void Form::on_pushButton_clicked() -{ - -} diff --git a/tests/designer/gotoslot_withoutProject/reference_form.h b/tests/designer/gotoslot_withoutProject/reference_form.h deleted file mode 100644 index 68e66ff679..0000000000 --- a/tests/designer/gotoslot_withoutProject/reference_form.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright header - -#ifndef FORM_H -#define FORM_H - -#include - -namespace Ui { -class Form; -} - -class Form : public QWidget -{ - Q_OBJECT - -public: - explicit Form(QWidget *parent = 0); - ~Form(); - -private slots: - void on_pushButton_clicked(); - -private: - Ui::Form *ui; -}; - -#endif // FORM_H -- cgit v1.2.1 From 204cc21f0cc10fe268c1ab6b54e9916e8c98a316 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 20 Nov 2013 17:24:07 +0100 Subject: Designer: Insert into correct class for "Go to slot" Make use of LookupContext to find the right class. Task-number: QTCREATORBUG-10348 Change-Id: I7f8ec769ff2239d5123726e562a1bd430f8c4567 Reviewed-by: Friedemann Kleint Reviewed-by: Erik Verbruggen --- .../form.cpp | 9 ++++++ .../form.h | 27 ++++++++++++++++++ .../form.cpp | 16 +++++++++++ .../gotoslot_insertIntoCorrectClass_pointer/form.h | 30 ++++++++++++++++++++ .../form.cpp | 16 +++++++++++ .../form.h | 28 +++++++++++++++++++ .../form.ui | 32 ++++++++++++++++++++++ 7 files changed, 158 insertions(+) create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h create mode 100644 tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui (limited to 'tests') diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp new file mode 100644 index 0000000000..5e246d377b --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp @@ -0,0 +1,9 @@ +// Copyright header + +#include "form.h" + +Form::Form(QWidget *parent) : + QWidget(parent) +{ + ui.setupUi(this); +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h new file mode 100644 index 0000000000..4f35262bea --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h @@ -0,0 +1,27 @@ +// Copyright header + +#ifndef FORM_H +#define FORM_H + +#include "ui_form.h" + +#include + +class Form; +struct MyClass +{ + Form *form; +}; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + +private: + Ui::Form ui; +}; + +#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp new file mode 100644 index 0000000000..449bda3749 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp @@ -0,0 +1,16 @@ +// Copyright header + +#include "form.h" +#include "ui_form.h" + +Form::Form(QWidget *parent) : + QWidget(parent), + ui(new Ui::Form) +{ + ui->setupUi(this); +} + +Form::~Form() +{ + delete ui; +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h new file mode 100644 index 0000000000..3f5ddba574 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h @@ -0,0 +1,30 @@ +// Copyright header + +#ifndef FORM_H +#define FORM_H + +#include + +namespace Ui { +class Form; +} + +class Form; +struct MyClass +{ + Form *form; +}; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + ~Form(); + +private: + Ui::Form *ui; +}; + +#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp new file mode 100644 index 0000000000..449bda3749 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp @@ -0,0 +1,16 @@ +// Copyright header + +#include "form.h" +#include "ui_form.h" + +Form::Form(QWidget *parent) : + QWidget(parent), + ui(new Ui::Form) +{ + ui->setupUi(this); +} + +Form::~Form() +{ + delete ui; +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h new file mode 100644 index 0000000000..13fdfa5b23 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h @@ -0,0 +1,28 @@ +// Copyright header + +#ifndef N_FORM_H +#define N_FORM_H + +#include + +namespace N { +namespace Ui { +class Form; +} +} + +using namespace N; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + ~Form(); + +private: + Ui::Form *ui; +}; + +#endif // N_FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui new file mode 100644 index 0000000000..ebe1479342 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui @@ -0,0 +1,32 @@ + + + N::Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 60 + 60 + 80 + 21 + + + + PushButton + + + + + + -- cgit v1.2.1 From e84665186a82a42b92b0cd6a3e1ad24004d74f3d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 22 Nov 2013 12:40:46 +0100 Subject: Squish: Fix tst_HELP04 Replace waiting for signal textChanged(). Change-Id: I010f65cb0b1130c2ba95921c5f128ca955a7ac69 Reviewed-by: Robert Loehning --- tests/system/suite_HELP/tst_HELP04/test.py | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 42837a730a..e45c41e5c3 100755 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -34,24 +34,34 @@ import re # test search in help mode and advanced search searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bld":False } + def __getSelectedText__(): + hv = findObject(":Qt Creator_Help::Internal::HelpViewer") try: - selText = findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText + selText = hv.selectedText if className(selText) != 'instancemethod': return str(selText) except: pass try: - hv = findObject(":Qt Creator_Help::Internal::HelpViewer") selText = getHighlightsInHtml(str(hv.toHtml())) except: test.warning("Could not get highlighted text.") selText = '' return str(selText) -def __handleTextChanged__(obj): - global textHasChanged - textHasChanged = True +def __getUrl__(): + helpViewer = findObject(":Qt Creator_Help::Internal::HelpViewer") + try: + url = helpViewer.url + except: + try: + url = helpViewer.source + except: + return "" + if isQt4Build: + return str(url.toString()) + return str(url.scheme) + "://" + str(url.host) + str(url.path) def getHighlightsInHtml(htmlCode): pattern = re.compile('color:#ff0000;">(.*?)') @@ -60,16 +70,14 @@ def getHighlightsInHtml(htmlCode): if curr.group(1) in res: continue res += "%s " % curr.group(1) - test.log(res) return res def main(): - global sdkPath, textHasChanged + global sdkPath noMatch = "Your search did not match any documents." startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "textChanged()", "__handleTextChanged__") addHelpDocumentation([os.path.join(sdkPath, "Documentation", "qt.qch")]) # switch to help mode switchViewTo(ViewConstants.HELP) @@ -98,13 +106,13 @@ def main(): test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits'," "str(findObject(':Hits_QLabel').text))", 2000), "Verifying if search results found with 1+ hits for: " + searchKeyword) - textHasChanged = False selText = __getSelectedText__() + url = __getUrl__() # click in the widget, tab to first item and press enter mouseClick(waitForObject(":Hits_QCLuceneResultWidget"), 1, 1, 0, Qt.LeftButton) type(waitForObject(":Hits_QCLuceneResultWidget"), "") type(waitForObject(":Hits_QCLuceneResultWidget"), "") - waitFor("textHasChanged or selText != __getSelectedText__()") + waitFor("__getUrl__() != url or selText != __getSelectedText__()") # verify if search keyword is found in results test.verify(searchKeyword.lower() in __getSelectedText__().lower(), searchKeyword + " search result can be found") @@ -138,12 +146,12 @@ def main(): mouseClick(resultsView, 1, 1, 0, Qt.LeftButton) type(resultsView, "") type(resultsView, "") - test.verify("printing" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(), + test.verify("printing" in str(__getSelectedText__()).lower(), "printing advanced search result can be found") for i in range(2): type(resultsView, "") type(resultsView, "") - test.verify("sql" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(), + test.verify("sql" in str(__getSelectedText__()).lower(), "sql advanced search result can be found") # verify if simple search is properly disabled test.verify(findObject(":Qt Creator.Help_Search for:_QLineEdit").enabled == False, -- cgit v1.2.1 From ff2d6aa8f755a25a22047cfd83748ab373ea0c1d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 22 Nov 2013 17:05:56 +0100 Subject: Squish: Fix tst_simple_analyze The JavaScript tab is now disabled if there's no content at all. Change-Id: I00e0a6adabd42d0783ad6833fe707323f5a69aae Reviewed-by: Robert Loehning --- tests/system/suite_debugger/tst_simple_analyze/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 06f6808532..e2865380cf 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -88,8 +88,8 @@ def main(): waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000) clickButton(stopButton) if safeClickTab("JavaScript"): - model = waitForObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" - "Internal::QV8ProfilerEventsMainView").model() + model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" + "Internal::QV8ProfilerEventsMainView").model() test.compare(model.rowCount(), 0) if safeClickTab("Events"): colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9) -- cgit v1.2.1 From 429a26b3cd6fc481b319e6cfd2e8a481f3a80f92 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 26 Nov 2013 16:49:54 +0100 Subject: Debugger: Fix std::vector dumper for LLDB Change-Id: I83788acb6cfa9a659482d64bead10dd27e71fade Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index b48602e7f6..90dbab7af1 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -3115,6 +3115,7 @@ void tst_Dumpers::dumper_data() "v.push_back(true);\n" "v.push_back(false);\n" "unused(&v);\n") + // Known issue: Clang produces "std::vector> % Check("v", "<5 items>", "std::vector") % Check("v.0", "[0]", "1", "bool") % Check("v.1", "[1]", "0", "bool") -- cgit v1.2.1 From 2cd684b09211d9a64abc387ebe4b7547ea9dffbe Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 26 Nov 2013 11:03:21 +0100 Subject: Squish: Fix tst_HELP06 Getting Started is no more listed as separate entry. Change-Id: I840d92d73282221bfe178ded1a1d044a351235d3 Reviewed-by: Robert Loehning --- tests/system/suite_HELP/tst_HELP06/test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_HELP/tst_HELP06/test.py b/tests/system/suite_HELP/tst_HELP06/test.py index 9e7c45e3c8..18ab04a353 100755 --- a/tests/system/suite_HELP/tst_HELP06/test.py +++ b/tests/system/suite_HELP/tst_HELP06/test.py @@ -59,10 +59,8 @@ def main(): manualQModelIndex = getQModelIndexStr("text?='Qt Creator Manual *'", ":Qt Creator_QHelpContentWidget") doubleClick(manualQModelIndex, 5, 5, 0, Qt.LeftButton) - gettingStartedQModelIndex = getQModelIndexStr("text='Getting Started'", manualQModelIndex) - doubleClick(gettingStartedQModelIndex, 5, 5, 0, Qt.LeftButton) mouseClick(waitForObject(getQModelIndexStr("text='Building and Running an Example'", - gettingStartedQModelIndex)), 5, 5, 0, Qt.LeftButton) + manualQModelIndex)), 5, 5, 0, Qt.LeftButton) # open bookmarks window clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton")) clickButton(waitForObject(":Add Bookmark.ExpandBookmarksList_QToolButton")) -- cgit v1.2.1 From e34715094a6592084cdedc7eab8cad265a4348e6 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 26 Nov 2013 11:13:45 +0100 Subject: Squish: Fix tst_CSUP04 Change-Id: I165d39bca4dbf353a5a1fd6d6945c4ac4ebbd2b4 Reviewed-by: Robert Loehning --- tests/system/suite_CSUP/tst_CSUP04/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index d1d4180bef..6507db3289 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -65,7 +65,7 @@ def main(): return # wait until search finished and verify search results waitFor("searchFinished", 20000) - validateSearchResult(18) + validateSearchResult(14) result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " "File with used text is opened.") -- cgit v1.2.1 From 1e0a04a38b5db6507dd4bec655fbc7c403f7385c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 27 Nov 2013 08:26:46 +0100 Subject: Editor: Fix generic highlighter test. Change-Id: I055e8d45271faeee6933a047a6755bd834230159 Reviewed-by: Nikolai Kosjar --- .../highlighterengine/basetextdocumentlayout.cpp | 38 ++++++++++++++++++++++ .../highlighterengine/basetextdocumentlayout.h | 10 +++++- .../highlighterengine/highlighterengine.pro | 1 + .../highlighterengine/highlighterengine.qbs | 2 +- 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.cpp (limited to 'tests') diff --git a/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.cpp b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.cpp new file mode 100644 index 0000000000..ca5cf2e561 --- /dev/null +++ b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.cpp @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: 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 "basetextdocumentlayout.h" + +TextBlockUserData *BaseTextDocumentLayout::userData(const QTextBlock &block) +{ + TextBlockUserData *data = static_cast(block.userData()); + if (!data && block.isValid()) + const_cast(block).setUserData((data = new TextBlockUserData)); + return data; +} diff --git a/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h index 2692cfc791..55baf40d6b 100644 --- a/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h +++ b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h @@ -34,13 +34,21 @@ // Replaces the "real" basetextdocumentlayout.h file. +struct CodeFormatterData {}; + struct TextBlockUserData : QTextBlockUserData { - virtual ~TextBlockUserData(){} + TextBlockUserData() : m_data(0) {} + virtual ~TextBlockUserData() {} void setFoldingStartIncluded(const bool) {} void setFoldingEndIncluded(const bool) {} void setFoldingIndent(const int) {} + void setCodeFormatterData(CodeFormatterData *data) { m_data = data; } + CodeFormatterData *codeFormatterData() { return m_data; } + CodeFormatterData *m_data; }; +namespace BaseTextDocumentLayout { TextBlockUserData *userData(const QTextBlock &block); } + #endif // BASETEXTDOCUMENTLAYOUT_H diff --git a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro b/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro index 55d8711bbb..8a7b79a51b 100644 --- a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro +++ b/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro @@ -7,6 +7,7 @@ SOURCES += \ tst_highlighterengine.cpp \ highlightermock.cpp \ formats.cpp \ + basetextdocumentlayout.cpp \ syntaxhighlighter.cpp \ $$GENERICHIGHLIGHTERDIR/highlighter.cpp \ $$GENERICHIGHLIGHTERDIR/context.cpp \ diff --git a/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs b/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs index b8e214df86..e09b3161b4 100644 --- a/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs +++ b/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs @@ -31,7 +31,7 @@ Autotest { Group { name: "Drop-in sources for the plugin" files: [ - "basetextdocumentlayout.h", + "basetextdocumentlayout.h", "basetextdocumentlayout.cpp", "syntaxhighlighter.h", "syntaxhighlighter.cpp", "tabsettings.h" ] -- cgit v1.2.1 From 2d7b0d09ae4828356176d966fd0f66647c50900e Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 21 Nov 2013 22:57:22 +0100 Subject: Debugger: Add manual test for lambda Change-Id: I288826b0aed94de1f42a9eaddf3d40575e4e13e1 Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index ba55395eb3..4cb223d0c7 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -3068,6 +3068,24 @@ namespace stdptr { } // namespace stdptr +namespace lambda { + + void testLambda() + { +#ifdef USE_CXX11 + std::string x; + auto f = [&] () -> const std::string & { + int z = x.size(); + return x; + }; + auto c = f(); + BREAK_HERE; + dummyStatement(&x, &f, &c); +#endif + } + +} // namespace lambda + namespace stdset { void testStdSetInt() @@ -6859,6 +6877,7 @@ int main(int argc, char *argv[]) stdstring::testStdString(); stdvector::testStdVector(); stdptr::testStdPtr(); + lambda::testLambda(); qbytearray::testQByteArray(); qdatetime::testDateTime(); -- cgit v1.2.1 From ee8ddc356448ee1a6ed1147391de599779ef9411 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 27 Nov 2013 10:00:58 +0100 Subject: Debugger: Restrict std::unordered_map manual test to C++11 Change-Id: I13788acb6cfa9a659482d64bead10dd27e71fade Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 216 +++++++++++++++++++++++ 1 file changed, 216 insertions(+) (limited to 'tests') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 4cb223d0c7..f7ce97ed5f 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -176,6 +176,7 @@ void dummyStatement(...) {} #if USE_CXX11 #include +#include #endif #include #include @@ -2802,6 +2803,220 @@ namespace stdlist { } // namespace stdlist +namespace stdunorderedmap { + +#if USE_CXX11 + void testStdUnorderedMapStringFoo() + { + // This is not supposed to work with the compiled dumpers. + std::unordered_map map; + map["22.0"] = Foo(22); + map["33.0"] = Foo(33); + map["44.0"] = Foo(44); + BREAK_HERE; + // Expand map map.0 map.0.second map.2 map.2.second. + // Check map <3 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first "22.0" QString. + // CheckType map.0.second Foo. + // Check map.0.second.a 22 int. + // Check map.1 std::pair. + // Check map.2.first "44.0" QString. + // CheckType map.2.second Foo. + // Check map.2.second.a 44 int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapCharStarFoo() + { + std::unordered_map map; + map["22.0"] = Foo(22); + map["33.0"] = Foo(33); + BREAK_HERE; + // Expand map map.0 map.0.first map.0.second map.1 map.1.second. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // CheckType map.0.first char *. + // Check map.0.first.*first 50 '2' char. + // CheckType map.0.second Foo. + // Check map.0.second.a 22 int. + // Check map.1 std::pair. + // CheckType map.1.first char *. + // Check map.1.first.*first 51 '3' char. + // CheckType map.1.second Foo. + // Check map.1.second.a 33 int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntUInt() + { + std::unordered_map map; + map[11] = 1; + map[22] = 2; + BREAK_HERE; + // Expand map. + // Check map <2 items> std::unordered_map. + // Check map.11 1 unsigned int. + // Check map.22 2 unsigned int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntStringList() + { +#if 0 + std::unordered_map map; + map[11] = QStringList() << "11"; + map[22] = QStringList() << "22"; + BREAK_HERE; + // Expand map map.0 map.0.first map.0.second map.1 map.1.second. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first 11 unsigned int. + // Check map.0.second <1 items> QStringList. + // Check map.0.second.0 "11" QString. + // Check map.1 std::pair. + // Check map.1.first 22 unsigned int. + // Check map.1.second <1 items> QStringList. + // Check map.1.second.0 "22" QString. + // Continue. + dummyStatement(&map); +#endif + } + + void testStdUnorderedMapUIntStringListTypedef() + { +#if 0 + typedef std::unordered_map T; + T map; + map[11] = QStringList() << "11"; + map[22] = QStringList() << "22"; + BREAK_HERE; + // Check map <2 items> stdmap::T. + // Continue. + dummyStatement(&map); +#endif + } + + void testStdUnorderedMapUIntFloat() + { + std::unordered_map map; + map[11] = 11.0; + map[22] = 22.0; + BREAK_HERE; + // Expand map. + // Check map <2 items> std::unordered_map. + // Check map.11 11 float. + // Check map.22 22 float. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntFloatIterator() + { + typedef std::unordered_map Map; + Map map; + map[11] = 11.0; + map[22] = 22.0; + map[33] = 33.0; + map[44] = 44.0; + map[55] = 55.0; + map[66] = 66.0; + + Map::iterator it1 = map.begin(); + Map::iterator it2 = it1; ++it2; + Map::iterator it3 = it2; ++it3; + Map::iterator it4 = it3; ++it4; + Map::iterator it5 = it4; ++it5; + Map::iterator it6 = it5; ++it6; + + BREAK_HERE; + // Expand map. + // Check map <6 items> stdmap::Map. + // Check map.11 11 float. + // Check it1.first 11 int. + // Check it1.second 11 float. + // Check it6.first 66 int. + // Check it6.second 66 float. + // Continue. + dummyStatement(&map, &it1, &it2, &it3, &it4, &it5, &it6); + } + + void testStdUnorderedMapStringFloat() + { + std::unordered_map map; + map["11.0"] = 11.0; + map["22.0"] = 22.0; + BREAK_HERE; + // Expand map map.0 map.1. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first "11.0" QString. + // Check map.0.second 11 float. + // Check map.1 std::pair. + // Check map.1.first "22.0" QString. + // Check map.1.second 22 float. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapIntString() + { + std::unordered_map map; + map[11] = "11.0"; + map[22] = "22.0"; + BREAK_HERE; + // Expand map map.0 map.1. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first 11 int. + // Check map.0.second "11.0" QString. + // Check map.1 std::pair. + // Check map.1.first 22 int. + // Check map.1.second "22.0" QString. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapStringPointer() + { + QObject ob; + std::unordered_map > map; + map["Hallo"] = QPointer(&ob); + map["Welt"] = QPointer(&ob); + map["."] = QPointer(&ob); + BREAK_HERE; + // Expand map map.0 map.2. + // Check map <3 items> std::unordered_map>. + // Check map.0 std::pair>. + // Check map.0.first "." QString. + // CheckType map.0.second QPointer. + // Check map.2 std::pair>. + // Check map.2.first "Welt" QString. + // Continue. + dummyStatement(&map); + } +#endif + + void testStdUnorderedMap() + { +#if USE_CXX11 + testStdUnorderedMapStringFoo(); + testStdUnorderedMapCharStarFoo(); + testStdUnorderedMapUIntUInt(); + testStdUnorderedMapUIntStringList(); + testStdUnorderedMapUIntStringListTypedef(); + testStdUnorderedMapUIntFloat(); + testStdUnorderedMapUIntFloatIterator(); + testStdUnorderedMapStringFloat(); + testStdUnorderedMapIntString(); + testStdUnorderedMapStringPointer(); +#endif + } + +} // namespace stdunorderedmap namespace stdmap { @@ -6871,6 +7086,7 @@ int main(int argc, char *argv[]) stdlist::testStdList(); stdhashset::testStdHashSet(); stdmap::testStdMap(); + stdunorderedmap::testStdUnorderedMap(); stdset::testStdSet(); stdstack::testStdStack(); stdstream::testStdStream(); -- cgit v1.2.1 From d39ac6bf3c274e8c71a6e53c14168e0f432fc838 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 27 Nov 2013 14:17:11 +0100 Subject: Squish: Use keyboard interaction instead of textCursor manipulation Change-Id: I40f27c7b542f512de78ea2e7fa6e777b652edc4a Reviewed-by: Christian Stenger --- tests/system/suite_editors/tst_basic_cpp_support/test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') 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 91e6618243..106c45c5b6 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -92,9 +92,10 @@ def main(): if not waitFor("'dummy.cpp ' in str(mainWin.windowTitle) 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 - cursor = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget").textCursor() - cursor.movePosition(QTextCursor.Start) - cppwindow.setTextCursor(cursor) + if platform.system() == 'Darwin': + type(cppwindow, "") + else: + type(cppwindow, "") type(cppwindow, "") clickButton(waitForObject(":*Qt Creator_Utils::IconButton")) -- cgit v1.2.1 From 5c5240815a9577fdb2e5b5ed90fa64f9b57fee44 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 26 Nov 2013 15:23:28 +0100 Subject: CPlusPlus: Fix parsing of ??< ??> ??( ??) trigraphs Almost most useful feature ever. Task-number: QTCREATORBUG-2474 Change-Id: If1ad661fab58ffb4a0b9ddb8ba771f2fde3b54ec Reviewed-by: Nikolai Kosjar --- tests/auto/cplusplus/lexer/tst_lexer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/auto/cplusplus/lexer/tst_lexer.cpp b/tests/auto/cplusplus/lexer/tst_lexer.cpp index 1dc7383d72..3319e06c36 100644 --- a/tests/auto/cplusplus/lexer/tst_lexer.cpp +++ b/tests/auto/cplusplus/lexer/tst_lexer.cpp @@ -165,6 +165,13 @@ void tst_SimpleLexer::doxygen_comments_data() << T_INT << T_IDENTIFIER << T_SEMICOLON << T_CPP_DOXY_COMMENT << T_INT << T_IDENTIFIER << T_SEMICOLON << T_CPP_DOXY_COMMENT << T_CPP_DOXY_COMMENT; QTest::newRow(source) << source << expectedTokenKindList; + + source = "?""?(?""?)?""?a?b:c"; + expectedTokenKindList = QList() + << T_LBRACKET << T_RBRACKET << T_LBRACE << T_RBRACE + << T_IDENTIFIER << T_QUESTION << T_IDENTIFIER << T_COLON << T_IDENTIFIER; + QTest::newRow(source) << source << expectedTokenKindList; + } QTEST_APPLESS_MAIN(tst_SimpleLexer) -- cgit v1.2.1 From 75c0b5bfe240ae4a0f3014ee388d5cb9676c1f84 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 25 Nov 2013 15:17:10 +0100 Subject: Squish: Fix now named wizard buttons in objects.map Change-Id: I871a5079dcef6712c3d7ddb21dbfab4c6f7c8f88 Reviewed-by: Robert Loehning --- tests/system/objects.map | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index 5eff1a358e..e874f01591 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -34,8 +34,8 @@ :Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'} :Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'} :Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'} -:CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} -:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} +:CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} +:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Generator:_QLabel {text='Generator:' type='QLabel' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} @@ -82,8 +82,8 @@ :FormEditorStack_qdesigner_internal::FormWindow {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::FormWindow' unnamed='1' visible='1'} :FormEditorStack_qdesigner_internal::PropertyLineEdit {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::PropertyLineEdit' unnamed='1' visible='1'} :Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'} -:Git Repository Clone.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} -:Git Repository Clone.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} +:Git Repository Clone.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} +:Git Repository Clone.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Repository_QGroupBox {name='repositoryGroupBox' title='Repository' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Result._QLabel {name='statusLabel' type='QLabel' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Working Copy_QGroupBox {name='localGroupBox' title='Working Copy' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} -- cgit v1.2.1 From 1d834c1126dde58dd71e595b3f5e135cc0ca4dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Tue, 26 Nov 2013 21:56:30 +0100 Subject: Preprocessor Enginge: fix bug in pp-engine.cpp Preprocessor variables __LINE__,__FILE__,__TIME__,__DATE__ where destroying the following systems when affected variables were standing within the same line with those variables: * highlighting * refactoring * local renaming Task-number: QTCREATORBUG-8036 Change-Id: I1a4b919d15812872ca5a8e63b1031ec1ab144c22 Reviewed-by: Nikolai Kosjar --- tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'tests') diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 2594bc692f..7d3f44c06b 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -334,7 +334,6 @@ private slots: void unfinished_function_like_macro_call(); void nasty_macro_expansion(); void glib_attribute(); - void builtin__FILE__(); void blockSkipping(); void includes_1(); void dont_eagerly_expand(); @@ -784,23 +783,6 @@ void tst_Preprocessor::glib_attribute() QCOMPARE(preprocessed, result____); } -void tst_Preprocessor::builtin__FILE__() -{ - Client *client = 0; // no client. - Environment env; - - Preprocessor preprocess(client, &env); - QByteArray preprocessed = preprocess.run( - QLatin1String("some-file.c"), - QByteArray("const char *f = __FILE__\n" - )); - const QByteArray result____ = - "# 1 \"some-file.c\"\n" - "const char *f = \"some-file.c\"\n"; - - QCOMPARE(preprocessed, result____); -} - void tst_Preprocessor::comparisons_data() { QTest::addColumn("infile"); -- cgit v1.2.1 From 8a0cfc34d444f67e08db38afe15c7698ca6c3d4d Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 28 Nov 2013 12:01:34 +0100 Subject: Debugger: Don't check for unused value in QXmlAttributes dumper Change-Id: I53531d315ca0e6e6ff500db6b6b1ef278fbeff4b Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 90dbab7af1..d0849b3030 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2564,8 +2564,7 @@ void tst_Dumpers::dumper_data() % Check("atts.attList.2.localname", "\"localPart3\"", "@QString") % Check("atts.attList.2.qname", "\"name3\"", "@QString") % Check("atts.attList.2.uri", "\"uri3\"", "@QString") - % Check("atts.attList.2.value", "\"value3\"", "@QString") - % Check("atts.d", "", "@QXmlAttributesPrivate"); + % Check("atts.attList.2.value", "\"value3\"", "@QString"); QTest::newRow("StdArray") << Data("#include \n" -- cgit v1.2.1 From 1287fcaa76563e733d504556e313840f67ae1c32 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 28 Nov 2013 16:42:22 +0100 Subject: Debugger: Allow type patterns in auto tests This makes it easier to brush over harmless platform output differences like the '4u' vs '4ul' in the std::array test Change-Id: Id16e06afdb19dfc905658c34d5c2af401fd6a725 Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d0849b3030..da28a198a9 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -302,9 +302,9 @@ struct UnsubstitutedValue : Value struct Type { - Type() : qtVersion(0) {} - Type(const char *str) : type(str), qtVersion(0) {} - Type(const QByteArray &ba) : type(ba), qtVersion(0) {} + Type() : qtVersion(0), isPattern(false) {} + Type(const char *str) : type(str), qtVersion(0), isPattern(false) {} + Type(const QByteArray &ba) : type(ba), qtVersion(0), isPattern(false) {} bool matches(const QByteArray &actualType0, const Context &context) const { @@ -329,10 +329,16 @@ struct Type expectedType.replace(' ', ""); expectedType.replace("const", ""); expectedType.replace('@', context.nameSpace); + if (isPattern) { + QString actual = QString::fromLatin1(actualType); + QString expected = QString::fromLatin1(expectedType); + return QRegExp(expected).exactMatch(actual); + } return actualType == expectedType; } QByteArray type; int qtVersion; + bool isPattern; }; struct Type4 : Type @@ -345,6 +351,11 @@ struct Type5 : Type Type5(const QByteArray &ba) : Type(ba) { qtVersion = 5; } }; +struct Pattern : Type +{ + Pattern(const QByteArray &ba) : Type(ba) { isPattern = true; } +}; + enum DebuggerEngine { DumpTestGdbEngine = 0x01, @@ -2575,8 +2586,8 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Cxx11Profile() % MacLibCppProfile() - % Check("a", "<4 items>", "std::array") - % Check("b", "<4 items>", "std::array<@QString, 4u>"); + % Check("a", "<4 items>", Pattern("std::array")) + % Check("b", "<4 items>", Pattern("std::array<@QString, 4u.*>")); QTest::newRow("StdComplex") << Data("#include \n", -- cgit v1.2.1 From b2ff8d87957d269d24251fe9602c6e3549a1325f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 21 Nov 2013 14:23:33 +0100 Subject: Squish: Fix tst_create_proj_wizard Replace waiting for signal textChanged() and handle new Qt Quick wizards. Change-Id: Id452703fe21b3162800671db59f722821e7dd3fa Reviewed-by: Robert Loehning --- tests/system/shared/project.py | 32 ++++++- .../suite_general/tst_create_proj_wizard/test.py | 103 +++++++++++---------- 2 files changed, 85 insertions(+), 50 deletions(-) (limited to 'tests') diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 3646ea647d..add51cdff4 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -154,7 +154,12 @@ def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls): selectFromCombo(comboBox, "Qt Quick 2.0") else: test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion)) + label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }") + requires = re.match(".*Requires Qt (\d\.\d).*", str(label.text)) + if requires: + requires = requires.group(1) clickButton(waitForObject(":Next_QPushButton")) + return requires # Selects the Qt versions for a project # param checks turns tests in the function on if set to True @@ -187,6 +192,30 @@ def __verifyFileCreation__(path, expectedFiles): filename = os.path.join(path, filename) test.verify(os.path.exists(filename), "Checking if '" + filename + "' was created") +def __modifyAvailableTargets__(available, requiredQt, asStrings=False): + threeDigits = re.compile("\d{3}") + requiredQtVersion = requiredQt.replace(".", "") + "0" + tmp = list(available) # we need a deep copy + for currentItem in tmp: + if asStrings: + item = currentItem + else: + item = Targets.getStringForTarget(currentItem) + found = threeDigits.search(item) + if found: + if found.group(0) < requiredQtVersion: + # Quick 1.1 supports 4.7.4 only for running, debugging is unsupported + # so the least required version is 4.8, but 4.7.4 will be still listed + if not (requiredQtVersion == "480" and found.group(0) == "474"): + available.remove(currentItem) + if requiredQtVersion > "480": + toBeRemoved = [Targets.EMBEDDED_LINUX, Targets.SIMULATOR] + if asStrings: + toBeRemoved = Targets.getTargetsAsStrings(toBeRemoved) + for t in toBeRemoved: + if t in available: + available.remove(t) + # Creates a Qt GUI project # param path specifies where to create the project # param projectName is the name for the new project @@ -256,7 +285,8 @@ def createNewQtQuickApplication(workingDir, projectName = None, fromWelcome=False, withControls=False): available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome) projectName = __createProjectSetNameAndPath__(workingDir, projectName) - __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls) + requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls) + __modifyAvailableTargets__(available, requiredQt) checkedTargets = __chooseTargets__(targets, available) snooze(1) clickButton(waitForObject(":Next_QPushButton")) diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index 77fee043a2..deab7eb5be 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -33,7 +33,7 @@ import re def main(): global tmpSettingsDir - global textChanged + quickCombinations = [[1,False], [2,False], [2,True]] sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection") qmlFile = os.path.join("qml", "textselection.qml") if not neededFilePresent(os.path.join(sourceExample, qmlFile)): @@ -42,9 +42,6 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - overrideInstallLazySignalHandler() - installLazySignalHandler(":frame.templateDescription_QTextBrowser", - "textChanged()","__handleTextChanged__") kits = getConfiguredKits() test.log("Collecting potential project types...") availableProjectTypes = [] @@ -71,59 +68,67 @@ def main(): for template in dumpItems(templatesView.model(), templatesView.rootIndex()): template = template.replace(".", "\\.") # skip non-configurable - if not (template in ("Qt Quick 1 UI", "Qt Quick 2 UI", "Qt Quick 2 UI with Controls") - or "(CMake Build)" in template or "(Qbs Build)" in template): + if (template != "Qt Quick UI" and "(CMake Build)" not in template + and "(Qbs Build)" not in template): availableProjectTypes.append({category:template}) clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}")) for current in availableProjectTypes: category = current.keys()[0] template = current.values()[0] - invokeMenuItem("File", "New File or Project...") - selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates") - categoriesView = waitForObject(":New.templateCategoryView_QTreeView") - clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton) - templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}") - test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", "."))) - textChanged = False - clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton) - waitFor("textChanged", 2000) - text = waitForObject(":frame.templateDescription_QTextBrowser").plainText - displayedPlatforms = __getSupportedPlatforms__(str(text), template, True)[0] - clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) - # don't check because project could exist - __createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False) + displayedPlatforms = __createProject__(category, template) + if template == "Qt Quick Application": + for counter, qComb in enumerate(quickCombinations): + requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb[0], qComb[1]) + __modifyAvailableTargets__(displayedPlatforms, requiredQtVersion, True) + verifyKitCheckboxes(kits, displayedPlatforms) + # FIXME: if QTBUG-35203 is fixed replace by triggering the shortcut for Back + clickButton(waitForObject("{type='QPushButton' text='Cancel'}")) + # are there more Quick combinations - then recreate this project + if counter < len(quickCombinations) - 1: + displayedPlatforms = __createProject__(category, template) + continue try: waitForObject("{name='mainQmlFileGroupBox' title='Main HTML File' type='QGroupBox' visible='1'}", 1000) clickButton(waitForObject(":Next_QPushButton")) except LookupError: - try: - waitForObject("{text='Select Existing QML file' type='QLabel' visible='1'}", 1000) - baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}") - type(baseLineEd, os.path.join(templateDir, qmlFile)) - clickButton(waitForObject(":Next_QPushButton")) - except LookupError: - pass - waitForObject("{type='QLabel' unnamed='1' visible='1' text='Kit Selection'}") - availableCheckboxes = filter(visibleCheckBoxExists, kits.keys()) - # verification whether expected, found and configured match - for t in kits: - if t in displayedPlatforms: - if t in availableCheckboxes: - test.passes("Found expected kit '%s' on 'Kit Selection' page." % t) - availableCheckboxes.remove(t) - else: - test.fail("Expected kit '%s' missing on 'Kit Selection' page." % t) - else: - if t in availableCheckboxes: - test.fail("Kit '%s' found on 'Kit Selection' page - but was not expected!" % t) - else: - test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page." % t) - if len(availableCheckboxes) != 0: - test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page." - % str(availableCheckboxes)) - clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}")) + pass + verifyKitCheckboxes(kits, displayedPlatforms) + clickButton(waitForObject("{type='QPushButton' text='Cancel'}")) invokeMenuItem("File", "Exit") -def __handleTextChanged__(*args): - global textChanged - textChanged = True +def verifyKitCheckboxes(kits, displayedPlatforms): + waitForObject("{type='QLabel' unnamed='1' visible='1' text='Kit Selection'}") + availableCheckboxes = filter(visibleCheckBoxExists, kits.keys()) + # verification whether expected, found and configured match + for t in kits: + if t in displayedPlatforms: + if t in availableCheckboxes: + test.passes("Found expected kit '%s' on 'Kit Selection' page." % t) + availableCheckboxes.remove(t) + else: + test.fail("Expected kit '%s' missing on 'Kit Selection' page." % t) + else: + if t in availableCheckboxes: + test.fail("Kit '%s' found on 'Kit Selection' page - but was not expected!" % t) + else: + test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page." % t) + if len(availableCheckboxes) != 0: + test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page." + % str(availableCheckboxes)) + +def __createProject__(category, template): + invokeMenuItem("File", "New File or Project...") + selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates") + categoriesView = waitForObject(":New.templateCategoryView_QTreeView") + clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton) + templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}") + test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", "."))) + textBrowser = findObject(":frame.templateDescription_QTextBrowser") + origTxt = str(textBrowser.plainText) + clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton) + waitFor("origTxt != str(textBrowser.plainText)", 2000) + displayedPlatforms = __getSupportedPlatforms__(str(textBrowser.plainText), template, True)[0] + clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) + # don't check because project could exist + __createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False) + return displayedPlatforms -- cgit v1.2.1 From 4edfe87b58ca8e5f92b6a10dcf98e3d240f38245 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 29 Nov 2013 10:53:45 +0100 Subject: Revert "Preprocessor Enginge: fix bug in pp-engine.cpp" Breaks highlighting for macros using the predefined macros. This reverts commit 1d834c1126dde58dd71e595b3f5e135cc0ca4dbd. Change-Id: Ic13c407e293a806a63ff30153864530df6a32e47 Reviewed-by: hjk Reviewed-by: Erik Verbruggen --- tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 7d3f44c06b..2594bc692f 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -334,6 +334,7 @@ private slots: void unfinished_function_like_macro_call(); void nasty_macro_expansion(); void glib_attribute(); + void builtin__FILE__(); void blockSkipping(); void includes_1(); void dont_eagerly_expand(); @@ -783,6 +784,23 @@ void tst_Preprocessor::glib_attribute() QCOMPARE(preprocessed, result____); } +void tst_Preprocessor::builtin__FILE__() +{ + Client *client = 0; // no client. + Environment env; + + Preprocessor preprocess(client, &env); + QByteArray preprocessed = preprocess.run( + QLatin1String("some-file.c"), + QByteArray("const char *f = __FILE__\n" + )); + const QByteArray result____ = + "# 1 \"some-file.c\"\n" + "const char *f = \"some-file.c\"\n"; + + QCOMPARE(preprocessed, result____); +} + void tst_Preprocessor::comparisons_data() { QTest::addColumn("infile"); -- cgit v1.2.1 From 4c2daa90ce558c3b4287edc97127471486a411d9 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 29 Nov 2013 11:25:47 +0100 Subject: C++: Fix highlighting for lines with predefined macros This adds definitions for the macros __FILE__, __LINE__, __DATE__ and __TIME__ on demand. As a side effect, this also introduces highlighting for the uses of these macros. Task-number: QTCREATORBUG-8036 Change-Id: Ib7546c7d45d2eecbc50c7883fc684e3497154405 Reviewed-by: Erik Verbruggen Reviewed-by: Eike Ziller Reviewed-by: hjk --- .../cplusplus/checksymbols/tst_checksymbols.cpp | 51 ++++++++++++++++++++++ .../cplusplus/preprocessor/tst_preprocessor.cpp | 6 ++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp index 26ece497a0..9afbd31573 100644 --- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp +++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp @@ -175,6 +175,8 @@ private slots: void test_checksymbols_VirtualMethodUse(); void test_checksymbols_LabelUse(); void test_checksymbols_MacroUse(); + void test_checksymbols_Macros__FILE__LINE__DATE__TIME__1(); + void test_checksymbols_Macros__FILE__LINE__DATE__TIME__2(); void test_checksymbols_FunctionUse(); void test_checksymbols_PseudoKeywordUse(); void test_checksymbols_StaticUse(); @@ -326,6 +328,55 @@ void tst_CheckSymbols::test_checksymbols_MacroUse() TestData::check(source, expectedUses, macroUses); } +void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__1() +{ + const QByteArray source = + "#define FILE_DATE_TIME __FILE__ \" / \" __DATE__ \" / \" __TIME__\n" + "#define LINE_NUMBER 0 + __LINE__\n" + "\n" + "void f()\n" + "{\n" + " class Printer;\n" + " Printer::printText(FILE_DATE_TIME); Printer::printInteger(LINE_NUMBER); Printer::nl();\n" + " return;\n" + "}\n"; + const QList expectedUses = QList() + << Use(4, 6, 1, CppHighlightingSupport::FunctionUse) + << Use(6, 11, 7, CppHighlightingSupport::TypeUse) + << Use(6, 11, 7, CppHighlightingSupport::TypeUse) + << Use(7, 5, 7, CppHighlightingSupport::TypeUse) + << Use(7, 41, 7, CppHighlightingSupport::TypeUse) + << Use(7, 77, 7, CppHighlightingSupport::TypeUse) + ; + + TestData::check(source, expectedUses); +} + +void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__2() +{ + const QByteArray source = + "void f()\n" + "{\n" + " class Printer;\n" + " Printer::printInteger(__LINE__); Printer::printText(__FILE__); Printer::nl();\n" + " Printer::printText(__DATE__); Printer::printText(__TIME__); Printer::nl();\n" + " return;\n" + "}\n"; + const QList expectedUses = QList() + << Use(1, 6, 1, CppHighlightingSupport::FunctionUse) + << Use(3, 11, 7, CppHighlightingSupport::TypeUse) + << Use(3, 11, 7, CppHighlightingSupport::TypeUse) + << Use(4, 5, 7, CppHighlightingSupport::TypeUse) + << Use(4, 38, 7, CppHighlightingSupport::TypeUse) + << Use(4, 68, 7, CppHighlightingSupport::TypeUse) + << Use(5, 5, 7, CppHighlightingSupport::TypeUse) + << Use(5, 35, 7, CppHighlightingSupport::TypeUse) + << Use(5, 65, 7, CppHighlightingSupport::TypeUse) + ; + + TestData::check(source, expectedUses); +} + void tst_CheckSymbols::test_checksymbols_FunctionUse() { const QByteArray source = diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 2594bc692f..489722d675 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -796,7 +796,11 @@ void tst_Preprocessor::builtin__FILE__() )); const QByteArray result____ = "# 1 \"some-file.c\"\n" - "const char *f = \"some-file.c\"\n"; + "const char *f =\n" + "# expansion begin 16,8 ~1\n" + "\"some-file.c\"\n" + "# expansion end\n" + "# 2 \"some-file.c\"\n"; QCOMPARE(preprocessed, result____); } -- cgit v1.2.1 From ff57228df57fcca77120155d4ab95809cba7e6e6 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 29 Nov 2013 18:17:27 +0100 Subject: Debugger: Make QLocale and std::array dumper test pass with LLDB Change-Id: I016ebf62074dc77790716e60e88348a932cbe9f6 Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index da28a198a9..350619102e 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1880,8 +1880,14 @@ void tst_Dumpers::dumper_data() % CheckType("loc", "@QLocale") % CheckType("m", "@QLocale::MeasurementSystem") % Check("loc1", "\"en_US\"", "@QLocale") - % Check("m1", Value5("@QLocale::ImperialUSSystem (1)"), "@QLocale::MeasurementSystem") - % Check("m1", Value4("@QLocale::ImperialSystem (1)"), "@QLocale::MeasurementSystem"); + % Check("m1", Value5("@QLocale::ImperialUSSystem (1)"), + "@QLocale::MeasurementSystem").setForGdbOnly() + % Check("m1", Value4("@QLocale::ImperialSystem (1)"), + "@QLocale::MeasurementSystem").setForGdbOnly() + % Check("m1", Value5("ImperialUSSystem"), + "@QLocale::MeasurementSystem").setForLldbOnly() + % Check("m1", Value4("ImperialSystem"), + "@QLocale::MeasurementSystem").setForLldbOnly(); QTest::newRow("QMapUIntStringList") << Data("#include \n" @@ -2586,8 +2592,8 @@ void tst_Dumpers::dumper_data() % CoreProfile() % Cxx11Profile() % MacLibCppProfile() - % Check("a", "<4 items>", Pattern("std::array")) - % Check("b", "<4 items>", Pattern("std::array<@QString, 4u.*>")); + % Check("a", "<4 items>", Pattern("std::array")) + % Check("b", "<4 items>", Pattern("std::array<@QString, 4.*>")); QTest::newRow("StdComplex") << Data("#include \n", -- cgit v1.2.1 From f290fe12a9920f2e16da01ed7814199dbf2d37ff Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 29 Nov 2013 18:28:31 +0100 Subject: Debugger: Work around weird LLDB type reporting in auto test std::vector gets reported as std::vector> Change-Id: I226ebf62074dc77790716e60e88348a932cbe9f6 Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 350619102e..d1eb9653b5 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -3131,8 +3131,9 @@ void tst_Dumpers::dumper_data() "v.push_back(true);\n" "v.push_back(false);\n" "unused(&v);\n") - // Known issue: Clang produces "std::vector> - % Check("v", "<5 items>", "std::vector") + % Check("v", "<5 items>", "std::vector").setForGdbOnly() + // Known issue: Clang produces "std::vector> + % Check("v", "<5 items>", "std::vector>").setForLldbOnly() % Check("v.0", "[0]", "1", "bool") % Check("v.1", "[1]", "0", "bool") % Check("v.2", "[2]", "0", "bool") @@ -3144,10 +3145,12 @@ void tst_Dumpers::dumper_data() "std::vector v1(65, true);\n" "std::vector v2(65);\n" "unused(&v1, &v2);\n") - % Check("v1", "<65 items>", "std::vector") + % Check("v1", "<65 items>", "std::vector").setForGdbOnly() + % Check("v1", "<65 items>", "std::vector>").setForLldbOnly() % Check("v1.0", "[0]", "1", "bool") % Check("v1.64", "[64]", "1", "bool") - % Check("v2", "<65 items>", "std::vector") + % Check("v2", "<65 items>", "std::vector").setForGdbOnly() + % Check("v2", "<65 items>", "std::vector>").setForLldbOnly() % Check("v2.0", "[0]", "0", "bool") % Check("v2.64", "[64]", "0", "bool"); -- cgit v1.2.1 From 3fb10b3382bb24f3ff1d08e938346fa39de1a358 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 30 Nov 2013 00:24:19 +0100 Subject: Debugger: Disable __gnu_cxx dumper tests for LLDB Change-Id: I426ebf62074dc77790716e60e88348a932cbe9f6 Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d1eb9653b5..0ba131e46f 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2666,6 +2666,7 @@ void tst_Dumpers::dumper_data() "h.insert(194);\n" "h.insert(2);\n" "h.insert(3);\n") + % GdbOnly() % Profile("QMAKE_CXXFLAGS += -Wno-deprecated") % Check("h", "<4 items>", "__gnu__cxx::hash_set") % Check("h.0", "[0]", "194", "int") -- cgit v1.2.1 From 0a7eb4909094aa6e29152b28cd2ad6819ec9955e Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 28 Nov 2013 10:24:42 +0100 Subject: Debugger: Disable absolute dir path test for cdb. Change-Id: I0def80de2ab237e505237df9f8f44edf981e742f Reviewed-by: Christian Stenger --- tests/auto/debugger/tst_dumpers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 0ba131e46f..cc293fef9c 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1382,7 +1382,8 @@ void tst_Dumpers::dumper_data() "unused(&dir, &s, &fi);\n") % CoreProfile() % Check("dir", tempDir, "@QDir") - % Check("dir.absolutePath", tempDir, "@QString"); + % Check("dir.absolutePath", tempDir, "@QString").setEngines( + DumpTestGdbEngine | DumpTestLldbEngine); // % Check("dir.canonicalPath", tempDir, "@QString"); QTest::newRow("QFileInfo") -- cgit v1.2.1 From 21c4056ccd3f938c64d9df00ed0e71d6297e5607 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 28 Nov 2013 10:20:37 +0100 Subject: Debugger: Fix dumper test with unprintable characters for cdb. Change-Id: Ic0a5a701af77ede88dc61fee549de3b3cdd8d2ad Reviewed-by: Christian Stenger --- tests/auto/debugger/tst_dumpers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index cc293fef9c..5fa7e46003 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1243,7 +1243,9 @@ void tst_Dumpers::dumper_data() "ba += 2;\n") % CoreProfile() % Check("ba", QByteArray("\"Hello\"World") - + char(0) + char(1) + char(2) + '"', "@QByteArray") + + char(0) + char(1) + char(2) + '"', "@QByteArray").setEngines( + DumpTestGdbEngine | DumpTestLldbEngine) + % Check("ba", QByteArray("\"Hello\"World...\""), "@QByteArray").setForCdbOnly() % Check("ba.0", "[0]", "72", "char") % Check("ba.11", "[11]", "0", "char") % Check("ba.12", "[12]", "1", "char") -- cgit v1.2.1 From 242cb179191c2fa5c88561b4d28b693868fbd4b8 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 30 Nov 2013 23:46:25 +0100 Subject: Debugger: Adjust QDateTime dumper for Qt 5.2 Change-Id: I53a5701c9d1791e2705eafb258ff440f97e53b87 Reviewed-by: John Layt Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index f7ce97ed5f..ddadcea05c 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -5475,8 +5475,11 @@ namespace basic { void testLongEvaluation1() { + QTimeZone tz("UTC+05:00"); QDateTime time = QDateTime::currentDateTime(); const int N = 10000; + QDateTime x = time; + x.setTimeZone(tz); QDateTime bigv[N]; for (int i = 0; i < 10000; ++i) { bigv[i] = time; -- cgit v1.2.1 From cfe84eaae2a41efd3758174a3d4da2d4a4f2826a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 2 Dec 2013 08:54:56 +0100 Subject: Debugger: Remove gcc version output when using the cdb in the dumper test. Change-Id: I5560c8a5bc3eaefb8c40256dff4082b9b380e1f3 Reviewed-by: hjk Reviewed-by: Christian Stenger --- tests/auto/debugger/tst_dumpers.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 5fa7e46003..0f41ec7261 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1146,10 +1146,9 @@ void tst_Dumpers::dumper() m_keepTemp = false; } else { qDebug() << "CONTENTS : " << contents; - qDebug() << "Qt VERSION : " - << qPrintable(QString::number(context.qtVersion, 16)); - qDebug() << "GCC VERSION : " - << qPrintable(QString::number(context.gccVersion, 16)); + qDebug() << "Qt VERSION : " << qPrintable(QString::number(context.qtVersion, 16)); + if (m_debuggerEngine != DumpTestCdbEngine) + qDebug() << "GCC VERSION : " << qPrintable(QString::number(context.gccVersion, 16)); qDebug() << "BUILD DIR : " << qPrintable(t->buildPath); } QVERIFY(ok); -- cgit v1.2.1 From 796fcaf1d288267e93baba3d01927957c684758f Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 2 Dec 2013 15:47:36 +0100 Subject: Revert "C++: Fix highlighting for lines with predefined macros" This takes too much memory. For qtcreator.pro the numbers are as follows: Patch applied: ~ 1600MB (RES) Patch reverted: ~ 510MB (RES) This reverts commit 4c2daa90ce558c3b4287edc97127471486a411d9. Task-number: QTCREATORBUG-10973 Change-Id: I843bd7c1ea4a26a1ec55ddc14c2a34a98d040922 Reviewed-by: hjk Reviewed-by: Robert Loehning Reviewed-by: Eike Ziller Reviewed-by: Orgad Shaneh Reviewed-by: Erik Verbruggen --- .../cplusplus/checksymbols/tst_checksymbols.cpp | 51 ---------------------- .../cplusplus/preprocessor/tst_preprocessor.cpp | 6 +-- 2 files changed, 1 insertion(+), 56 deletions(-) (limited to 'tests') diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp index 9afbd31573..26ece497a0 100644 --- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp +++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp @@ -175,8 +175,6 @@ private slots: void test_checksymbols_VirtualMethodUse(); void test_checksymbols_LabelUse(); void test_checksymbols_MacroUse(); - void test_checksymbols_Macros__FILE__LINE__DATE__TIME__1(); - void test_checksymbols_Macros__FILE__LINE__DATE__TIME__2(); void test_checksymbols_FunctionUse(); void test_checksymbols_PseudoKeywordUse(); void test_checksymbols_StaticUse(); @@ -328,55 +326,6 @@ void tst_CheckSymbols::test_checksymbols_MacroUse() TestData::check(source, expectedUses, macroUses); } -void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__1() -{ - const QByteArray source = - "#define FILE_DATE_TIME __FILE__ \" / \" __DATE__ \" / \" __TIME__\n" - "#define LINE_NUMBER 0 + __LINE__\n" - "\n" - "void f()\n" - "{\n" - " class Printer;\n" - " Printer::printText(FILE_DATE_TIME); Printer::printInteger(LINE_NUMBER); Printer::nl();\n" - " return;\n" - "}\n"; - const QList expectedUses = QList() - << Use(4, 6, 1, CppHighlightingSupport::FunctionUse) - << Use(6, 11, 7, CppHighlightingSupport::TypeUse) - << Use(6, 11, 7, CppHighlightingSupport::TypeUse) - << Use(7, 5, 7, CppHighlightingSupport::TypeUse) - << Use(7, 41, 7, CppHighlightingSupport::TypeUse) - << Use(7, 77, 7, CppHighlightingSupport::TypeUse) - ; - - TestData::check(source, expectedUses); -} - -void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__2() -{ - const QByteArray source = - "void f()\n" - "{\n" - " class Printer;\n" - " Printer::printInteger(__LINE__); Printer::printText(__FILE__); Printer::nl();\n" - " Printer::printText(__DATE__); Printer::printText(__TIME__); Printer::nl();\n" - " return;\n" - "}\n"; - const QList expectedUses = QList() - << Use(1, 6, 1, CppHighlightingSupport::FunctionUse) - << Use(3, 11, 7, CppHighlightingSupport::TypeUse) - << Use(3, 11, 7, CppHighlightingSupport::TypeUse) - << Use(4, 5, 7, CppHighlightingSupport::TypeUse) - << Use(4, 38, 7, CppHighlightingSupport::TypeUse) - << Use(4, 68, 7, CppHighlightingSupport::TypeUse) - << Use(5, 5, 7, CppHighlightingSupport::TypeUse) - << Use(5, 35, 7, CppHighlightingSupport::TypeUse) - << Use(5, 65, 7, CppHighlightingSupport::TypeUse) - ; - - TestData::check(source, expectedUses); -} - void tst_CheckSymbols::test_checksymbols_FunctionUse() { const QByteArray source = diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 489722d675..2594bc692f 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -796,11 +796,7 @@ void tst_Preprocessor::builtin__FILE__() )); const QByteArray result____ = "# 1 \"some-file.c\"\n" - "const char *f =\n" - "# expansion begin 16,8 ~1\n" - "\"some-file.c\"\n" - "# expansion end\n" - "# 2 \"some-file.c\"\n"; + "const char *f = \"some-file.c\"\n"; QCOMPARE(preprocessed, result____); } -- cgit v1.2.1 From 4d6cb992b12fdf9b2da7ebb1bd0f8b9ec7a59873 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 2 Dec 2013 18:57:23 +0100 Subject: Squish: Use generic function textUnderCursor(...) Change-Id: I7ea6e9af1435e716266f4dfd917fe9ac568a67a5 Reviewed-by: Christian Stenger --- tests/system/shared/utils.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 3279980aab..b46499d8b2 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -112,19 +112,16 @@ def selectFromLocator(filter, itemName = None): doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton) def wordUnderCursor(window): - cursor = window.textCursor() - oldposition = cursor.position() - cursor.movePosition(QTextCursor.StartOfWord) - cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor) - returnValue = cursor.selectedText() - cursor.setPosition(oldposition) - return returnValue + return textUnderCursor(window, QTextCursor.StartOfWord, QTextCursor.EndOfWord) def lineUnderCursor(window): + return textUnderCursor(window, QTextCursor.StartOfLine, QTextCursor.EndOfLine) + +def textUnderCursor(window, fromPos, toPos): cursor = window.textCursor() oldposition = cursor.position() - cursor.movePosition(QTextCursor.StartOfLine) - cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor) + cursor.movePosition(fromPos) + cursor.movePosition(toPos, QTextCursor.KeepAnchor) returnValue = cursor.selectedText() cursor.setPosition(oldposition) return returnValue -- cgit v1.2.1 From 7f492541b970f84359342d8380e114ffa62d3f5f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 2 Dec 2013 18:30:41 +0100 Subject: Squish: Remove unused objects Change-Id: I36d5174e26b853777792f69eac4df16efc52292b Reviewed-by: Christian Stenger --- tests/system/objects.map | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index e874f01591..85b9dbb58d 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -94,9 +94,6 @@ :Go to slot_QDialog {name='SelectSignalDialog' type='QDialog' visible='1' windowTitle='Go to slot'} :Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Installed Plugins.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'} -:Installed Plugins.categoryWidget_QTreeWidget {name='categoryWidget' type='QTreeWidget' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'} -:Installed Plugins_Core::Internal::PluginDialog {type='Core::Internal::PluginDialog' unnamed='1' visible='1' windowTitle='Installed Plugins'} :JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'} :Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} @@ -128,7 +125,6 @@ :Qt Creator.Help_Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} :Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Project.Menu.Project_QMenu {name='Project.Menu.Project' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -- cgit v1.2.1 From 4fd4f5d9fcc4b6ea8b1d554fe013a994ef46b3ce Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 2 Dec 2013 18:39:22 +0100 Subject: Squish: Remove unused function Change-Id: I2860d77dcb6a571e6af0e8aff86b997c12dafc90 Reviewed-by: Christian Stenger --- tests/system/shared/build_utils.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests') diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 6048482eaf..5a34aac4a3 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -65,10 +65,6 @@ def __addSignalHandlerDict__(lazySignalHandlerFunction): installedSignalHandlers.setdefault("%s____%s" % (name,signalSignature), handlers) return wrappedFunction -# returns the currently assigned handler functions for a given object and signal -def getInstalledSignalHandlers(name, signalSignature): - return installedSignalHandlers.get("%s____%s" % (name,signalSignature)) - # this method checks the last build (if there's one) and logs the number of errors, warnings and # lines within the Issues output # optional parameter can be used to tell this function if the build was expected to fail or not -- cgit v1.2.1 From 223ecc70a2015e47500254589d5ffd30051134d6 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 3 Dec 2013 10:30:05 +0100 Subject: C++: Compile fix for tst_lexer The trigraph sequence somehow confused qmake. The moc file was not generated. Change-Id: I4016947b5c8efa350d1813737651143d8687d299 Reviewed-by: hjk --- tests/auto/cplusplus/lexer/tst_lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/cplusplus/lexer/tst_lexer.cpp b/tests/auto/cplusplus/lexer/tst_lexer.cpp index 3319e06c36..5b49045488 100644 --- a/tests/auto/cplusplus/lexer/tst_lexer.cpp +++ b/tests/auto/cplusplus/lexer/tst_lexer.cpp @@ -166,7 +166,7 @@ void tst_SimpleLexer::doxygen_comments_data() << T_INT << T_IDENTIFIER << T_SEMICOLON << T_CPP_DOXY_COMMENT << T_CPP_DOXY_COMMENT; QTest::newRow(source) << source << expectedTokenKindList; - source = "?""?(?""?)?""?a?b:c"; + source = "?" "?(?" "?)?" "?a?b:c"; expectedTokenKindList = QList() << T_LBRACKET << T_RBRACKET << T_LBRACE << T_RBRACE << T_IDENTIFIER << T_QUESTION << T_IDENTIFIER << T_COLON << T_IDENTIFIER; -- cgit v1.2.1 From 5b6d31cd8f234d6cb15747cb352346e10496d367 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 3 Dec 2013 16:31:14 +0100 Subject: Tests: Enable externaltool auto tests Change-Id: I39e610fa911cbbec93c32403392a0c35e3dfdb42 Reviewed-by: Eike Ziller --- tests/auto/auto.pro | 1 + tests/auto/externaltool/externaltool.pro | 8 ++++---- tests/auto/externaltool/tst_externaltooltest.cpp | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index cd17e2ea4d..f3b94700ca 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -7,6 +7,7 @@ SUBDIRS += \ debugger \ diff \ extensionsystem \ + externaltool \ environment \ generichighlighter \ profilewriter \ diff --git a/tests/auto/externaltool/externaltool.pro b/tests/auto/externaltool/externaltool.pro index 5af23b7e4e..bc16a794f3 100644 --- a/tests/auto/externaltool/externaltool.pro +++ b/tests/auto/externaltool/externaltool.pro @@ -1,9 +1,9 @@ -IDE_BUILD_TREE = $$OUT_PWD/../../../ +QTC_PLUGIN_DEPENDS += coreplugin include(../qttest.pri) -include(../../../src/plugins/coreplugin/coreplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin_dependencies.pri) +include($$IDE_SOURCE_TREE/src/libs/utils/utils_dependencies.pri) + LIBS *= -L$$IDE_PLUGIN_PATH/QtProject -INCLUDEPATH *= $$IDE_SOURCE_TREE/src/plugins/coreplugin -INCLUDEPATH *= $$IDE_BUILD_TREE/src/plugins/coreplugin SOURCES += tst_externaltooltest.cpp \ $$IDE_SOURCE_TREE/src/plugins/coreplugin/externaltool.cpp diff --git a/tests/auto/externaltool/tst_externaltooltest.cpp b/tests/auto/externaltool/tst_externaltooltest.cpp index 3958a40f51..bfda597354 100644 --- a/tests/auto/externaltool/tst_externaltooltest.cpp +++ b/tests/auto/externaltool/tst_externaltooltest.cpp @@ -50,8 +50,7 @@ static const char TEST_XML1[] = " %{CurrentProjectFilePath}" " %{CurrentProjectPath}" " " -"" -; +""; static const char TEST_XML2[] = "" @@ -213,7 +212,8 @@ void ExternaltoolTest::testReadLocale() QCOMPARE(tool->description(), QString::fromLatin1("Grüezi")); QCOMPARE(tool->displayName(), QString::fromLatin1("Grüezi")); QCOMPARE(tool->displayCategory(), QString::fromLatin1("Grüezi")); - delete tool;} + delete tool; +} QTEST_APPLESS_MAIN(ExternaltoolTest); -- cgit v1.2.1 From 0c66e74cf0da54df83d5454a689f6e7b7fd75f89 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 5 Dec 2013 08:25:01 +0100 Subject: Debugger: Do not test the hash seed value in dumper test. On Windows the hash seed is initialized before the main is entered. Change-Id: If7d2fd6ac1d15e704a6fc984c2d3218a5facdd5c Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 0f41ec7261..cdf1dc90a0 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -857,7 +857,7 @@ void tst_Dumpers::dumper() "\n#endif" "\n" + (data.useQHash ? "\n#if QT_VERSION >= 0x050000" - "\nqt_qhash_seed.testAndSetRelaxed(-1, 0);" + "\nqt_qhash_seed.store(0);" "\n#endif\n" : "") + "\n unused(&argc, &argv, &qtversion, &gccversion);\n" "\n" + data.code + -- cgit v1.2.1