diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-06-14 21:42:20 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-06-14 21:42:20 +0200 |
commit | bf82b95088f552a5f62d333662c7a9202d293359 (patch) | |
tree | cd25b2d91c3d98733920f7a8561d41c89731975b /tests | |
parent | 221c3ce846e5a6167aa0b2d356c23d5b9c7e32cb (diff) | |
parent | 73e722a85fbf0675938023b0207d7daac93b085a (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/quicktemplates2/qquickslider.cpp
Change-Id: Idefd7b77b1937d423ee2db5064ff09c36b240ef0
Diffstat (limited to 'tests')
21 files changed, 137 insertions, 71 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index bf608c17..b17aa77a 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -5,16 +5,15 @@ SUBDIRS += \ calendar \ controls \ drawer \ - material \ menu \ popup \ pressandhold \ + qquickmaterialstyle \ qquickstyle \ qquickstyleselector \ + qquickuniversalstyle \ sanity \ - snippets \ - styles \ - universal + snippets # QTBUG-50295 !linux: SUBDIRS += \ diff --git a/tests/auto/controls/controls.pro b/tests/auto/controls/controls.pro index d1dd6814..8f2f8e69 100644 --- a/tests/auto/controls/controls.pro +++ b/tests/auto/controls/controls.pro @@ -1,12 +1,5 @@ -TEMPLATE = app -TARGET = tst_controls -CONFIG += qmltestcase - -SOURCES += \ - $$PWD/tst_controls.cpp - -OTHER_FILES += \ - $$PWD/data/* - -TESTDATA += \ - $$PWD/data/tst_* +TEMPLATE = subdirs +SUBDIRS += \ + default \ + material \ + universal diff --git a/tests/auto/controls/data/tst_scrollbar.qml b/tests/auto/controls/data/tst_scrollbar.qml index 2c0f897d..7dc60d97 100644 --- a/tests/auto/controls/data/tst_scrollbar.qml +++ b/tests/auto/controls/data/tst_scrollbar.qml @@ -271,4 +271,17 @@ TestCase { ignoreWarning(Qt.resolvedUrl("tst_scrollbar.qml") + ":45:1: QML TestCase: ScrollBar must be attached to a Flickable") testCase.ScrollBar.vertical = null } + + function test_mirrored() { + var container = flickable.createObject(testCase) + verify(container) + waitForRendering(container) + + container.ScrollBar.vertical = scrollBar.createObject(container) + compare(container.ScrollBar.vertical.x, container.width - container.ScrollBar.vertical.width) + container.ScrollBar.vertical.locale = Qt.locale("ar_EG") + compare(container.ScrollBar.vertical.x, 0) + + container.destroy() + } } diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index c7b1bd91..a0945e8d 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -286,6 +286,12 @@ TestCase { verify(control.value <= 0.25 && control.value >= 0.0) verify(control.position <= 0.25 && control.position >= 0.0) + // QTBUG-53846 + mouseClick(control, control.width * 0.5, control.height * 0.5, Qt.LeftButton) + compare(pressedSpy.count, 6) + compare(control.value, 0.5) + compare(control.position, 0.5) + control.destroy() } diff --git a/tests/auto/styles/styles.pro b/tests/auto/controls/default/default.pro index 3460900c..6ab5b5ff 100644 --- a/tests/auto/styles/styles.pro +++ b/tests/auto/controls/default/default.pro @@ -1,8 +1,14 @@ TEMPLATE = app -TARGET = tst_styles +TARGET = tst_default CONFIG += qmltestcase DEFINES += TST_CONTROLS_DATA=\\\"$$QQC2_SOURCE_TREE/tests/auto/controls/data\\\" SOURCES += \ - $$PWD/tst_styles.cpp + $$PWD/tst_default.cpp + +OTHER_FILES += \ + $$PWD/../data/* + +TESTDATA += \ + $$PWD/../data/tst_* diff --git a/tests/auto/universal/tst_universal.cpp b/tests/auto/controls/default/tst_default.cpp index ea42cc5e..68c3ab8f 100644 --- a/tests/auto/universal/tst_universal.cpp +++ b/tests/auto/controls/default/tst_default.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,4 +35,10 @@ ****************************************************************************/ #include <QtQuickTest/quicktest.h> -QUICK_TEST_MAIN(tst_universal) + +int main(int argc, char *argv[]) +{ + QTEST_ADD_GPU_BLACKLIST_SUPPORT + QTEST_SET_MAIN_SOURCE_PATH + return quick_test_main(argc, argv, "tst_controls::Default", TST_CONTROLS_DATA); +} diff --git a/tests/auto/controls/material/material.pro b/tests/auto/controls/material/material.pro new file mode 100644 index 00000000..1a8260f3 --- /dev/null +++ b/tests/auto/controls/material/material.pro @@ -0,0 +1,15 @@ +TEMPLATE = app +TARGET = tst_material +CONFIG += qmltestcase +QT += quickcontrols2 + +DEFINES += TST_CONTROLS_DATA=\\\"$$QQC2_SOURCE_TREE/tests/auto/controls/data\\\" + +SOURCES += \ + $$PWD/tst_material.cpp + +OTHER_FILES += \ + $$PWD/../data/* + +TESTDATA += \ + $$PWD/../data/tst_* diff --git a/tests/auto/styles/tst_styles.cpp b/tests/auto/controls/material/tst_material.cpp index 049e2bc9..2825b127 100644 --- a/tests/auto/styles/tst_styles.cpp +++ b/tests/auto/controls/material/tst_material.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -34,39 +34,13 @@ ** ****************************************************************************/ -#include <QtCore/qcoreapplication.h> -#include <QtCore/qprocess.h> #include <QtQuickTest/quicktest.h> - -static const char* styles[] = { "Material", "Universal" }; +#include <QtQuickControls2/qquickstyle.h> int main(int argc, char *argv[]) { - QByteArray style = qgetenv("QT_QUICK_CONTROLS_STYLE"); - if (!style.isEmpty()) - return quick_test_main(argc, argv, "tst_styles(" + style + ")", TST_CONTROLS_DATA); - - QCoreApplication app(argc, argv); - - int failures = 0; - int count = sizeof(styles) / sizeof(styles[0]); - - for (int i = 0; i < count; ++i) { - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - env.insert("QT_QUICK_CONTROLS_STYLE", styles[i]); - - QProcess process; - process.setProcessEnvironment(env); - process.setWorkingDirectory(QDir::currentPath()); - process.setProcessChannelMode(QProcess::ForwardedChannels); - - process.start(argv[0], app.arguments().mid(1)); - process.waitForFinished(); - if (process.exitStatus() != QProcess::NormalExit) - return -1; - - failures += process.exitCode(); - } - - return failures; + QTEST_ADD_GPU_BLACKLIST_SUPPORT + QTEST_SET_MAIN_SOURCE_PATH + QQuickStyle::setStyle("Material"); + return quick_test_main(argc, argv, "tst_controls::Material", TST_CONTROLS_DATA); } diff --git a/tests/auto/controls/universal/tst_universal.cpp b/tests/auto/controls/universal/tst_universal.cpp new file mode 100644 index 00000000..de4ca85c --- /dev/null +++ b/tests/auto/controls/universal/tst_universal.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 <QtQuickTest/quicktest.h> +#include <QtQuickControls2/qquickstyle.h> + +int main(int argc, char *argv[]) +{ + QTEST_ADD_GPU_BLACKLIST_SUPPORT + QTEST_SET_MAIN_SOURCE_PATH + QQuickStyle::setStyle("Universal"); + return quick_test_main(argc, argv, "tst_controls::Universal", TST_CONTROLS_DATA); +} diff --git a/tests/auto/controls/universal/universal.pro b/tests/auto/controls/universal/universal.pro new file mode 100644 index 00000000..7a16cc64 --- /dev/null +++ b/tests/auto/controls/universal/universal.pro @@ -0,0 +1,15 @@ +TEMPLATE = app +TARGET = tst_universal +CONFIG += qmltestcase +QT += quickcontrols2 + +DEFINES += TST_CONTROLS_DATA=\\\"$$QQC2_SOURCE_TREE/tests/auto/controls/data\\\" + +SOURCES += \ + $$PWD/tst_universal.cpp + +OTHER_FILES += \ + $$PWD/../data/* + +TESTDATA += \ + $$PWD/../data/tst_* diff --git a/tests/auto/material/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml index 593b5ccb..7305b732 100644 --- a/tests/auto/material/data/tst_material.qml +++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/material/material.pro b/tests/auto/qquickmaterialstyle/qquickmaterialstyle.pro index 52663fdc..eac9bdc4 100644 --- a/tests/auto/material/material.pro +++ b/tests/auto/qquickmaterialstyle/qquickmaterialstyle.pro @@ -1,12 +1,12 @@ TEMPLATE = app -TARGET = tst_material +TARGET = tst_qquickmaterialstyle CONFIG += qmltestcase SOURCES += \ - $$PWD/tst_material.cpp + $$PWD/tst_qquickmaterialstyle.cpp RESOURCES += \ - $$PWD/material.qrc + $$PWD/qquickmaterialstyle.qrc OTHER_FILES += \ $$PWD/data/* diff --git a/tests/auto/material/material.qrc b/tests/auto/qquickmaterialstyle/qquickmaterialstyle.qrc index 53ba6450..53ba6450 100644 --- a/tests/auto/material/material.qrc +++ b/tests/auto/qquickmaterialstyle/qquickmaterialstyle.qrc diff --git a/tests/auto/material/qtquickcontrols2.conf b/tests/auto/qquickmaterialstyle/qtquickcontrols2.conf index b6c7c87e..b6c7c87e 100644 --- a/tests/auto/material/qtquickcontrols2.conf +++ b/tests/auto/qquickmaterialstyle/qtquickcontrols2.conf diff --git a/tests/auto/controls/tst_controls.cpp b/tests/auto/qquickmaterialstyle/tst_qquickmaterialstyle.cpp index 89cc39f0..eeee1e87 100644 --- a/tests/auto/controls/tst_controls.cpp +++ b/tests/auto/qquickmaterialstyle/tst_qquickmaterialstyle.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,4 +35,4 @@ ****************************************************************************/ #include <QtQuickTest/quicktest.h> -QUICK_TEST_MAIN(tst_controls) +QUICK_TEST_MAIN(tst_qquickmaterialstyle) diff --git a/tests/auto/universal/data/tst_universal.qml b/tests/auto/qquickuniversalstyle/data/tst_universal.qml index 0bc0d09d..7ee14da8 100644 --- a/tests/auto/universal/data/tst_universal.qml +++ b/tests/auto/qquickuniversalstyle/data/tst_universal.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/universal/universal.pro b/tests/auto/qquickuniversalstyle/qquickuniversalstyle.pro index bb7a85ca..83bd19a5 100644 --- a/tests/auto/universal/universal.pro +++ b/tests/auto/qquickuniversalstyle/qquickuniversalstyle.pro @@ -1,12 +1,12 @@ TEMPLATE = app -TARGET = tst_universal +TARGET = tst_qquickuniversalstyle CONFIG += qmltestcase SOURCES += \ - $$PWD/tst_universal.cpp + $$PWD/tst_qquickuniversalstyle.cpp RESOURCES += \ - $$PWD/universal.qrc + $$PWD/qquickuniversalstyle.qrc OTHER_FILES += \ $$PWD/data/* diff --git a/tests/auto/universal/universal.qrc b/tests/auto/qquickuniversalstyle/qquickuniversalstyle.qrc index 53ba6450..53ba6450 100644 --- a/tests/auto/universal/universal.qrc +++ b/tests/auto/qquickuniversalstyle/qquickuniversalstyle.qrc diff --git a/tests/auto/universal/qtquickcontrols2.conf b/tests/auto/qquickuniversalstyle/qtquickcontrols2.conf index 8c6dd807..8c6dd807 100644 --- a/tests/auto/universal/qtquickcontrols2.conf +++ b/tests/auto/qquickuniversalstyle/qtquickcontrols2.conf diff --git a/tests/auto/material/tst_material.cpp b/tests/auto/qquickuniversalstyle/tst_qquickuniversalstyle.cpp index 5db9c12b..a4033412 100644 --- a/tests/auto/material/tst_material.cpp +++ b/tests/auto/qquickuniversalstyle/tst_qquickuniversalstyle.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,4 +35,4 @@ ****************************************************************************/ #include <QtQuickTest/quicktest.h> -QUICK_TEST_MAIN(tst_material) +QUICK_TEST_MAIN(tst_qquickuniversalstyle) diff --git a/tests/auto/styles/data/dependencies.qml b/tests/auto/styles/data/dependencies.qml deleted file mode 100644 index 924929cf..00000000 --- a/tests/auto/styles/data/dependencies.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtTest 1.0 -import QtQuick 2.6 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Material 2.0 -import QtQuick.Controls.Universal 2.0 - -Control { } |