From 0e039c17ccb97071fd4210ac958a5e9b999c44f9 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 24 Apr 2019 11:29:18 +0200 Subject: Use resource path for test data on Android and iOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/mkspecs/features/testcase.prf already generates a .qrc file containing the files in TESTDATA, so instead of trying to copy QML files to the device, we can just use the existing resources. This fixes the following failure, which affects all tests using util.pri: I/QTestLib( 7143): FAIL! : tst_qquickapplication::initTestCase() 'QDir::setCurrent(m_directory)' returned FALSE. (Could not chdir to :/) Change-Id: Iddfd227c402dbe80aeaa9742a52690d3d8049e46 Reviewed-by: Andy Shaw Reviewed-by: Tor Arne Vestbø Reviewed-by: Simon Hausmann --- tests/auto/shared/util.cpp | 7 +++++-- tests/auto/shared/util.pri | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/shared/util.cpp b/tests/auto/shared/util.cpp index 189398f0c2..96876428f6 100644 --- a/tests/auto/shared/util.cpp +++ b/tests/auto/shared/util.cpp @@ -40,7 +40,9 @@ QQmlDataTest::QQmlDataTest() : m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0)), #endif - m_dataDirectoryUrl(QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/'))) + m_dataDirectoryUrl(m_dataDirectory.startsWith(QLatin1Char(':')) + ? QUrl(QLatin1String("qrc") + m_dataDirectory) + : QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/'))) { m_instance = this; } @@ -54,7 +56,8 @@ void QQmlDataTest::initTestCase() { QVERIFY2(!m_dataDirectory.isEmpty(), "'data' directory not found"); m_directory = QFileInfo(m_dataDirectory).absolutePath(); - QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory)); + if (m_dataDirectoryUrl.scheme() != QLatin1String("qrc")) + QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory)); } QString QQmlDataTest::testFile(const QString &fileName) const diff --git a/tests/auto/shared/util.pri b/tests/auto/shared/util.pri index a05af4773d..b54897ac2c 100644 --- a/tests/auto/shared/util.pri +++ b/tests/auto/shared/util.pri @@ -3,4 +3,8 @@ INCLUDEPATH += $$PWD HEADERS += $$PWD/util.h SOURCES += $$PWD/util.cpp -DEFINES += QT_QMLTEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\" +android|ios { + DEFINES += QT_QMLTEST_DATADIR=\\\":/data\\\" +} else { + DEFINES += QT_QMLTEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\" +} -- cgit v1.2.3 From 67729c5de3bf33e57bd95b92252f0569faa37012 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 15 Apr 2019 11:26:38 +0200 Subject: Blacklist tst_qquickwidget::tabKey() on opensuse Task-number: QTBUG-75171 Change-Id: I68ef40cd9fe47d26cd4c83064367c2a3272efe0f Reviewed-by: Mitch Curtis --- tests/auto/quickwidgets/qquickwidget/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/auto/quickwidgets/qquickwidget/BLACKLIST (limited to 'tests') diff --git a/tests/auto/quickwidgets/qquickwidget/BLACKLIST b/tests/auto/quickwidgets/qquickwidget/BLACKLIST new file mode 100644 index 0000000000..18ea65bb72 --- /dev/null +++ b/tests/auto/quickwidgets/qquickwidget/BLACKLIST @@ -0,0 +1,3 @@ +[tabKey] +opensuse-42.3 +opensuse-leap -- cgit v1.2.3 From d8662301188229721b12526a18db7ceb496f1ef1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 26 Apr 2019 09:37:56 +0200 Subject: Blacklist tst_qquickwindow::openglContextCreatedSignal on opensuse Task-number: QTBUG-75454 Change-Id: I46453da06553de7be721b921b085a015741ada5f Reviewed-by: Mitch Curtis --- tests/auto/quick/qquickwindow/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickwindow/BLACKLIST b/tests/auto/quick/qquickwindow/BLACKLIST index bb9f403188..1282a9d5ec 100644 --- a/tests/auto/quick/qquickwindow/BLACKLIST +++ b/tests/auto/quick/qquickwindow/BLACKLIST @@ -1,3 +1,6 @@ +[openglContextCreatedSignal] +opensuse-42.3 +opensuse-leap # QTBUG-62177 [attachedProperty] osx -- cgit v1.2.3 From dbbbbe569da0aa3900a17ca22bd2be2708fb76f7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 25 Apr 2019 15:21:19 +0200 Subject: Allow creation of variants from non-singleton QQmlTypeWrappers I don't see any reason why this should be prohibited. Change-Id: I4a54c55eff4b9151691d0587627efad4a06485f1 Fixes: QTBUG-74815 Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmllanguage/data/typeWrapperToVariant.qml | 15 +++++++++++++++ tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/auto/qml/qqmllanguage/data/typeWrapperToVariant.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmllanguage/data/typeWrapperToVariant.qml b/tests/auto/qml/qqmllanguage/data/typeWrapperToVariant.qml new file mode 100644 index 0000000000..8a1535ff50 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/typeWrapperToVariant.qml @@ -0,0 +1,15 @@ +import QtQml 2.0 + +QtObject { + id: root + + property QtObject target: QtObject { + Component.onCompleted: { + root.connections.target = root.target.Component + } + } + + property Connections connections: Connections { + ignoreUnknownSignals: true + } +} diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 85dddbcb54..87468c329c 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -301,6 +301,8 @@ private slots: void polymorphicFunctionLookup(); void anchorsToParentInPropertyChanges(); + void typeWrapperToVariant(); + private: QQmlEngine engine; QStringList defaultImportPathList; @@ -5085,6 +5087,19 @@ void tst_qqmllanguage::anchorsToParentInPropertyChanges() QTRY_COMPARE(o->property("edgeWidth").toInt(), 200); } +void tst_qqmllanguage::typeWrapperToVariant() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("typeWrapperToVariant.qml")); + VERIFY_ERRORS(0); + QScopedPointer o(component.create()); + QVERIFY(!o.isNull()); + QObject *connections = qvariant_cast(o->property("connections")); + QVERIFY(connections); + QObject *target = qvariant_cast(connections->property("target")); + QVERIFY(target); +} + QTEST_MAIN(tst_qqmllanguage) #include "tst_qqmllanguage.moc" -- cgit v1.2.3