summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-02-27 15:17:30 +0100
committerEike Ziller <eike.ziller@qt.io>2017-02-27 15:17:37 +0100
commit1704c484a83e845fc44ffe82d1af0bcdca028964 (patch)
tree82c1335b0ff852d2c6a237a52a73ff599f528a44 /tests
parent0995cf22ab422467fe68ad53f617471731a3629c (diff)
parent126a031ee2eae741095657f01c3ce3ac0129fecf (diff)
downloadqt-creator-1704c484a83e845fc44ffe82d1af0bcdca028964.tar.gz
Merge remote-tracking branch 'origin/4.2'
Change-Id: I9006dd493707ae626ae3502541599c8789e1aab0
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cplusplus/lookup/tst_lookup.cpp46
-rw-r--r--tests/auto/debugger/debugger.pro17
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp4
-rw-r--r--tests/system/shared/editor_utils.py3
-rw-r--r--tests/system/suite_general/tst_session_handling/test.py1
5 files changed, 60 insertions, 11 deletions
diff --git a/tests/auto/cplusplus/lookup/tst_lookup.cpp b/tests/auto/cplusplus/lookup/tst_lookup.cpp
index eaa015a425..98af0cbc15 100644
--- a/tests/auto/cplusplus/lookup/tst_lookup.cpp
+++ b/tests/auto/cplusplus/lookup/tst_lookup.cpp
@@ -32,6 +32,7 @@
#include <cplusplus/Literals.h>
#include <cplusplus/LookupContext.h>
#include <cplusplus/Name.h>
+#include <cplusplus/NamePrettyPrinter.h>
#include <cplusplus/Overview.h>
#include <cplusplus/ResolveExpression.h>
#include <cplusplus/Symbols.h>
@@ -99,6 +100,9 @@ private slots:
void templates_3();
void templates_4();
void templates_5();
+
+ void minimalname_data();
+ void minimalname();
};
void tst_Lookup::base_class_defined_1()
@@ -631,5 +635,47 @@ void tst_Lookup::templates_5()
QVERIFY(doc->diagnosticMessages().isEmpty());
}
+void tst_Lookup::minimalname_data()
+{
+ QTest::addColumn<QByteArray>("source");
+ QTest::addColumn<int>("index");
+
+ QTest::newRow("inlineNamespace1")
+ << QByteArray("namespace std { inline namespace __cxx11 { class string{}; } }\n")
+ << 0;
+
+ // This case is extracted from libstdc++ 5.4.0.
+ // The inline namespace is re-opened as non-inline, which is not standard
+ // compliant. However, gcc does this and clang only issues a warning.
+ QTest::newRow("inlineNamespace2")
+ << QByteArray("namespace std { inline namespace __cxx11 {} }\n"
+ "namespace std { namespace __cxx11 { class string{}; } }\n")
+ << 1;
+}
+
+void tst_Lookup::minimalname()
+{
+ QFETCH(QByteArray, source);
+ QFETCH(int, index);
+
+ Document::Ptr doc = Document::create("minimalname");
+ doc->setUtf8Source(source);
+ doc->parse();
+ doc->check();
+
+ Snapshot snapshot;
+ snapshot.insert(doc);
+ LookupContext ctx(doc, snapshot);
+ Control control;
+ Symbol *symbol = doc->globalSymbolAt(unsigned(index))
+ ->asNamespace()->memberAt(0)->asNamespace()->memberAt(0);
+
+ const Name *minimalName = LookupContext::minimalName(symbol, ctx.globalNamespace(), &control);
+
+ Overview oo;
+ const QString minimalNameAsString = NamePrettyPrinter(&oo)(minimalName);
+ QCOMPARE(minimalNameAsString, QString::fromUtf8("std::string"));
+}
+
QTEST_APPLESS_MAIN(tst_Lookup)
#include "tst_lookup.moc"
diff --git a/tests/auto/debugger/debugger.pro b/tests/auto/debugger/debugger.pro
index 3535e9c53a..12a115c919 100644
--- a/tests/auto/debugger/debugger.pro
+++ b/tests/auto/debugger/debugger.pro
@@ -1,16 +1,15 @@
TEMPLATE = subdirs
-gdb.file = gdb.pro
-simplifytypes.file = simplifytypes.pro
+# Avoid race condition when compiling with multiple jobs or moc_predefs.h might get used and
+# overridden at the same time as the sub projects are using the same build directory.
+# Correct would be to completely rearrange these sub projects into sub directories, using the
+# quick fix instead.
+CONFIG += ordered
-# avoid race condition when compiling with multiple jobs
-dumpers.depends = gdb simplifytypes
-dumpers.file = dumpers.pro
-
-SUBDIRS += gdb
-SUBDIRS += simplifytypes
-SUBDIRS += dumpers
+SUBDIRS += gdb.pro
+SUBDIRS += simplifytypes.pro
+SUBDIRS += dumpers.pro
SUBDIRS += namedemangler.pro
SUBDIRS += disassembler.pro
SUBDIRS += offsets.pro
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 80bfc538d0..a1c7e2ee8b 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -1933,8 +1933,8 @@ void tst_Dumpers::dumper_data()
+ CheckType("t1.(SystemLocale)", "@QString") % Optional()
+ Check("dt0", "(invalid)", "@QDateTime")
- //+ Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime")
- //+ Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime")
+ + Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime")
+ + Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime")
+ Check("dt1.(ISO)",
"\"1980-01-01T13:15:32Z\"", "@QString") % Optional()
+ CheckType("dt1.(Locale)", "@QString") % Optional()
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index e3afb02afc..3c5be28974 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -386,8 +386,11 @@ def openDocument(treeElement):
expected = str(item.text).split("/")[-1]
if waitFor("expected in str(mainWindow.windowTitle)", 5000):
return True
+ test.log("Expected file (%s) was not being opened in openDocument()" % expected)
return False
except:
+ t,v = sys.exc_info()[:2]
+ test.log("An exception occurred in openDocument(): %s(%s)" % (str(t), str(v)))
return False
def earlyExit(details="No additional information"):
diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py
index 4662edfb4e..aac2a42521 100644
--- a/tests/system/suite_general/tst_session_handling/test.py
+++ b/tests/system/suite_general/tst_session_handling/test.py
@@ -129,6 +129,7 @@ def checkWelcomePage(sessionName, isCurrent=False):
def checkNavigator(expectedRows, message):
navigatorModel = waitForObject(":Qt Creator_Utils::NavigationTreeView").model()
+ waitFor("expectedRows == len(__iterateChildren__(navigatorModel, QModelIndex()))", 1000)
test.compare(expectedRows, len(__iterateChildren__(navigatorModel, QModelIndex())), message)
def checkOpenDocuments(expectedRows, message):