From 0e18524a84d2aae65c54edc676d8ad7348f7d61c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 15 May 2020 10:39:51 +0200 Subject: Remove Qt Labs Calendar This is getting its own repository as part of the move to the marketplace. Task-number: QTBUG-84172 Pick-to: 5.15 Change-Id: I2f963c298d6ef95e0832f95aa1e1ea809f4867a2 Reviewed-by: Volker Hilsheimer --- tests/auto/CMakeLists.txt | 1 - tests/auto/accessibility/CMakeLists.txt | 5 + .../accessibility/data/defaults/dayofweekrow-2.qml | 4 - .../accessibility/data/defaults/dayofweekrow.qml | 6 - .../accessibility/data/defaults/monthgrid-2.qml | 6 - .../auto/accessibility/data/defaults/monthgrid.qml | 7 - .../data/defaults/weeknumbercolumn-2.qml | 4 - .../data/defaults/weeknumbercolumn.qml | 6 - .../accessibility/data/override/dayofweekrow-2.qml | 6 - .../accessibility/data/override/dayofweekrow.qml | 6 - .../accessibility/data/override/monthgrid-2.qml | 7 - .../auto/accessibility/data/override/monthgrid.qml | 7 - .../data/override/weeknumbercolumn-2.qml | 4 - .../data/override/weeknumbercolumn.qml | 6 - tests/auto/accessibility/tst_accessibility.cpp | 52 ++-- tests/auto/auto.pro | 1 - tests/auto/calendar/CMakeLists.txt | 25 -- tests/auto/calendar/calendar.pro | 12 - tests/auto/calendar/data/tst_calendarmodel.qml | 125 --------- tests/auto/calendar/data/tst_dayofweekrow.qml | 95 ------- tests/auto/calendar/data/tst_monthgrid.qml | 284 --------------------- tests/auto/calendar/data/tst_weeknumbercolumn.qml | 134 ---------- tests/auto/calendar/tst_calendar.cpp | 38 --- tests/auto/qquickcontrol/CMakeLists.txt | 47 ++++ tests/auto/sanity/tst_sanity.cpp | 1 - tests/auto/snippets/data/dependencies.qml | 1 - 26 files changed, 70 insertions(+), 820 deletions(-) delete mode 100644 tests/auto/accessibility/data/defaults/dayofweekrow-2.qml delete mode 100644 tests/auto/accessibility/data/defaults/dayofweekrow.qml delete mode 100644 tests/auto/accessibility/data/defaults/monthgrid-2.qml delete mode 100644 tests/auto/accessibility/data/defaults/monthgrid.qml delete mode 100644 tests/auto/accessibility/data/defaults/weeknumbercolumn-2.qml delete mode 100644 tests/auto/accessibility/data/defaults/weeknumbercolumn.qml delete mode 100644 tests/auto/accessibility/data/override/dayofweekrow-2.qml delete mode 100644 tests/auto/accessibility/data/override/dayofweekrow.qml delete mode 100644 tests/auto/accessibility/data/override/monthgrid-2.qml delete mode 100644 tests/auto/accessibility/data/override/monthgrid.qml delete mode 100644 tests/auto/accessibility/data/override/weeknumbercolumn-2.qml delete mode 100644 tests/auto/accessibility/data/override/weeknumbercolumn.qml delete mode 100644 tests/auto/calendar/CMakeLists.txt delete mode 100644 tests/auto/calendar/calendar.pro delete mode 100644 tests/auto/calendar/data/tst_calendarmodel.qml delete mode 100644 tests/auto/calendar/data/tst_dayofweekrow.qml delete mode 100644 tests/auto/calendar/data/tst_monthgrid.qml delete mode 100644 tests/auto/calendar/data/tst_weeknumbercolumn.qml delete mode 100644 tests/auto/calendar/tst_calendar.cpp create mode 100644 tests/auto/qquickcontrol/CMakeLists.txt (limited to 'tests/auto') diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 8976a7dd..31d13ca7 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,7 +1,6 @@ # Generated from auto.pro. add_subdirectory(accessibility) -add_subdirectory(calendar) add_subdirectory(controls) add_subdirectory(cursor) add_subdirectory(customization) diff --git a/tests/auto/accessibility/CMakeLists.txt b/tests/auto/accessibility/CMakeLists.txt index a1f67d17..9a8fa784 100644 --- a/tests/auto/accessibility/CMakeLists.txt +++ b/tests/auto/accessibility/CMakeLists.txt @@ -1,5 +1,9 @@ # Generated from accessibility.pro. +if(NOT QT_FEATURE_accessibility) + return() +endif() + ##################################################################### ## tst_accessibility Test: ##################################################################### @@ -32,6 +36,7 @@ qt_add_test(tst_accessibility #### Keys ignored in scope 1:.:.:accessibility.pro:: # OTHER_FILES = "data/*.qml" +# _REQUIREMENTS = "qtConfig(accessibility)" ## Scopes: ##################################################################### diff --git a/tests/auto/accessibility/data/defaults/dayofweekrow-2.qml b/tests/auto/accessibility/data/defaults/dayofweekrow-2.qml deleted file mode 100644 index 96c750cb..00000000 --- a/tests/auto/accessibility/data/defaults/dayofweekrow-2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { } diff --git a/tests/auto/accessibility/data/defaults/dayofweekrow.qml b/tests/auto/accessibility/data/defaults/dayofweekrow.qml deleted file mode 100644 index a2aa44ec..00000000 --- a/tests/auto/accessibility/data/defaults/dayofweekrow.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { - Accessible.name: "DayOfWeekRow" -} diff --git a/tests/auto/accessibility/data/defaults/monthgrid-2.qml b/tests/auto/accessibility/data/defaults/monthgrid-2.qml deleted file mode 100644 index 6368d090..00000000 --- a/tests/auto/accessibility/data/defaults/monthgrid-2.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" -} diff --git a/tests/auto/accessibility/data/defaults/monthgrid.qml b/tests/auto/accessibility/data/defaults/monthgrid.qml deleted file mode 100644 index 03de2499..00000000 --- a/tests/auto/accessibility/data/defaults/monthgrid.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" - Accessible.name: title -} diff --git a/tests/auto/accessibility/data/defaults/weeknumbercolumn-2.qml b/tests/auto/accessibility/data/defaults/weeknumbercolumn-2.qml deleted file mode 100644 index 2c5b836b..00000000 --- a/tests/auto/accessibility/data/defaults/weeknumbercolumn-2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { } diff --git a/tests/auto/accessibility/data/defaults/weeknumbercolumn.qml b/tests/auto/accessibility/data/defaults/weeknumbercolumn.qml deleted file mode 100644 index 71d533ef..00000000 --- a/tests/auto/accessibility/data/defaults/weeknumbercolumn.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { - Accessible.name: "WeekNumberColumn" -} diff --git a/tests/auto/accessibility/data/override/dayofweekrow-2.qml b/tests/auto/accessibility/data/override/dayofweekrow-2.qml deleted file mode 100644 index 344bd94c..00000000 --- a/tests/auto/accessibility/data/override/dayofweekrow-2.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { - Accessible.name: "Override" -} diff --git a/tests/auto/accessibility/data/override/dayofweekrow.qml b/tests/auto/accessibility/data/override/dayofweekrow.qml deleted file mode 100644 index e1e682c5..00000000 --- a/tests/auto/accessibility/data/override/dayofweekrow.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { - Accessible.name: "DayOfWeekRowOverride" -} diff --git a/tests/auto/accessibility/data/override/monthgrid-2.qml b/tests/auto/accessibility/data/override/monthgrid-2.qml deleted file mode 100644 index f56f7788..00000000 --- a/tests/auto/accessibility/data/override/monthgrid-2.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" - Accessible.name: title + "Override" -} diff --git a/tests/auto/accessibility/data/override/monthgrid.qml b/tests/auto/accessibility/data/override/monthgrid.qml deleted file mode 100644 index f56f7788..00000000 --- a/tests/auto/accessibility/data/override/monthgrid.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" - Accessible.name: title + "Override" -} diff --git a/tests/auto/accessibility/data/override/weeknumbercolumn-2.qml b/tests/auto/accessibility/data/override/weeknumbercolumn-2.qml deleted file mode 100644 index 2c5b836b..00000000 --- a/tests/auto/accessibility/data/override/weeknumbercolumn-2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { } diff --git a/tests/auto/accessibility/data/override/weeknumbercolumn.qml b/tests/auto/accessibility/data/override/weeknumbercolumn.qml deleted file mode 100644 index 7e182917..00000000 --- a/tests/auto/accessibility/data/override/weeknumbercolumn.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { - Accessible.name: "WeekNumberColumnOverride" -} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 6e5a37df..220facb3 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -144,10 +144,6 @@ void tst_accessibility::a11y_data() QTest::newRow("ToolButton") << "toolbutton" << QAccessible::Button << "ToolButton"; QTest::newRow("ToolTip") << "tooltip" << QAccessible::ToolTip << "ToolTip"; QTest::newRow("Tumbler") << "tumbler" << QAccessible::NoRole << ""; // TODO - - QTest::newRow("DayOfWeekRow") << "dayofweekrow" << QAccessible::NoRole << "DayOfWeekRow"; - QTest::newRow("MonthGrid") << "monthgrid" << QAccessible::NoRole << "MonthGrid"; - QTest::newRow("WeekNumberColumn") << "weeknumbercolumn" << QAccessible::NoRole << "WeekNumberColumn"; } void tst_accessibility::a11y() @@ -167,19 +163,15 @@ void tst_accessibility::a11y() #if QT_CONFIG(accessibility) QQuickAccessibleAttached *attached = QQuickAccessibleAttached::attachedProperties(item); - if (fileBaseName != QLatin1String("dayofweekrow") - && fileBaseName != QLatin1String("monthgrid") - && fileBaseName != QLatin1String("weeknumbercolumn")) { - if (QAccessible::isActive()) { - QVERIFY(attached); - } else { - QVERIFY(!attached); - QPlatformAccessibility *accessibility = platformAccessibility(); - if (!accessibility) - QSKIP("No QPlatformAccessibility available."); - accessibility->setActive(true); - attached = QQuickAccessibleAttached::attachedProperties(item); - } + if (QAccessible::isActive()) { + QVERIFY(attached); + } else { + QVERIFY(!attached); + QPlatformAccessibility *accessibility = platformAccessibility(); + if (!accessibility) + QSKIP("No QPlatformAccessibility available."); + accessibility->setActive(true); + attached = QQuickAccessibleAttached::attachedProperties(item); } QVERIFY(attached); QCOMPARE(attached->role(), role); @@ -237,10 +229,6 @@ void tst_accessibility::override_data() QTest::newRow("ToolButton") << QAccessible::Button; QTest::newRow("ToolTip") << QAccessible::ToolTip; QTest::newRow("Tumbler") << QAccessible::NoRole; - - QTest::newRow("DayOfWeekRow") << QAccessible::NoRole; - QTest::newRow("MonthGrid") << QAccessible::NoRole; - QTest::newRow("WeekNumberColumn") << QAccessible::NoRole; } void tst_accessibility::override() @@ -261,19 +249,15 @@ void tst_accessibility::override() #if QT_CONFIG(accessibility) QQuickAccessibleAttached *attached = QQuickAccessibleAttached::attachedProperties(item); - if (fileBaseName != QLatin1String("dayofweekrow") - && fileBaseName != QLatin1String("monthgrid") - && fileBaseName != QLatin1String("weeknumbercolumn")) { - if (QAccessible::isActive()) { - QVERIFY(attached); - } else { - QPlatformAccessibility *accessibility = platformAccessibility(); - if (!accessibility) - QSKIP("No QPlatformAccessibility available."); - accessibility->setActive(true); - if (!attached) - attached = QQuickAccessibleAttached::attachedProperties(item); - } + if (QAccessible::isActive()) { + QVERIFY(attached); + } else { + QPlatformAccessibility *accessibility = platformAccessibility(); + if (!accessibility) + QSKIP("No QPlatformAccessibility available."); + accessibility->setActive(true); + if (!attached) + attached = QQuickAccessibleAttached::attachedProperties(item); } QVERIFY(attached); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 6059cf7b..03b6369d 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs SUBDIRS += \ accessibility \ - calendar \ controls \ cursor \ customization \ diff --git a/tests/auto/calendar/CMakeLists.txt b/tests/auto/calendar/CMakeLists.txt deleted file mode 100644 index 34937d14..00000000 --- a/tests/auto/calendar/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Generated from calendar.pro. - -##################################################################### -## tst_calendar Test: -##################################################################### - -# Collect test data -file(GLOB_RECURSE test_data_glob - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/data/tst_*) -list(APPEND test_data ${test_data_glob}) - -qt_add_test(tst_calendar - GUI - QMLTEST - SOURCES - tst_calendar.cpp - PUBLIC_LIBRARIES - Qt::Gui - TESTDATA ${test_data} -) - -#### Keys ignored in scope 1:.:.:calendar.pro:: -# OTHER_FILES = "$$PWD/data/*.qml" -# TEMPLATE = "app" diff --git a/tests/auto/calendar/calendar.pro b/tests/auto/calendar/calendar.pro deleted file mode 100644 index 9fdf20ad..00000000 --- a/tests/auto/calendar/calendar.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = app -TARGET = tst_calendar -CONFIG += qmltestcase - -SOURCES += \ - $$PWD/tst_calendar.cpp - -OTHER_FILES += \ - $$PWD/data/*.qml - -TESTDATA += \ - $$PWD/data/tst_* diff --git a/tests/auto/calendar/data/tst_calendarmodel.qml b/tests/auto/calendar/data/tst_calendarmodel.qml deleted file mode 100644 index ccadd488..00000000 --- a/tests/auto/calendar/data/tst_calendarmodel.qml +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtTest 1.0 -import QtQml 2.2 -import Qt.labs.calendar 1.0 - -TestCase { - id: testCase - name: "CalendarModel" - - Component { - id: calendarModel - CalendarModel { } - } - - Component { - id: instantiator - Instantiator { - model: CalendarModel { - from: new Date(2016, 0, 1) - to: new Date(2016, 11, 31) - } - QtObject { - readonly property int month: model.month - readonly property int year: model.year - } - } - } - - function test_indices_data() { - return [ - { tag: "2013", from: "2013-01-01", to: "2013-12-31", count: 12 }, - { tag: "2016", from: "2016-01-01", to: "2016-03-31", count: 3 } - ] - } - - function test_indices(data) { - var model = calendarModel.createObject(testCase, {from: data.from, to: data.to}) - verify(model) - - compare(model.count, data.count) - - var y = parseInt(data.tag) - for (var m = 0; m < 12; ++m) { - compare(model.yearAt(m), y) - compare(model.indexOf(y, m), m) - compare(model.indexOf(new Date(y, m, 1)), m) - compare(model.monthAt(m), m) - } - - model.destroy() - } - - function test_invalid() { - var model = calendarModel.createObject(testCase) - verify(model) - - compare(model.indexOf(-1, -1), -1) - compare(model.indexOf(new Date(-1, -1, -1)), -1) - - model.destroy() - } - - function test_instantiator() { - var inst = instantiator.createObject(testCase) - verify(inst) - - compare(inst.count, 12) - for (var m = 0; m < inst.count; ++m) { - compare(inst.objectAt(m).month, m) - compare(inst.objectAt(m).year, 2016) - } - - inst.destroy() - } -} diff --git a/tests/auto/calendar/data/tst_dayofweekrow.qml b/tests/auto/calendar/data/tst_dayofweekrow.qml deleted file mode 100644 index f6615f78..00000000 --- a/tests/auto/calendar/data/tst_dayofweekrow.qml +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtTest 1.0 -import Qt.labs.calendar 1.0 - -TestCase { - id: testCase - width: 400 - height: 400 - visible: true - when: windowShown - name: "DayOfWeekRow" - - Component { - id: component - DayOfWeekRow { } - } - - function test_locale() { - var control = component.createObject(testCase) - - verify(control.contentItem.children[0]) - - control.locale = Qt.locale("en_US") - compare(control.contentItem.children[0].text, "Sun") - - control.locale = Qt.locale("no_NO") - compare(control.contentItem.children[0].text, "man.") - - control.locale = Qt.locale("fi_FI") - compare(control.contentItem.children[0].text, "ma") - - control.destroy() - } - - function test_font() { - var control = component.createObject(testCase) - - verify(control.contentItem.children[0]) - - control.font.pixelSize = 123 - compare(control.contentItem.children[0].font.pixelSize, 123) - - control.destroy() - } -} diff --git a/tests/auto/calendar/data/tst_monthgrid.qml b/tests/auto/calendar/data/tst_monthgrid.qml deleted file mode 100644 index 6d125712..00000000 --- a/tests/auto/calendar/data/tst_monthgrid.qml +++ /dev/null @@ -1,284 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtTest 1.0 -import Qt.labs.calendar 1.0 - -TestCase { - id: testCase - width: 400 - height: 400 - visible: true - when: windowShown - name: "MonthGrid" - - Component { - id: defaultGrid - MonthGrid { } - } - - Component { - id: delegateGrid - MonthGrid { - delegate: Item { - readonly property date date: model.date - readonly property int day: model.day - readonly property bool today: model.today - readonly property int weekNumber: model.weekNumber - readonly property int month: model.month - readonly property int year: model.year - } - } - } - - Component { - id: signalSpy - SignalSpy { } - } - - function test_locale() { - var control = delegateGrid.createObject(testCase, {month: 0, year: 2013}) - - compare(control.contentItem.children.length, 6 * 7 + 1) - - // January 2013 - compare(control.month, 0) - compare(control.year, 2013) - - // en_GB - control.locale = Qt.locale("en_GB") - compare(control.locale.name, "en_GB") - - // M T W T F S S - var en_GB = ["2012-12-31", "2013-01-01", "2013-01-02", "2013-01-03", "2013-01-04", "2013-01-05", "2013-01-06", - "2013-01-07", "2013-01-08", "2013-01-09", "2013-01-10", "2013-01-11", "2013-01-12", "2013-01-13", - "2013-01-14", "2013-01-15", "2013-01-16", "2013-01-17", "2013-01-18", "2013-01-19", "2013-01-20", - "2013-01-21", "2013-01-22", "2013-01-23", "2013-01-24", "2013-01-25", "2013-01-26", "2013-01-27", - "2013-01-28", "2013-01-29", "2013-01-30", "2013-01-31", "2013-02-01", "2013-02-02", "2013-02-03", - "2013-02-04", "2013-02-05", "2013-02-06", "2013-02-07", "2013-02-08", "2013-02-09", "2013-02-10"] - - for (var i = 0; i < 42; ++i) { - var cellDate = new Date(en_GB[i]) - compare(control.contentItem.children[i].date.getFullYear(), cellDate.getUTCFullYear()) - compare(control.contentItem.children[i].date.getMonth(), cellDate.getUTCMonth()) - compare(control.contentItem.children[i].date.getDate(), cellDate.getUTCDate()) - compare(control.contentItem.children[i].day, cellDate.getUTCDate()) - compare(control.contentItem.children[i].today, cellDate === new Date()) - compare(control.contentItem.children[i].month, cellDate.getUTCMonth()) - compare(control.contentItem.children[i].year, cellDate.getUTCFullYear()) - } - - // en_US - control.locale = Qt.locale("en_US") - compare(control.locale.name, "en_US") - - // S M T W T F S - var en_US = ["2012-12-30", "2012-12-31", "2013-01-01", "2013-01-02", "2013-01-03", "2013-01-04", "2013-01-05", - "2013-01-06", "2013-01-07", "2013-01-08", "2013-01-09", "2013-01-10", "2013-01-11", "2013-01-12", - "2013-01-13", "2013-01-14", "2013-01-15", "2013-01-16", "2013-01-17", "2013-01-18", "2013-01-19", - "2013-01-20", "2013-01-21", "2013-01-22", "2013-01-23", "2013-01-24", "2013-01-25", "2013-01-26", - "2013-01-27", "2013-01-28", "2013-01-29", "2013-01-30", "2013-01-31", "2013-02-01", "2013-02-02", - "2013-02-03", "2013-02-04", "2013-02-05", "2013-02-06", "2013-02-07", "2013-02-08", "2013-02-09"] - - for (var j = 0; j < 42; ++j) { - cellDate = new Date(en_US[j]) - compare(control.contentItem.children[j].date.getFullYear(), cellDate.getUTCFullYear()) - compare(control.contentItem.children[j].date.getMonth(), cellDate.getUTCMonth()) - compare(control.contentItem.children[j].date.getDate(), cellDate.getUTCDate()) - compare(control.contentItem.children[j].day, cellDate.getUTCDate()) - compare(control.contentItem.children[j].today, cellDate === new Date()) - compare(control.contentItem.children[j].month, cellDate.getUTCMonth()) - compare(control.contentItem.children[j].year, cellDate.getUTCFullYear()) - } - - control.destroy() - } - - function test_range() { - var control = defaultGrid.createObject(testCase) - - control.month = 0 - compare(control.month, 0) - - - ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: month -1 is out of range \[0...11\]$/) - control.month = -1 - compare(control.month, 0) - - control.month = 11 - compare(control.month, 11) - - ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: month 12 is out of range \[0...11\]$/) - control.month = 12 - compare(control.month, 11) - - control.year = -271820 - compare(control.year, -271820) - - ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: year -271821 is out of range \[-271820...275759\]$/) - control.year = -271821 - compare(control.year, -271820) - - control.year = 275759 - compare(control.year, 275759) - - ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: year 275760 is out of range \[-271820...275759\]$/) - control.year = 275760 - compare(control.year, 275759) - - control.destroy() - } - - function test_bce() { - var control = defaultGrid.createObject(testCase) - - compare(control.contentItem.children.length, 6 * 7 + 1) - - // fi_FI - control.locale = Qt.locale("fi_FI") - compare(control.locale.name, "fi_FI") - - // January 1 BCE - control.month = 0 - compare(control.month, 0) - control.year = -1 - compare(control.year, -1) - - // M T W T F S S - var jan1bce = [27, 28, 29, 30, 31, 1, 2, - 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, - 31, 1, 2, 3, 4, 5, 6] - - for (var i = 0; i < 42; ++i) - compare(control.contentItem.children[i].text, jan1bce[i].toString()) - - // February 1 BCE - control.month = 1 - compare(control.month, 1) - control.year = -1 - compare(control.year, -1) - - // M T W T F S S - var feb1bce = [31, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, - 28, 29, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12] - - for (var j = 0; j < 42; ++j) - compare(control.contentItem.children[j].text, feb1bce[j].toString()) - - control.destroy() - } - - function test_font() { - var control = defaultGrid.createObject(testCase) - - verify(control.contentItem.children[0]) - - control.font.pixelSize = 123 - compare(control.contentItem.children[0].font.pixelSize, 123) - - control.destroy() - } - - function test_clicked_data() { - return [ - { tag: "mouse", touch: false }, - { tag: "touch", touch: true } - ] - } - - function test_clicked(data) { - var control = createTemporaryObject(defaultGrid, testCase) - verify(control) - - compare(control.contentItem.children.length, 6 * 7 + 1) - - var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressed"}) - verify(pressedSpy.valid) - - var releasedSpy = signalSpy.createObject(control, {target: control, signalName: "released"}) - verify(releasedSpy.valid) - - var clickedSpy = signalSpy.createObject(control, {target: control, signalName: "clicked"}) - verify(clickedSpy.valid) - - var touch = touchEvent(control) - - for (var i = 0; i < 42; ++i) { - var cell = control.contentItem.children[i] - verify(cell) - - if (data.touch) - touch.press(0, cell).commit() - else - mousePress(cell) - - compare(pressedSpy.count, i + 1) - compare(releasedSpy.count, i) - compare(clickedSpy.count, i) - - if (data.touch) - touch.release(0, cell).commit() - else - mouseRelease(cell) - - compare(pressedSpy.count, i + 1) - compare(releasedSpy.count, i + 1) - compare(clickedSpy.count, i + 1) - } - } -} diff --git a/tests/auto/calendar/data/tst_weeknumbercolumn.qml b/tests/auto/calendar/data/tst_weeknumbercolumn.qml deleted file mode 100644 index d1b50339..00000000 --- a/tests/auto/calendar/data/tst_weeknumbercolumn.qml +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import QtTest 1.0 -import Qt.labs.calendar 1.0 - -TestCase { - id: testCase - width: 400 - height: 400 - visible: true - when: windowShown - name: "WeekNumberColumn" - - Component { - id: component - WeekNumberColumn { } - } - - function test_locale() { - var control = component.createObject(testCase) - - compare(control.contentItem.children.length, 6 + 1) - - control.month = 11 - control.year = 2015 - - // en_US: [48...53] - control.locale = Qt.locale("en_US") - for (var i = 0; i < 6; ++i) - compare(control.contentItem.children[i].text, (i + 48).toString()) - - // no_NO: [49...1] - control.locale = Qt.locale("no_NO") - for (var j = 0; j < 5; ++j) - compare(control.contentItem.children[j].text, (j + 49).toString()) - compare(control.contentItem.children[5].text, "1") - - control.destroy() - } - - function test_range() { - var control = component.createObject(testCase) - - control.month = 0 - compare(control.month, 0) - - ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: month -1 is out of range \[0...11\]$/) - control.month = -1 - compare(control.month, 0) - - control.month = 11 - compare(control.month, 11) - - ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: month 12 is out of range \[0...11\]$/) - control.month = 12 - compare(control.month, 11) - - control.year = -271820 - compare(control.year, -271820) - - ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: year -271821 is out of range \[-271820...275759\]$/) - control.year = -271821 - compare(control.year, -271820) - - control.year = 275759 - compare(control.year, 275759) - - ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: year 275760 is out of range \[-271820...275759\]$/) - control.year = 275760 - compare(control.year, 275759) - - control.destroy() - } - - function test_font() { - var control = component.createObject(testCase) - - verify(control.contentItem.children[0]) - - control.font.pixelSize = 123 - compare(control.contentItem.children[0].font.pixelSize, 123) - - control.destroy() - } -} diff --git a/tests/auto/calendar/tst_calendar.cpp b/tests/auto/calendar/tst_calendar.cpp deleted file mode 100644 index 0194be62..00000000 --- a/tests/auto/calendar/tst_calendar.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -QUICK_TEST_MAIN(tst_calendar) diff --git a/tests/auto/qquickcontrol/CMakeLists.txt b/tests/auto/qquickcontrol/CMakeLists.txt new file mode 100644 index 00000000..59e1ccb6 --- /dev/null +++ b/tests/auto/qquickcontrol/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickcontrol.pro. + +##################################################################### +## tst_qquickcontrol Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_qquickcontrol + SOURCES + ../shared/qtest_quickcontrols.h + ../shared/util.cpp ../shared/util.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickcontrol.cpp + DEFINES + QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/imports\\\" + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickControls2 + Qt::QuickPrivate + Qt::QuickTemplates2Private + Qt::TestPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickcontrol.pro:: +# OTHER_FILES = "data/*.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickcontrol CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickcontrol CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp index 78b86f00..b5d0054b 100644 --- a/tests/auto/sanity/tst_sanity.cpp +++ b/tests/auto/sanity/tst_sanity.cpp @@ -365,7 +365,6 @@ void tst_Sanity::attachedObjects() void tst_Sanity::attachedObjects_data() { QTest::addColumn("url"); - addTestRowForEachControl(&engine, "calendar", "Qt/labs/calendar"); addTestRowForEachControl(&engine, "controls", "QtQuick/Controls.2"); addTestRowForEachControl(&engine, "controls/fusion", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator"); addTestRowForEachControl(&engine, "controls/material", "QtQuick/Controls.2/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate"); diff --git a/tests/auto/snippets/data/dependencies.qml b/tests/auto/snippets/data/dependencies.qml index db0a968d..0fe2dbf0 100644 --- a/tests/auto/snippets/data/dependencies.qml +++ b/tests/auto/snippets/data/dependencies.qml @@ -3,6 +3,5 @@ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Universal 2.12 -import Qt.labs.calendar 1.0 Control { } -- cgit v1.2.3