From 0efd4f15979cc6186cae3f29613245aa457bc170 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 May 2017 22:29:58 +0200 Subject: Cleanup obsolete references to doc/snippets/screenshots Change-Id: Ia631cd493d695aaac44d612f234756b4e5b558dd Reviewed-by: Mitch Curtis --- tests/auto/sanity/tst_sanity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp index 8d3fee7b..2988c96c 100644 --- a/tests/auto/sanity/tst_sanity.cpp +++ b/tests/auto/sanity/tst_sanity.cpp @@ -139,7 +139,7 @@ private: void tst_Sanity::initTestCase() { QDirIterator it(QQC2_IMPORT_PATH, QStringList() << "*.qml" << "*.js", QDir::Files, QDirIterator::Subdirectories); - const QStringList excludeDirs = QStringList() << QStringLiteral("snippets") << QStringLiteral("screenshots") << QStringLiteral("designer"); + const QStringList excludeDirs = QStringList() << QStringLiteral("snippets") << QStringLiteral("designer"); while (it.hasNext()) { it.next(); QFileInfo info = it.fileInfo(); -- cgit v1.2.3 From 932d5f78296e604c57c8ebcfe5c94f5ce62238f4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 May 2017 21:09:46 +0200 Subject: tst_snippets: skip style-specific screenshots when appropriate For example, don't take screenshots of qtquickcontrols2-material-*.qml snippets when running with another style than the Material style. Change-Id: Ifef5b841d16314ba5d131a7d56f57251d6780ae7 Reviewed-by: Mitch Curtis --- tests/auto/snippets/snippets.pro | 2 +- tests/auto/snippets/tst_snippets.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/snippets/snippets.pro b/tests/auto/snippets/snippets.pro index 82191220..6f366f23 100644 --- a/tests/auto/snippets/snippets.pro +++ b/tests/auto/snippets/snippets.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = tst_snippets -QT += quick testlib +QT += quick quickcontrols2 testlib CONFIG += testcase macos:CONFIG -= app_bundle diff --git a/tests/auto/snippets/tst_snippets.cpp b/tests/auto/snippets/tst_snippets.cpp index 97b10fe1..1185bde9 100644 --- a/tests/auto/snippets/tst_snippets.cpp +++ b/tests/auto/snippets/tst_snippets.cpp @@ -36,6 +36,7 @@ #include #include +#include typedef QPair QStringPair; @@ -111,6 +112,14 @@ void tst_Snippets::verify() QVERIFY(warnings.isEmpty()); if (takeScreenshots) { + const QString currentDataTag = QLatin1String(QTest::currentDataTag()); + static const QString currentStyle = QQuickStyle::name(); + static const QStringList availableStyles = QQuickStyle::availableStyles(); + for (const QString &availableStyle : availableStyles) { + if (currentStyle != availableStyle && currentDataTag.startsWith("qtquickcontrols2-" + availableStyle.toLower() + "-")) + QSKIP(qPrintable(QString("Not running with the %1 style").arg(availableStyle))); + } + QQuickWindow *window = qobject_cast(root); if (!window) { QQuickView *view = new QQuickView; -- cgit v1.2.3 From 28063805bf22b77a93f22a4289ca8afa9f1cb201 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Tue, 2 May 2017 09:32:01 +0300 Subject: Disable/blacklist failing tests for boot2qt Currently boot2qt is tested with QEMU and some tests fail. Disabling them for now to make it possible to enable qt5 tests for Coin. Task-number: QTBUG-60266 Change-Id: I2b8d7612ae22741cb19037ff47698f096753d9ca Reviewed-by: J-P Nurmi --- tests/auto/auto.pro | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 1947b177..ebc0b337 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -20,3 +20,9 @@ SUBDIRS += \ revisions \ sanity \ snippets + +# QTBUG-60268 +boot2qt: SUBDIRS -= applicationwindow calendar controls cursor \ + drawer focus menu platform popup qquickmaterialstyle \ + qquickmaterialstyleconf qquickuniversalstyle \ + qquickuniversalstyleconf snippets -- cgit v1.2.3 From 3cf7160277219ccc8ee04053a76a65f50587dd27 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 9 May 2017 08:56:50 +0200 Subject: tst_controls: use TestCase::createTemporaryObject() Change-Id: Iec2e4fdba18402762c6d6580abf8e677d5ae583c Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_abstractbutton.qml | 4 +--- tests/auto/controls/data/tst_pane.qml | 4 +--- tests/auto/controls/data/tst_popup.qml | 6 ++---- tests/auto/controls/data/tst_stackview.qml | 8 ++------ 4 files changed, 6 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml index 422d13b4..bddb952f 100644 --- a/tests/auto/controls/data/tst_abstractbutton.qml +++ b/tests/auto/controls/data/tst_abstractbutton.qml @@ -147,7 +147,7 @@ TestCase { } function test_keyEvents(data) { - var container = keyCatcher.createObject(testCase) + var container = createTemporaryObject(keyCatcher, testCase) verify(container) var control = button.createObject(container) @@ -161,7 +161,5 @@ TestCase { keyRelease(data.key) compare(container.lastKeyRelease, data.result) - - container.destroy() } } diff --git a/tests/auto/controls/data/tst_pane.qml b/tests/auto/controls/data/tst_pane.qml index f495a159..0d7e6536 100644 --- a/tests/auto/controls/data/tst_pane.qml +++ b/tests/auto/controls/data/tst_pane.qml @@ -152,15 +152,13 @@ TestCase { } function test_implicitContentItem() { - var control = pane.createObject(testCase, {width: 100, height: 100}) + var control = createTemporaryObject(pane, testCase, {width: 100, height: 100}) verify(control) compare(control.width, 100) compare(control.height, 100) compare(control.contentItem.width, control.availableWidth) compare(control.contentItem.height, control.availableHeight) - - control.destroy() } function test_press() { diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index beae39d1..bec50ad0 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -197,7 +197,7 @@ TestCase { } function test_availableSize() { - var control = popupTemplate.createObject(testCase) + var control = createTemporaryObject(popupTemplate, testCase) verify(control) var availableWidthSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "availableWidthChanged"}) @@ -1247,12 +1247,10 @@ TestCase { } function test_windowParent() { - var control = popupControl.createObject(applicationWindow, {width: 100, height: 100}) + var control = createTemporaryObject(popupControl, applicationWindow, {width: 100, height: 100}) verify(control) control.open() verify(control.visible) - - control.destroy() } } diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml index 37bd5222..8650df22 100644 --- a/tests/auto/controls/data/tst_stackview.qml +++ b/tests/auto/controls/data/tst_stackview.qml @@ -1022,7 +1022,7 @@ TestCase { } function test_pushSameItem() { - var control = stackView.createObject(testCase) + var control = createTemporaryObject(stackView, testCase) verify(control) control.push(item, StackView.Immediate) @@ -1045,12 +1045,10 @@ TestCase { verify(current !== item) compare(control.currentItem, current) compare(control.depth, 3) - - control.destroy() } function test_visible() { - var control = stackView.createObject(testCase) + var control = createTemporaryObject(stackView, testCase) verify(control) var item1 = component.createObject(control) @@ -1098,8 +1096,6 @@ TestCase { control.pop(StackView.Immediate) compare(item1.visible, true) compare(item1.StackView.visible, true) - - control.destroy() } function test_resolve() { -- cgit v1.2.3