diff options
Diffstat (limited to 'tests/auto/corelib/animation')
15 files changed, 72 insertions, 8 deletions
diff --git a/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt index 14e09b314e..6e1ac655ba 100644 --- a/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qabstractanimation Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qabstractanimation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qabstractanimation SOURCES tst_qabstractanimation.cpp diff --git a/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp index 0408ad806b..6c87428d75 100644 --- a/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp +++ b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qabstractanimation.h> diff --git a/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt index da7f8b69a3..a8160051a3 100644 --- a/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qanimationgroup Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qanimationgroup LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qanimationgroup SOURCES tst_qanimationgroup.cpp diff --git a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp index af84961531..5345283252 100644 --- a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp +++ b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QPauseAnimation> diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt index 5959440f0a..c532ad7327 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qparallelanimationgroup Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qparallelanimationgroup LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qparallelanimationgroup SOURCES tst_qparallelanimationgroup.cpp diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index 3c5d9ed3a9..c47ce53364 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QVariantAnimation> @@ -7,6 +7,7 @@ #include <QSignalSpy> #include <QtCore/qparallelanimationgroup.h> +#include <QtCore/qscopeguard.h> Q_DECLARE_METATYPE(QAbstractAnimation::State) @@ -928,6 +929,7 @@ void tst_QParallelAnimationGroup::autoAdd() test = static_cast<TestAnimation2*>(group.animationAt(0)); test->setParent(0); // remove the last one (with duration = 250) + const auto deleteParentlessObject = qScopeGuard([test] { delete test; }); QCOMPARE(test->group(), static_cast<QAnimationGroup*>(0)); QCOMPARE(group.duration(), 0); } diff --git a/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt index a6ec4bffad..aa0cb1edc5 100644 --- a/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt @@ -5,9 +5,16 @@ ## tst_qpauseanimation Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpauseanimation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qpauseanimation SOURCES tst_qpauseanimation.cpp LIBRARIES Qt::CorePrivate + Qt::TestPrivate ) diff --git a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp index 53c80ef71f..8b11656706 100644 --- a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp +++ b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp @@ -1,7 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> +#include <QtTest/private/qpropertytesthelper_p.h> #include <QtCore/qpauseanimation.h> #include <QtCore/qpropertyanimation.h> @@ -456,6 +457,12 @@ void tst_QPauseAnimation::bindings() "QPauseAnimation::setDuration: cannot set a negative duration"); animation.setDuration(-1); QCOMPARE(durationObserver, 46); + + QTestPrivate::testReadWritePropertyBasics(animation, 10, 20, "duration"); + if (QTest::currentTestFailed()) { + qDebug("Failed property test for QPauseAnimation::duration"); + return; + } } QTEST_MAIN(tst_QPauseAnimation) diff --git a/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt b/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt index 627e716ba0..38383aff46 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qpropertyanimation Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpropertyanimation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qpropertyanimation SOURCES tst_qpropertyanimation.cpp diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp index d739164a10..03755fa7ab 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtTest/private/qpropertytesthelper_p.h> diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST index f07c0ec4a1..79053cbf68 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST @@ -1,5 +1,4 @@ [finishWithUncontrolledAnimation] -windows-10 msvc-2015 macos [groupWithZeroDurationAnimations] macos diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt index 61dca7c74d..e2ebe8baa9 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt @@ -5,7 +5,15 @@ ## tst_qsequentialanimationgroup Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qsequentialanimationgroup LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qsequentialanimationgroup SOURCES tst_qsequentialanimationgroup.cpp + LIBRARIES + Qt::TestPrivate ) diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp index e6e8731378..7555622162 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp @@ -1,7 +1,9 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> +#include <QtTest/private/qpropertytesthelper_p.h> + #include <QVariantAnimation> #include <QProperty> #include <QPropertyAnimation> @@ -1685,6 +1687,15 @@ void tst_QSequentialAnimationGroup::bindings() group.bindableCurrentAnimation().setBinding([&]() { return leader.value(); }); QCOMPARE(group.currentAnimation(), anim3.get()); + + QTestPrivate::testReadOnlyPropertyBasics(group, anim3.get(), anim2.get(), "currentAnimation", + [&group, totalDuration]() { + group.setCurrentTime(int(totalDuration * 1.5 / 3)); + }); + if (QTest::currentTestFailed()) { + qDebug("Failed property test for QSequentialAnimationGroup::currentAnimation"); + return; + } } QTEST_MAIN(tst_QSequentialAnimationGroup) diff --git a/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt index 34149c9a03..9abc16040f 100644 --- a/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qvariantanimation Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qvariantanimation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qvariantanimation SOURCES tst_qvariantanimation.cpp diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp index 2d8d674ba5..661c4b8108 100644 --- a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp +++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qvariantanimation.h> |