summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-31 01:00:13 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-31 01:00:13 +0200
commitffb2c2ac6c3ba40acbe13a39899a72049585b427 (patch)
treedbee14e6d1641e02ea1fd5fc67ce001ab12776ef /tests/auto
parent6d0044f1dcffebc29dccd9d37d90f8abdb941a88 (diff)
parentdbdd5f0ffbce52c8b789ed09f1aa3f1da6c02e23 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp8
-rw-r--r--tests/auto/tools/qmakelib/parsertest.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp31
3 files changed, 21 insertions, 20 deletions
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index abb7a1a964..aeedf4ae32 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -2375,11 +2375,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("include(): fail")
<< "include(include/nope.pri): OK = 1"
<< "OK = UNDEF"
-#ifdef Q_OS_WIN
- << "Cannot read " + m_indir + "/include/nope.pri: The system cannot find the file specified."
-#else
<< "Cannot read " + m_indir + "/include/nope.pri: No such file or directory"
-#endif
<< true;
QTest::newRow("include(): silent fail")
@@ -2873,12 +2869,12 @@ void tst_qmakelib::proEval()
globals.environment = m_env;
globals.setProperties(m_prop);
globals.setDirectories(m_indir, m_outdir);
- ProFile *outPro = parser.parsedProBlock(QStringRef(&out), "out", 1, QMakeParser::FullGrammar);
+ ProFile *outPro = parser.parsedProBlock(QStringRef(&out), 0, "out", 1, QMakeParser::FullGrammar);
if (!outPro->isOk()) {
qWarning("Expected output is malformed");
verified = false;
}
- ProFile *pro = parser.parsedProBlock(QStringRef(&in), infile, 1, QMakeParser::FullGrammar);
+ ProFile *pro = parser.parsedProBlock(QStringRef(&in), 0, infile, 1, QMakeParser::FullGrammar);
QMakeEvaluator visitor(&globals, &parser, &vfs, &handler);
visitor.setOutputDir(m_outdir);
#ifdef Q_OS_WIN
diff --git a/tests/auto/tools/qmakelib/parsertest.cpp b/tests/auto/tools/qmakelib/parsertest.cpp
index 70f1be5fc3..f736bf38bf 100644
--- a/tests/auto/tools/qmakelib/parsertest.cpp
+++ b/tests/auto/tools/qmakelib/parsertest.cpp
@@ -2031,7 +2031,7 @@ void tst_qmakelib::proParser()
handler.setExpectedMessages(msgs.split('\n', QString::SkipEmptyParts));
QMakeVfs vfs;
QMakeParser parser(0, &vfs, &handler);
- ProFile *pro = parser.parsedProBlock(QStringRef(&in), "in", 1, QMakeParser::FullGrammar);
+ ProFile *pro = parser.parsedProBlock(QStringRef(&in), 0, "in", 1, QMakeParser::FullGrammar);
if (handler.printedMessages()) {
qWarning("Got unexpected message(s)");
verified = false;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 8287b9ebdd..4cd2fef2dc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -281,7 +281,7 @@ void tst_QGraphicsProxyWidget::initTestCase()
// This will be called after every test function.
void tst_QGraphicsProxyWidget::cleanup()
{
- QVERIFY(QApplication::topLevelWidgets().isEmpty());
+ QTRY_VERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QGraphicsProxyWidget::qgraphicsproxywidget_data()
@@ -2575,6 +2575,22 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
}
#endif
+static bool findViewAndTipLabel(const QWidget *view)
+{
+ bool foundView = false;
+ bool foundTipLabel = false;
+ const QWidgetList &topLevels = QApplication::topLevelWidgets();
+ for (const QWidget *widget : topLevels) {
+ if (widget == view)
+ foundView = true;
+ if (widget->inherits("QTipLabel"))
+ foundTipLabel = true;
+ if (foundView && foundTipLabel)
+ return true;
+ }
+ return false;
+}
+
void tst_QGraphicsProxyWidget::tooltip_basic()
{
QString toolTip = "Qt rocks!";
@@ -2627,18 +2643,7 @@ void tst_QGraphicsProxyWidget::tooltip_basic()
QHelpEvent helpEvent(QEvent::ToolTip, view.mapFromScene(proxy->boundingRect().center()),
view.viewport()->mapToGlobal(view.mapFromScene(proxy->boundingRect().center())));
QApplication::sendEvent(view.viewport(), &helpEvent);
- QTest::qWait(350);
-
- bool foundView = false;
- bool foundTipLabel = false;
- foreach (QWidget *widget, QApplication::topLevelWidgets()) {
- if (widget == &view)
- foundView = true;
- if (widget->inherits("QTipLabel"))
- foundTipLabel = true;
- }
- QVERIFY(foundView);
- QVERIFY(foundTipLabel);
+ QTRY_VERIFY(findViewAndTipLabel(&view));
}
}