From 76fbe75abee7d77911467d56630176f777e8ed78 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 7 Jan 2020 09:13:21 +0100 Subject: Remove empty block at beginning of imported markdown An empty QTextDocument already contains a block; so when the formatting is fully determined, if the document is still empty, then instead of inserting a new block, we can set formatting on the cursor, which affects the pre-existing block, before inserting text. This avoids leaving a blank line (the default block) above the inserted content. Fixes: QTBUG-81060 Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d Reviewed-by: Shawn Rutledge --- .../tst_qtextmarkdownimporter.cpp | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp b/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp index 2f0b877799..39a1370f6f 100644 --- a/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp +++ b/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp @@ -55,12 +55,13 @@ private slots: void thematicBreaks(); void lists_data(); void lists(); + void avoidBlankLineAtBeginning_data(); + void avoidBlankLineAtBeginning(); }; void tst_QTextMarkdownImporter::headingBulletsContinuations() { const QStringList expectedBlocks = QStringList() << - "" << // we could do without this blank line before the heading, but currently it happens "heading" << "bullet 1 continuation line 1, indented via tab" << "bullet 2 continuation line 2, indented via 4 spaces" << @@ -222,5 +223,38 @@ void tst_QTextMarkdownImporter::lists() QCOMPARE(doc.toMarkdown(), rewrite); } +void tst_QTextMarkdownImporter::avoidBlankLineAtBeginning_data() +{ + QTest::addColumn("input"); + QTest::addColumn("expectedNumberOfParagraphs"); + + QTest::newRow("Text block") << QString("Markdown text") << 1; + QTest::newRow("Headline") << QString("Markdown text\n============") << 1; + QTest::newRow("Code block") << QString(" Markdown text") << 2; + QTest::newRow("Unordered list") << QString("* Markdown text") << 1; + QTest::newRow("Ordered list") << QString("1. Markdown text") << 1; + QTest::newRow("Blockquote") << QString("> Markdown text") << 1; +} + +void tst_QTextMarkdownImporter::avoidBlankLineAtBeginning() // QTBUG-81060 +{ + QFETCH(QString, input); + QFETCH(int, expectedNumberOfParagraphs); + + QTextDocument doc; + QTextMarkdownImporter(QTextMarkdownImporter::DialectGitHub).import(&doc, input); + QTextFrame::iterator iterator = doc.rootFrame()->begin(); + int i = 0; + while (!iterator.atEnd()) { + QTextBlock block = iterator.currentBlock(); + // Make sure there is no empty paragraph at the beginning of the document + if (i == 0) + QVERIFY(!block.text().isEmpty()); + ++iterator; + ++i; + } + QCOMPARE(i, expectedNumberOfParagraphs); +} + QTEST_MAIN(tst_QTextMarkdownImporter) #include "tst_qtextmarkdownimporter.moc" -- cgit v1.2.3 From eb2a7738a431a7510cdcc69250a4713c1d3cd490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 16:47:15 +0100 Subject: Skip instead of fail tests when test server is not available We were being inconsistent in how we handled this, some tests skipping while others using QVERIFY. It makes more sense to skip the tests, since the problem is a missing pre-condition of the test, not the test itself being bad or exposing real failures in the implementation. Change-Id: I20eacfe12dbce0b0d926e48cbe2d2772819fa4a5 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/qftp/tst_qftp.cpp | 3 +- .../tst_qhttpnetworkconnection.cpp | 3 +- tests/auto/network/access/spdy/tst_spdy.cpp | 3 +- tests/auto/network/network.pro | 1 + tests/auto/network/selftest/selftest.pro | 6 +++ .../auto/network/selftest/tst_networkselftest.cpp | 55 ++++++++++++++++++++++ .../tst_platformsocketengine.cpp | 3 +- .../qhttpsocketengine/tst_qhttpsocketengine.cpp | 3 +- .../tst_qsocks5socketengine.cpp | 3 +- .../network/socket/qtcpsocket/tst_qtcpsocket.cpp | 3 +- .../auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 3 +- .../tst_qsslsocket_onDemandCertificates_member.cpp | 3 +- .../tst_qsslsocket_onDemandCertificates_static.cpp | 3 +- .../access/qnetworkreply/tst_qnetworkreply.cpp | 3 +- .../network/socket/qtcpserver/tst_qtcpserver.cpp | 3 +- .../network/ssl/qsslsocket/tst_qsslsocket.cpp | 3 +- .../network_stresstest/tst_network_stresstest.cpp | 3 +- tests/manual/qnetworkreply/main.cpp | 3 +- 18 files changed, 92 insertions(+), 15 deletions(-) create mode 100644 tests/auto/network/selftest/selftest.pro create mode 100644 tests/auto/network/selftest/tst_networkselftest.cpp (limited to 'tests') diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index 2068738a67..60acb70af4 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -215,7 +215,8 @@ void tst_QFtp::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif #ifndef QT_NO_BEARERMANAGEMENT QNetworkConfigurationManager manager; diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 0a9320118d..57fa5a613c 100644 --- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -105,7 +105,8 @@ void tst_QHttpNetworkConnection::initTestCase() #if defined(QT_TEST_SERVER) QVERIFY(QtNetworkSettings::verifyConnection(httpServerName(), 80)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif } diff --git a/tests/auto/network/access/spdy/tst_spdy.cpp b/tests/auto/network/access/spdy/tst_spdy.cpp index f4a5976558..5701f4911c 100644 --- a/tests/auto/network/access/spdy/tst_spdy.cpp +++ b/tests/auto/network/access/spdy/tst_spdy.cpp @@ -100,7 +100,8 @@ tst_Spdy::~tst_Spdy() void tst_Spdy::initTestCase() { QVERIFY(!m_rfc3252FilePath.isEmpty()); - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_Spdy::settingsAndNegotiation_data() diff --git a/tests/auto/network/network.pro b/tests/auto/network/network.pro index 64262a8632..9a3ababe61 100644 --- a/tests/auto/network/network.pro +++ b/tests/auto/network/network.pro @@ -1,5 +1,6 @@ TEMPLATE=subdirs SUBDIRS=\ + selftest \ access \ bearer \ kernel \ diff --git a/tests/auto/network/selftest/selftest.pro b/tests/auto/network/selftest/selftest.pro new file mode 100644 index 0000000000..e8312032c3 --- /dev/null +++ b/tests/auto/network/selftest/selftest.pro @@ -0,0 +1,6 @@ +CONFIG += testcase +TARGET = tst_networkselftest +SOURCES += tst_networkselftest.cpp + +requires(qtConfig(private_tests)) +QT = core network network-private testlib diff --git a/tests/auto/network/selftest/tst_networkselftest.cpp b/tests/auto/network/selftest/tst_networkselftest.cpp new file mode 100644 index 0000000000..a540e18f48 --- /dev/null +++ b/tests/auto/network/selftest/tst_networkselftest.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +#include "../../network-settings.h" + +class tst_NetworkSelftest : public QObject +{ + Q_OBJECT + +private slots: + void testServerIsAvailableInCI(); +}; + +void tst_NetworkSelftest::testServerIsAvailableInCI() +{ + if (!qEnvironmentVariable("QTEST_ENVIRONMENT").split(' ').contains("ci")) + QSKIP("Not running in the CI"); + +#if !defined(QT_TEST_SERVER) + QVERIFY2(QtNetworkSettings::verifyTestNetworkSettings(), + "Test server must be available when running in the CI"); +#endif +} + +QTEST_MAIN(tst_NetworkSelftest) + +#include "tst_networkselftest.moc" diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp index ffc63ee46a..5be00630ca 100644 --- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp +++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp @@ -87,7 +87,8 @@ private slots: void tst_PlatformSocketEngine::initTestCase() { - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } //--------------------------------------------------------------------------- diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp index 64241014d7..7644a06380 100644 --- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -129,7 +129,8 @@ void tst_QHttpSocketEngine::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif } diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 464054f8a6..44b5a02af4 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -142,7 +142,8 @@ void tst_QSocks5SocketEngine::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif } diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index 75b9b23259..0546c6ba7d 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -358,7 +358,8 @@ void tst_QTcpSocket::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpServerName(), 21)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpProxyServerName(), 2121)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif } diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index e599ebf199..8e2dc13cfc 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -391,7 +391,8 @@ void tst_QSslSocket::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 993)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::echoServerName(), 13)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif // QT_TEST_SERVER #endif // QT_NO_SSL } diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp index 3b28e7a803..ad9554c7a5 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp @@ -109,7 +109,8 @@ void tst_QSslSocket_onDemandCertificates_member::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif // QT_TEST_SERVER } diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp index a441d13619..b4a41b57e6 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp @@ -105,7 +105,8 @@ void tst_QSslSocket_onDemandCertificates_static::initTestCase() QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129)); QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130)); #else - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); #endif // QT_TEST_SERVER } diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index c182ef7ebf..bcd354ebee 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -479,7 +479,8 @@ private: void tst_qnetworkreply::initTestCase() { - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_qnetworkreply::httpLatency() diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index 109126790b..a9f8634129 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -81,7 +81,8 @@ void tst_QTcpServer::initTestCase_data() void tst_QTcpServer::initTestCase() { - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_QTcpServer::init() diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp index c01c673604..afd0c720a2 100644 --- a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -63,7 +63,8 @@ tst_QSslSocket::~tst_QSslSocket() void tst_QSslSocket::initTestCase() { - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_QSslSocket::init() diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp index 03df1633d5..5f2fd2b24e 100644 --- a/tests/manual/network_stresstest/tst_network_stresstest.cpp +++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp @@ -123,7 +123,8 @@ void tst_NetworkStressTest::initTestCase_data() void tst_NetworkStressTest::initTestCase() { - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_NetworkStressTest::init() diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index afac7a7095..762bfe7b83 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -108,7 +108,8 @@ protected: void tst_qnetworkreply::initTestCase() { qRegisterMetaType(); // for QSignalSpy - QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); + if (!QtNetworkSettings::verifyTestNetworkSettings()) + QSKIP("No network test server available"); } void tst_qnetworkreply::limiting_data() -- cgit v1.2.3 From b7a56ea3ee69241ff5d71a845f4e48dcb93e8073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 16:23:28 +0100 Subject: Skip tst_QMenu::pushButtonPopulateOnAboutToShow on macOS The combobox popup can overlap a little with the button, and that's the expected behavior. Change-Id: I245bfce85cb5ee661ceb51dbe0d844492878a2bc Reviewed-by: Simon Hausmann --- tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index 9c40c0bd57..727d1c2a16 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -1066,6 +1066,10 @@ static inline QByteArray msgGeometryIntersects(const QRect &r1, const QRect &r2) void tst_QMenu::pushButtonPopulateOnAboutToShow() { +#ifdef Q_OS_MACOS + QSKIP("Popup menus may partially overlap the button on macOS, and that's okey"); +#endif + QPushButton b("Test PushButton"); b.setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); -- cgit v1.2.3 From 3be91a89afda540f1df6a7e8e3dadcb47615a0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 18:39:23 +0100 Subject: Blacklist tst_QStyleSheetStyle::widgetStylePropagation on macOS It's not clear why this is failing, but we need to blacklist it so that we can move over to testing macOS 10.14 and 10.15 in the CI. Task-number: QTBUG-75786 Change-Id: I208d5af92406c5da8d0210e0188568466b78b2a9 Reviewed-by: Simon Hausmann --- tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST index 6b2e4f3fb2..616cd650b3 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST +++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST @@ -1,2 +1,4 @@ [task232085_spinBoxLineEditBg] osx +[widgetStylePropagation] +macos # QTBUG-75786 -- cgit v1.2.3 From e1dbb737012e3e7aa818b45bf2804b866f4b7d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 18:35:08 +0100 Subject: Blacklist tst_QTableView::mouseWheel on macOS There's a timing issue that affects the position of the vertical scrollbar when scrolling by pixels. Change-Id: I29d73574785be539a5870b498a902b1aba887e9c Reviewed-by: Simon Hausmann --- tests/auto/widgets/itemviews/qtableview/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST index 9648cef3de..ff870915be 100644 --- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST +++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST @@ -1,3 +1,5 @@ [moveCursorBiggerJump] osx +[mouseWheel:scroll down per pixel] +macos -- cgit v1.2.3 From 6ae9cc7cb99f156de296f66a2b85c5be7674b916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 18:33:07 +0100 Subject: Blacklist tests on macOS that rely on moving the cursor Task-number: QTBUG-76312 Change-Id: Ibb29231141017ed608beaa12255cdd083317433c Reviewed-by: Simon Hausmann --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 4 ++++ tests/auto/widgets/widgets/qmenu/BLACKLIST | 2 ++ 2 files changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 26f9ce1b85..38e04043bd 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -49,3 +49,7 @@ ubuntu # QTBUG-75270 winrt +[syntheticEnterLeave] +macos # Can't move cursor (QTBUG-76312) +[taskQTBUG_4055_sendSyntheticEnterLeave] +macos # Can't move cursor (QTBUG-76312) diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index ad6d2f340c..ba9c184a67 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -11,3 +11,5 @@ osx-10.13 osx-10.14 [activeSubMenuPosition] winrt +[submenuTearOffDontClose] +macos # Can't move cursor (QTBUG-76312) -- cgit v1.2.3 From 0617afb2d3808c0dc6a4edeb6c580ff9ce3df7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 18:31:07 +0100 Subject: Extend blacklisting of tst_QWidget::showMinimizedKeepsFocus to all macOS versions For some reason the firstChild gets the focus when clearing the focus. This seems to be timing dependent, as removing the 30ms qWait 'fixes' the issue. So does a processEvent call before minimzing. Both of these require further investigation. Change-Id: I62833a5541712f97dc24bc63384fa4c051096537 Reviewed-by: Simon Hausmann --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 38e04043bd..e1038572a7 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -34,8 +34,7 @@ osx [render_systemClip] osx [showMinimizedKeepsFocus] -osx-10.12 ci -osx-10.13 ci +macos [maskedUpdate] opensuse opensuse-leap -- cgit v1.2.3 From d8897e0b08974a687b7ba9099732afe94400fef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 18:27:50 +0100 Subject: Clarify blacklisting of tst_QWidget::childEvents on macOS The test expects a very explicit list of events during show, but on macOS we also get an InputMethodQuery event as a result of the window becoming active. The test needs to be written significantly to support these kind of platform differences. Change-Id: I395c1e9e4e9baf7d9f88f0d067586fc15afb9a16 Reviewed-by: Simon Hausmann --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index e1038572a7..be19d8fd0b 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -22,7 +22,7 @@ opensuse-leap # QTBUG-68175 opensuse-42.3 [childEvents] -osx ci +macos [renderInvisible] osx-10.12 osx-10.11 -- cgit v1.2.3 From 3f6275960c4da87a18f3740bc3fef68dcf8a65d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Wed, 18 Dec 2019 17:56:23 +0100 Subject: uic: add customwidget imports support for python Fixes: QTBUG-81073 Change-Id: I29659481b14927ffcb8f2cb1829b577a67e4b937 Reviewed-by: Friedemann Kleint --- tests/auto/tools/uic/baseline/config.ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/tools/uic/baseline/config.ui.py b/tests/auto/tools/uic/baseline/config.ui.py index f7e1ffc773..8be5eae39f 100644 --- a/tests/auto/tools/uic/baseline/config.ui.py +++ b/tests/auto/tools/uic/baseline/config.ui.py @@ -43,7 +43,7 @@ from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QFont, QRadialGradient) from PySide2.QtWidgets import * -import GammaView +from gammaview import GammaView class Ui_Config(object): -- cgit v1.2.3 From e0be3ab28ed5ce028555ed7ef2f25d2964dc81a5 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 9 Jan 2020 11:40:50 +0100 Subject: Combine negativeYear() and printNegativeYear() They overlapped and the latter had duplicated code, so make them into a single data-driven test. At the same time, replace the '-' at the start of the expected string with QLocale::negativeSign(), since the test fails otherwise when LC_NUMERIC=nb_NO on Linux (Debian/testing). Change-Id: I051c75abff16b2e6f8278fcb152b6bde14c71f9a Reviewed-by: Thiago Macieira --- tests/auto/corelib/time/qdate/tst_qdate.cpp | 39 +++++++++++++---------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/time/qdate/tst_qdate.cpp b/tests/auto/corelib/time/qdate/tst_qdate.cpp index dd2cb3eea8..567209dcf6 100644 --- a/tests/auto/corelib/time/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/time/qdate/tst_qdate.cpp @@ -88,7 +88,7 @@ private slots: void toStringDateFormat(); void isLeapYear(); void yearsZeroToNinetyNine(); - void negativeYear() const; + void printNegativeYear_data() const; void printNegativeYear() const; void roundtripGermanLocale() const; #if QT_CONFIG(textdate) && QT_DEPRECATED_SINCE(5, 10) @@ -1458,33 +1458,28 @@ void tst_QDate::yearsZeroToNinetyNine() } } - -void tst_QDate::negativeYear() const +void tst_QDate::printNegativeYear_data() const { - QDate y(-20, 3, 4); - QVERIFY(y.isValid()); - QCOMPARE(y.year(), -20); + QTest::addColumn("year"); + QTest::addColumn("expect"); + QTest::newRow("millennium") << -1000 << QStringLiteral("-1000"); + QTest::newRow("century") << -500 << QStringLiteral("-0500"); + QTest::newRow("decade") << -20 << QStringLiteral("-0020"); + QTest::newRow("year") << -7 << QStringLiteral("-0007"); } void tst_QDate::printNegativeYear() const { - { - QDate date(-500, 3, 4); - QVERIFY(date.isValid()); - QCOMPARE(date.toString(QLatin1String("yyyy")), QString::fromLatin1("-0500")); - } - - { - QDate date(-10, 3, 4); - QVERIFY(date.isValid()); - QCOMPARE(date.toString(QLatin1String("yyyy")), QString::fromLatin1("-0010")); - } + QFETCH(int, year); + QFETCH(QString, expect); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + expect.replace(QLatin1Char('-'), QLocale().negativeSign()); +#endif - { - QDate date(-2, 3, 4); - QVERIFY(date.isValid()); - QCOMPARE(date.toString(QLatin1String("yyyy")), QString::fromLatin1("-0002")); - } + QDate date(year, 3, 4); + QVERIFY(date.isValid()); + QCOMPARE(date.year(), year); + QCOMPARE(date.toString(QLatin1String("yyyy")), expect); } void tst_QDate::roundtripGermanLocale() const -- cgit v1.2.3 From 21a14767b30f6f8d27b06e609ec8eaa5ddffb324 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 14 Jan 2020 13:56:54 +0100 Subject: uic/Python: Fix missing QCursor import Fixes: PYSIDE-1182 Change-Id: I1ccc524a152ea75508166f3d2c0c60f8d829cd8f Reviewed-by: Cristian Maureira-Fredes --- tests/auto/tools/uic/baseline/config.ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/tools/uic/baseline/config.ui.py b/tests/auto/tools/uic/baseline/config.ui.py index 8be5eae39f..5fd558bb01 100644 --- a/tests/auto/tools/uic/baseline/config.ui.py +++ b/tests/auto/tools/uic/baseline/config.ui.py @@ -38,7 +38,7 @@ from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint, QRect, QSize, QUrl, Qt) -from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QFont, +from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap, QRadialGradient) from PySide2.QtWidgets import * -- cgit v1.2.3