aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/applicationwindow/tst_applicationwindow.cpp6
-rw-r--r--tests/auto/pressandhold/data/dependencies.qml4
-rw-r--r--tests/auto/sanity/data/dependencies.qml4
-rw-r--r--tests/auto/sanity/tst_sanity.cpp18
-rw-r--r--tests/auto/snippets/data/dependencies.qml6
-rw-r--r--tests/auto/styles/data/dependencies.qml7
-rw-r--r--tests/benchmarks/creationtime/data/dependencies.qml7
-rw-r--r--tests/benchmarks/creationtime/tst_creationtime.cpp16
-rw-r--r--tests/benchmarks/objectcount/data/dependencies.qml7
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp18
-rw-r--r--tests/manual/gifs/eventcapturer.cpp2
-rw-r--r--tests/manual/gifs/eventcapturer.h2
-rw-r--r--tests/manual/gifs/gifrecorder.cpp4
-rw-r--r--tests/manual/viewinqwidget/main.cpp2
14 files changed, 75 insertions, 28 deletions
diff --git a/tests/auto/applicationwindow/tst_applicationwindow.cpp b/tests/auto/applicationwindow/tst_applicationwindow.cpp
index d2937a6d..f78d1f66 100644
--- a/tests/auto/applicationwindow/tst_applicationwindow.cpp
+++ b/tests/auto/applicationwindow/tst_applicationwindow.cpp
@@ -420,7 +420,7 @@ void tst_applicationwindow::attachedProperties()
QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
QCOMPARE(childItem->property("attached_overlay").value<QQuickItem *>(), childAppWindow->overlay());
- childControl->setParentItem(Q_NULLPTR);
+ childControl->setParentItem(nullptr);
QVERIFY(!childControl->window());
QVERIFY(!childControl->property("attached_window").value<QQuickApplicationWindow *>());
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
@@ -429,7 +429,7 @@ void tst_applicationwindow::attachedProperties()
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_overlay").value<QQuickItem *>());
- childItem->setParentItem(Q_NULLPTR);
+ childItem->setParentItem(nullptr);
QVERIFY(!childItem->window());
QVERIFY(!childItem->property("attached_window").value<QQuickApplicationWindow *>());
QVERIFY(!childItem->property("attached_contentItem").value<QQuickItem *>());
@@ -507,7 +507,7 @@ public:
{ QGuiApplicationPrivate::platform_theme = this; }
~TestTheme() { QGuiApplicationPrivate::platform_theme = theme(); }
- const QFont *font(Font type = SystemFont) const Q_DECL_OVERRIDE
+ const QFont *font(Font type = SystemFont) const override
{
Q_UNUSED(type);
return &m_font;
diff --git a/tests/auto/pressandhold/data/dependencies.qml b/tests/auto/pressandhold/data/dependencies.qml
new file mode 100644
index 00000000..13690bbc
--- /dev/null
+++ b/tests/auto/pressandhold/data/dependencies.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+
+Control { }
diff --git a/tests/auto/sanity/data/dependencies.qml b/tests/auto/sanity/data/dependencies.qml
new file mode 100644
index 00000000..13690bbc
--- /dev/null
+++ b/tests/auto/sanity/data/dependencies.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+
+Control { }
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp
index bc114d62..7f438721 100644
--- a/tests/auto/sanity/tst_sanity.cpp
+++ b/tests/auto/sanity/tst_sanity.cpp
@@ -267,14 +267,18 @@ static void addTestRows(QQmlEngine *engine, const QString &targetPath, const QSt
// the engine's import path. This way we can use QQmlComponent to load each QML file
// for benchmarking.
- QFileInfoList entries = QDir(QQC2_IMPORT_PATH + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
+ QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
foreach (const QFileInfo &entry, entries) {
QString name = entry.baseName();
if (!skiplist.contains(name)) {
foreach (const QString &importPath, engine->importPathList()) {
- QString filePath = QDir(importPath + "/Qt/labs/" + targetPath).absoluteFilePath(entry.fileName());
+ QString name = entry.dir().dirName() + "/" + entry.fileName();
+ QString filePath = importPath + "/Qt/labs/" + targetPath + "/" + entry.fileName();
if (QFile::exists(filePath)) {
- QTest::newRow(qPrintable(entry.dir().dirName() + "/" + entry.fileName())) << QUrl::fromLocalFile(filePath);
+ QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath);
+ break;
+ } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) {
+ QTest::newRow(qPrintable(name)) << QUrl(filePath);
break;
}
}
@@ -305,10 +309,10 @@ void tst_Sanity::attachedObjects()
void tst_Sanity::attachedObjects_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/calendar");
- addTestRows(&engine, "/controls");
- addTestRows(&engine, "/controls/material", QStringList() << "Ripple" << "SliderHandle");
- addTestRows(&engine, "/controls/universal");
+ addTestRows(&engine, "calendar");
+ addTestRows(&engine, "controls");
+ addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle");
+ addTestRows(&engine, "controls/universal");
}
QTEST_MAIN(tst_Sanity)
diff --git a/tests/auto/snippets/data/dependencies.qml b/tests/auto/snippets/data/dependencies.qml
new file mode 100644
index 00000000..15fa1a9a
--- /dev/null
+++ b/tests/auto/snippets/data/dependencies.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.6
+import QtQuick.Layouts 1.3
+import Qt.labs.controls 1.0
+import Qt.labs.calendar 1.0
+
+Control { }
diff --git a/tests/auto/styles/data/dependencies.qml b/tests/auto/styles/data/dependencies.qml
new file mode 100644
index 00000000..310fbf40
--- /dev/null
+++ b/tests/auto/styles/data/dependencies.qml
@@ -0,0 +1,7 @@
+import QtTest 1.0
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+import Qt.labs.controls.material 1.0
+import Qt.labs.controls.universal 1.0
+
+Control { }
diff --git a/tests/benchmarks/creationtime/data/dependencies.qml b/tests/benchmarks/creationtime/data/dependencies.qml
new file mode 100644
index 00000000..65fb0414
--- /dev/null
+++ b/tests/benchmarks/creationtime/data/dependencies.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+import Qt.labs.controls.material 1.0
+import Qt.labs.controls.universal 1.0
+import Qt.labs.calendar 1.0
+
+Control { }
diff --git a/tests/benchmarks/creationtime/tst_creationtime.cpp b/tests/benchmarks/creationtime/tst_creationtime.cpp
index 2a61b0ea..927dd17d 100644
--- a/tests/benchmarks/creationtime/tst_creationtime.cpp
+++ b/tests/benchmarks/creationtime/tst_creationtime.cpp
@@ -78,15 +78,19 @@ static void addTestRows(QQmlEngine *engine, const QString &targetPath, const QSt
// the engine's import path. This way we can use QQmlComponent to load each QML file
// for benchmarking.
- QFileInfoList entries = QDir(QQC2_IMPORT_PATH + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
+ QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
foreach (const QFileInfo &entry, entries) {
QString name = entry.baseName();
if (!skiplist.contains(name)) {
foreach (const QString &importPath, engine->importPathList()) {
- QString filePath = QDir(importPath + "/Qt/labs/" + targetPath).absoluteFilePath(entry.fileName());
+ QString name = entry.dir().dirName() + "/" + entry.fileName();
+ QString filePath = importPath + "/Qt/labs/" + targetPath + "/" + entry.fileName();
if (QFile::exists(filePath)) {
QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath);
break;
+ } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) {
+ QTest::newRow(qPrintable(name)) << QUrl(filePath);
+ break;
}
}
}
@@ -117,7 +121,7 @@ void tst_CreationTime::controls()
void tst_CreationTime::controls_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls");
+ addTestRows(&engine, "controls");
}
void tst_CreationTime::material()
@@ -129,7 +133,7 @@ void tst_CreationTime::material()
void tst_CreationTime::material_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls/material", QStringList() << "Ripple" << "SliderHandle");
+ addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle");
}
void tst_CreationTime::universal()
@@ -141,7 +145,7 @@ void tst_CreationTime::universal()
void tst_CreationTime::universal_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls/universal");
+ addTestRows(&engine, "controls/universal");
}
void tst_CreationTime::calendar()
@@ -153,7 +157,7 @@ void tst_CreationTime::calendar()
void tst_CreationTime::calendar_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/calendar");
+ addTestRows(&engine, "calendar");
}
QTEST_MAIN(tst_CreationTime)
diff --git a/tests/benchmarks/objectcount/data/dependencies.qml b/tests/benchmarks/objectcount/data/dependencies.qml
new file mode 100644
index 00000000..65fb0414
--- /dev/null
+++ b/tests/benchmarks/objectcount/data/dependencies.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+import Qt.labs.controls.material 1.0
+import Qt.labs.controls.universal 1.0
+import Qt.labs.calendar 1.0
+
+Control { }
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index b479b0e2..51a968d0 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -84,7 +84,7 @@ void tst_ObjectCount::init()
// warmup
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0; import QtQuick.Controls 1.3 as C1; import Qt.labs.controls 1.0 as C2; Row { C1.Button {} C2.Button {} }", QUrl());
+ component.setData("import QtQuick 2.0; import Qt.labs.controls 1.0; Item { Button {} }", QUrl());
delete component.create();
}
@@ -118,15 +118,19 @@ static void addTestRows(QQmlEngine *engine, const QString &targetPath, const QSt
// the engine's import path. This way we can use QQmlComponent to load each QML file
// for benchmarking.
- QFileInfoList entries = QDir(QQC2_IMPORT_PATH + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
+ QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files);
foreach (const QFileInfo &entry, entries) {
QString name = entry.baseName();
if (!skiplist.contains(name)) {
foreach (const QString &importPath, engine->importPathList()) {
- QString filePath = QDir(importPath + "/Qt/labs/" + targetPath).absoluteFilePath(entry.fileName());
+ QString name = entry.dir().dirName() + "/" + entry.fileName();
+ QString filePath = importPath + "/Qt/labs/" + targetPath + "/" + entry.fileName();
if (QFile::exists(filePath)) {
QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath);
break;
+ } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) {
+ QTest::newRow(qPrintable(name)) << QUrl(filePath);
+ break;
}
}
}
@@ -161,7 +165,7 @@ void tst_ObjectCount::calendar()
void tst_ObjectCount::calendar_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/calendar");
+ addTestRows(&engine, "calendar");
}
void tst_ObjectCount::controls()
@@ -173,7 +177,7 @@ void tst_ObjectCount::controls()
void tst_ObjectCount::controls_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls");
+ addTestRows(&engine, "controls");
}
void tst_ObjectCount::material()
@@ -185,7 +189,7 @@ void tst_ObjectCount::material()
void tst_ObjectCount::material_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls/material", QStringList() << "Ripple" << "SliderHandle");
+ addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle");
}
void tst_ObjectCount::universal()
@@ -197,7 +201,7 @@ void tst_ObjectCount::universal()
void tst_ObjectCount::universal_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "/controls/universal");
+ addTestRows(&engine, "controls/universal");
}
QTEST_MAIN(tst_ObjectCount)
diff --git a/tests/manual/gifs/eventcapturer.cpp b/tests/manual/gifs/eventcapturer.cpp
index 5b5905cd..83e1c76b 100644
--- a/tests/manual/gifs/eventcapturer.cpp
+++ b/tests/manual/gifs/eventcapturer.cpp
@@ -69,7 +69,7 @@
EventCapturer::EventCapturer(QObject *parent) :
QObject(parent),
- mEventSource(Q_NULLPTR),
+ mEventSource(nullptr),
mStopCaptureKey(Qt::Key_Escape),
mMoveEventTrimFlags(TrimNone),
mDuration(0),
diff --git a/tests/manual/gifs/eventcapturer.h b/tests/manual/gifs/eventcapturer.h
index b1f2b4ff..7982d6e9 100644
--- a/tests/manual/gifs/eventcapturer.h
+++ b/tests/manual/gifs/eventcapturer.h
@@ -74,7 +74,7 @@ public:
QVector<CapturedEvent> capturedEvents() const;
protected:
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
private slots:
void stopCapturing();
diff --git a/tests/manual/gifs/gifrecorder.cpp b/tests/manual/gifs/gifrecorder.cpp
index 3ba33552..8082b736 100644
--- a/tests/manual/gifs/gifrecorder.cpp
+++ b/tests/manual/gifs/gifrecorder.cpp
@@ -64,8 +64,8 @@ namespace {
}
GifRecorder::GifRecorder() :
- QObject(Q_NULLPTR),
- mWindow(Q_NULLPTR),
+ QObject(nullptr),
+ mWindow(nullptr),
mHighQuality(false),
mRecordingDuration(0),
mRecordCursor(false),
diff --git a/tests/manual/viewinqwidget/main.cpp b/tests/manual/viewinqwidget/main.cpp
index ff949544..3611e071 100644
--- a/tests/manual/viewinqwidget/main.cpp
+++ b/tests/manual/viewinqwidget/main.cpp
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
const QUrl gallerySource(QLatin1String("qrc:/gallery.qml"));
QQmlApplicationEngine engine(gallerySource);
- QObject *root = engine.rootObjects().value(0, Q_NULLPTR);
+ QObject *root = engine.rootObjects().value(0, nullptr);
if (!root || !root->isWindowType()) {
qWarning() << "Load error" << gallerySource;
return 1;