diff options
Diffstat (limited to 'tests/auto')
409 files changed, 12143 insertions, 667 deletions
diff --git a/tests/auto/.prev_CMakeLists.txt b/tests/auto/.prev_CMakeLists.txt new file mode 100644 index 0000000000..c52566a954 --- /dev/null +++ b/tests/auto/.prev_CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from auto.pro. + +add_subdirectory(qml) +add_subdirectory(quick) +add_subdirectory(quicktest) +add_subdirectory(qmldevtools) +add_subdirectory(cmake) +add_subdirectory(installed_cmake) +add_subdirectory(toolsupport) +if(NOT UIKIT) + add_subdirectory(qmltest) +endif() +if(TARGET Qt::Gui AND (QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3)) + add_subdirectory(particles) +endif() +if(TARGET Qt::Gui AND TARGET Qt::Widgets AND (QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3)) + add_subdirectory(quickwidgets) +endif() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 0000000000..eb1c2d34df --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from auto.pro. + +add_subdirectory(qml) +add_subdirectory(quick) +add_subdirectory(quicktest) +add_subdirectory(qmldevtools) +# special case begin +# add_subdirectory(cmake) +# add_subdirectory(installed_cmake) +# special case end +add_subdirectory(toolsupport) +if(NOT UIKIT) + add_subdirectory(qmltest) +endif() +if(TARGET Qt::Gui AND (QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3)) + add_subdirectory(particles) +endif() +if(TARGET Qt::Gui AND TARGET Qt::Widgets AND (QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3)) + add_subdirectory(quickwidgets) +endif() diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index bda5d626a9..de776e9dd1 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -1,4 +1,3 @@ - cmake_minimum_required(VERSION 2.8) project(qmake_cmake_files) @@ -26,6 +25,7 @@ add_test(qtquickcompiler ${CMAKE_CTEST_COMMAND} --build-project qqc_test --build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST} --test-command qqc_test + ) add_test(qmlimportscanner ${CMAKE_CTEST_COMMAND} diff --git a/tests/auto/particles/CMakeLists.txt b/tests/auto/particles/CMakeLists.txt new file mode 100644 index 0000000000..b712210c0a --- /dev/null +++ b/tests/auto/particles/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from particles.pro. + +if(QT_FEATURE_private_tests) + add_subdirectory(qquickage) + add_subdirectory(qquickangleddirection) + add_subdirectory(qquickcumulativedirection) + add_subdirectory(qquickcustomaffector) + add_subdirectory(qquickcustomparticle) + add_subdirectory(qquickellipseextruder) + add_subdirectory(qquickgroupgoal) + add_subdirectory(qquickfriction) + add_subdirectory(qquickgravity) + add_subdirectory(qquickimageparticle) + add_subdirectory(qquickitemparticle) + add_subdirectory(qquicklineextruder) + add_subdirectory(qquickmaskextruder) + add_subdirectory(qquickparticlegroup) + add_subdirectory(qquickparticlesystem) + add_subdirectory(qquickpointattractor) + add_subdirectory(qquickpointdirection) + add_subdirectory(qquickrectangleextruder) + add_subdirectory(qquickspritegoal) + add_subdirectory(qquicktargetdirection) + add_subdirectory(qquicktrailemitter) + add_subdirectory(qquickturbulence) + add_subdirectory(qquickwander) +endif() diff --git a/tests/auto/particles/qquickage/CMakeLists.txt b/tests/auto/particles/qquickage/CMakeLists.txt new file mode 100644 index 0000000000..ef76c37e1e --- /dev/null +++ b/tests/auto/particles/qquickage/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickage.pro. + +##################################################################### +## tst_qquickage 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_qquickage + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickage.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickage CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickage CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickangleddirection/CMakeLists.txt b/tests/auto/particles/qquickangleddirection/CMakeLists.txt new file mode 100644 index 0000000000..7d8d98c948 --- /dev/null +++ b/tests/auto/particles/qquickangleddirection/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickangleddirection.pro. + +##################################################################### +## tst_qquickangleddirection 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_qquickangleddirection + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickangleddirection.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickangleddirection CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickangleddirection CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt b/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt new file mode 100644 index 0000000000..49e4eabcbc --- /dev/null +++ b/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickcumulativedirection.pro. + +##################################################################### +## tst_qquickcumulativedirection 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_qquickcumulativedirection + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickcumulativedirection.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickcumulativedirection CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickcumulativedirection CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickcustomaffector/CMakeLists.txt b/tests/auto/particles/qquickcustomaffector/CMakeLists.txt new file mode 100644 index 0000000000..bf65a1056f --- /dev/null +++ b/tests/auto/particles/qquickcustomaffector/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickcustomaffector.pro. + +##################################################################### +## tst_qquickcustomaffector 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_qquickcustomaffector + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickcustomaffector.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickcustomaffector CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickcustomaffector CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickcustomparticle/CMakeLists.txt b/tests/auto/particles/qquickcustomparticle/CMakeLists.txt new file mode 100644 index 0000000000..c4760a9475 --- /dev/null +++ b/tests/auto/particles/qquickcustomparticle/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickcustomparticle.pro. + +##################################################################### +## tst_qquickcustomparticle 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_qquickcustomparticle + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickcustomparticle.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickcustomparticle CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickcustomparticle CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickellipseextruder/CMakeLists.txt b/tests/auto/particles/qquickellipseextruder/CMakeLists.txt new file mode 100644 index 0000000000..6b56fe027a --- /dev/null +++ b/tests/auto/particles/qquickellipseextruder/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickellipseextruder.pro. + +##################################################################### +## tst_qquickellipseextruder 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_qquickellipseextruder + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickellipseextruder.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickellipseextruder CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickellipseextruder CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickfriction/CMakeLists.txt b/tests/auto/particles/qquickfriction/CMakeLists.txt new file mode 100644 index 0000000000..b72caa7e24 --- /dev/null +++ b/tests/auto/particles/qquickfriction/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickfriction.pro. + +##################################################################### +## tst_qquickfriction 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_qquickfriction + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickfriction.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfriction CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfriction CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickgravity/CMakeLists.txt b/tests/auto/particles/qquickgravity/CMakeLists.txt new file mode 100644 index 0000000000..3c5c294a95 --- /dev/null +++ b/tests/auto/particles/qquickgravity/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickgravity.pro. + +##################################################################### +## tst_qquickgravity 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_qquickgravity + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickgravity.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickgravity CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickgravity CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickgroupgoal/CMakeLists.txt b/tests/auto/particles/qquickgroupgoal/CMakeLists.txt new file mode 100644 index 0000000000..6c8ed8d0d4 --- /dev/null +++ b/tests/auto/particles/qquickgroupgoal/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickgroupgoal.pro. + +##################################################################### +## tst_qquickgroupgoal 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_qquickgroupgoal + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickgroupgoal.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickgroupgoal CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickgroupgoal CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickimageparticle/CMakeLists.txt b/tests/auto/particles/qquickimageparticle/CMakeLists.txt new file mode 100644 index 0000000000..819ea52b6e --- /dev/null +++ b/tests/auto/particles/qquickimageparticle/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickimageparticle.pro. + +##################################################################### +## tst_qquickimageparticle 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_qquickimageparticle + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickimageparticle.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickimageparticle CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickimageparticle CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickitemparticle/CMakeLists.txt b/tests/auto/particles/qquickitemparticle/CMakeLists.txt new file mode 100644 index 0000000000..e13dfc8b3f --- /dev/null +++ b/tests/auto/particles/qquickitemparticle/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickitemparticle.pro. + +##################################################################### +## tst_qquickitemparticle 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_qquickitemparticle + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickitemparticle.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickitemparticle CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickitemparticle CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquicklineextruder/CMakeLists.txt b/tests/auto/particles/qquicklineextruder/CMakeLists.txt new file mode 100644 index 0000000000..b6dc214949 --- /dev/null +++ b/tests/auto/particles/qquicklineextruder/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquicklineextruder.pro. + +##################################################################### +## tst_qquicklineextruder 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_qquicklineextruder + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquicklineextruder.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicklineextruder CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicklineextruder CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickmaskextruder/CMakeLists.txt b/tests/auto/particles/qquickmaskextruder/CMakeLists.txt new file mode 100644 index 0000000000..f85092317e --- /dev/null +++ b/tests/auto/particles/qquickmaskextruder/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickmaskextruder.pro. + +##################################################################### +## tst_qquickmaskextruder 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_qquickmaskextruder + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickmaskextruder.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickmaskextruder CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickmaskextruder CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickparticlegroup/CMakeLists.txt b/tests/auto/particles/qquickparticlegroup/CMakeLists.txt new file mode 100644 index 0000000000..ca5664bc4c --- /dev/null +++ b/tests/auto/particles/qquickparticlegroup/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickparticlegroup.pro. + +##################################################################### +## tst_qquickparticlegroup 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_qquickparticlegroup + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickparticlegroup.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickparticlegroup CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickparticlegroup CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickparticlesystem/CMakeLists.txt b/tests/auto/particles/qquickparticlesystem/CMakeLists.txt new file mode 100644 index 0000000000..20dd7d4ec8 --- /dev/null +++ b/tests/auto/particles/qquickparticlesystem/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickparticlesystem.pro. + +##################################################################### +## tst_qquickparticlesystem 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_qquickparticlesystem + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickparticlesystem.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickparticlesystem CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickparticlesystem CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickpointattractor/CMakeLists.txt b/tests/auto/particles/qquickpointattractor/CMakeLists.txt new file mode 100644 index 0000000000..6f01e7df7e --- /dev/null +++ b/tests/auto/particles/qquickpointattractor/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickpointattractor.pro. + +##################################################################### +## tst_qquickpointattractor 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_qquickpointattractor + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickpointattractor.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpointattractor CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpointattractor CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickpointdirection/CMakeLists.txt b/tests/auto/particles/qquickpointdirection/CMakeLists.txt new file mode 100644 index 0000000000..ee66e0af9f --- /dev/null +++ b/tests/auto/particles/qquickpointdirection/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickpointdirection.pro. + +##################################################################### +## tst_qquickpointdirection 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_qquickpointdirection + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickpointdirection.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpointdirection CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpointdirection CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt b/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt new file mode 100644 index 0000000000..991fa0069a --- /dev/null +++ b/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickrectangleextruder.pro. + +##################################################################### +## tst_qquickrectangleextruder 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_qquickrectangleextruder + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickrectangleextruder.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickrectangleextruder CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickrectangleextruder CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickspritegoal/CMakeLists.txt b/tests/auto/particles/qquickspritegoal/CMakeLists.txt new file mode 100644 index 0000000000..9e7ee863c9 --- /dev/null +++ b/tests/auto/particles/qquickspritegoal/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickspritegoal.pro. + +##################################################################### +## tst_qquickspritegoal 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_qquickspritegoal + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickspritegoal.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickspritegoal CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickspritegoal CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquicktargetdirection/CMakeLists.txt b/tests/auto/particles/qquicktargetdirection/CMakeLists.txt new file mode 100644 index 0000000000..d7cdb68677 --- /dev/null +++ b/tests/auto/particles/qquicktargetdirection/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquicktargetdirection.pro. + +##################################################################### +## tst_qquicktargetdirection 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_qquicktargetdirection + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquicktargetdirection.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktargetdirection CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktargetdirection CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquicktrailemitter/CMakeLists.txt b/tests/auto/particles/qquicktrailemitter/CMakeLists.txt new file mode 100644 index 0000000000..b4852f40eb --- /dev/null +++ b/tests/auto/particles/qquicktrailemitter/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquicktrailemitter.pro. + +##################################################################### +## tst_qquicktrailemitter 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_qquicktrailemitter + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquicktrailemitter.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktrailemitter CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktrailemitter CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickturbulence/CMakeLists.txt b/tests/auto/particles/qquickturbulence/CMakeLists.txt new file mode 100644 index 0000000000..c5ae3db05c --- /dev/null +++ b/tests/auto/particles/qquickturbulence/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickturbulence.pro. + +##################################################################### +## tst_qquickturbulence 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_qquickturbulence + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickturbulence.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickturbulence CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickturbulence CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/particles/qquickwander/CMakeLists.txt b/tests/auto/particles/qquickwander/CMakeLists.txt new file mode 100644 index 0000000000..b6e2f95bc6 --- /dev/null +++ b/tests/auto/particles/qquickwander/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickwander.pro. + +##################################################################### +## tst_qquickwander 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_qquickwander + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickwander.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickParticlesPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickwander CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickwander CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/.prev_CMakeLists.txt b/tests/auto/qml/.prev_CMakeLists.txt new file mode 100644 index 0000000000..3f453e4ded --- /dev/null +++ b/tests/auto/qml/.prev_CMakeLists.txt @@ -0,0 +1,82 @@ +# Generated from qml.pro. + +add_subdirectory(parserstress) +add_subdirectory(qjsvalueiterator) +add_subdirectory(qjsonbinding) +add_subdirectory(qqmlfile) +add_subdirectory(qqmlfileselector) +add_subdirectory(qqmlcomponent) +add_subdirectory(qqmlconsole) +add_subdirectory(qqmlengine) +add_subdirectory(qqmlerror) +add_subdirectory(qqmlincubator) +add_subdirectory(qqmlinfo) +add_subdirectory(qqmllistreference) +add_subdirectory(qqmllocale) +add_subdirectory(qqmlmetaobject) +add_subdirectory(qqmlmoduleplugin) +add_subdirectory(qqmlnotifier) +add_subdirectory(qqmlqt) +add_subdirectory(qqmlxmlhttprequest) +add_subdirectory(qqmlpromise) +add_subdirectory(qtqmlmodules) +add_subdirectory(qquickfolderlistmodel) +add_subdirectory(qqmlapplicationengine) +add_subdirectory(qqmlsettings) +add_subdirectory(qqmlstatemachine) +add_subdirectory(qmldiskcache) +add_subdirectory(qqmlmetatype) +if(QT_FEATURE_process AND QT_FEATURE_qml_debug) + add_subdirectory(debugger) +endif() +if(QT_FEATURE_process AND NOT boot2qt) + add_subdirectory(qmlformat) + add_subdirectory(qmllint) + add_subdirectory(qmlplugindump) +endif() +if(QT_FEATURE_library) + add_subdirectory(qqmlextensionplugin) +endif() +if(QT_FEATURE_private_tests) + add_subdirectory(qqmlcpputils) + add_subdirectory(qqmldirparser) + add_subdirectory(qmlcachegen) + add_subdirectory(animation) + add_subdirectory(qqmlecmascript) + add_subdirectory(qqmlcontext) + add_subdirectory(qqmlexpression) + add_subdirectory(qqmlglobal) + add_subdirectory(qqmllanguage) + add_subdirectory(qqmlopenmetaobject) + add_subdirectory(qqmlproperty) + add_subdirectory(qqmlpropertycache) + add_subdirectory(qqmlpropertymap) + add_subdirectory(qqmlsqldatabase) + add_subdirectory(qqmlvaluetypes) + add_subdirectory(qqmlvaluetypeproviders) + add_subdirectory(qqmlbinding) + add_subdirectory(qqmlchangeset) + add_subdirectory(qqmlconnections) + add_subdirectory(qqmllistcompositor) + add_subdirectory(qqmllistmodel) + add_subdirectory(qqmllistmodelworkerscript) + add_subdirectory(qqmlitemmodels) + add_subdirectory(qqmltypeloader) + add_subdirectory(qqmlparser) + add_subdirectory(qquickworkerscript) + add_subdirectory(qrcqml) + add_subdirectory(qqmltimer) + add_subdirectory(qqmlinstantiator) + add_subdirectory(qqmlenginecleanup) + add_subdirectory(qqmltranslation) + add_subdirectory(qqmlimport) + add_subdirectory(qqmlobjectmodel) + add_subdirectory(qqmltablemodel) + add_subdirectory(qv4assembler) + add_subdirectory(qv4mm) + add_subdirectory(qv4identifiertable) + add_subdirectory(qv4regexp) + add_subdirectory(ecmascripttests) + add_subdirectory(bindingdependencyapi) + add_subdirectory(v4misc) +endif() diff --git a/tests/auto/qml/CMakeLists.txt b/tests/auto/qml/CMakeLists.txt new file mode 100644 index 0000000000..7592f09eba --- /dev/null +++ b/tests/auto/qml/CMakeLists.txt @@ -0,0 +1,88 @@ +# Generated from qml.pro. + +add_subdirectory(parserstress) +add_subdirectory(qjsvalueiterator) +add_subdirectory(qjsonbinding) +add_subdirectory(qqmlfile) +add_subdirectory(qqmlfileselector) +add_subdirectory(qqmlcomponent) +add_subdirectory(qqmlconsole) +add_subdirectory(qqmlengine) +add_subdirectory(qqmlerror) +add_subdirectory(qqmlincubator) +add_subdirectory(qqmlinfo) +add_subdirectory(qqmllistreference) +add_subdirectory(qqmllocale) +add_subdirectory(qqmlmetaobject) +add_subdirectory(qqmlmoduleplugin) +add_subdirectory(qqmlnotifier) +add_subdirectory(qqmlqt) +add_subdirectory(qqmlxmlhttprequest) +add_subdirectory(qqmlpromise) +add_subdirectory(qtqmlmodules) +add_subdirectory(qquickfolderlistmodel) +add_subdirectory(qqmlapplicationengine) +add_subdirectory(qqmlsettings) +add_subdirectory(qqmlstatemachine) +add_subdirectory(qmldiskcache) +add_subdirectory(qqmlmetatype) +if(QT_FEATURE_process AND QT_FEATURE_qml_debug) + add_subdirectory(debugger) +endif() +if(QT_FEATURE_process AND NOT boot2qt) + add_subdirectory(qmlformat) + add_subdirectory(qmllint) + add_subdirectory(qmlplugindump) +endif() +if(QT_FEATURE_library) + add_subdirectory(qqmlextensionplugin) +endif() +if(QT_FEATURE_private_tests) + add_subdirectory(qqmlcpputils) + add_subdirectory(qqmldirparser) + add_subdirectory(qmlcachegen) + add_subdirectory(animation) + add_subdirectory(qqmlecmascript) + add_subdirectory(qqmlcontext) + add_subdirectory(qqmlexpression) + add_subdirectory(qqmlglobal) + add_subdirectory(qqmllanguage) + add_subdirectory(qqmlopenmetaobject) + add_subdirectory(qqmlproperty) + add_subdirectory(qqmlpropertycache) + add_subdirectory(qqmlpropertymap) +# special case begin + if (TARGET Qt::Sql) +# special case end + add_subdirectory(qqmlsqldatabase) +# special case begin + endif() +# special case end + add_subdirectory(qqmlvaluetypes) + add_subdirectory(qqmlvaluetypeproviders) + add_subdirectory(qqmlbinding) + add_subdirectory(qqmlchangeset) + add_subdirectory(qqmlconnections) + add_subdirectory(qqmllistcompositor) + add_subdirectory(qqmllistmodel) + add_subdirectory(qqmllistmodelworkerscript) + add_subdirectory(qqmlitemmodels) + add_subdirectory(qqmltypeloader) + add_subdirectory(qqmlparser) + add_subdirectory(qquickworkerscript) + add_subdirectory(qrcqml) + add_subdirectory(qqmltimer) + add_subdirectory(qqmlinstantiator) + add_subdirectory(qqmlenginecleanup) + add_subdirectory(qqmltranslation) + add_subdirectory(qqmlimport) + add_subdirectory(qqmlobjectmodel) + add_subdirectory(qqmltablemodel) + add_subdirectory(qv4assembler) + add_subdirectory(qv4mm) + add_subdirectory(qv4identifiertable) + add_subdirectory(qv4regexp) + add_subdirectory(ecmascripttests) + add_subdirectory(bindingdependencyapi) + add_subdirectory(v4misc) +endif() diff --git a/tests/auto/qml/animation/CMakeLists.txt b/tests/auto/qml/animation/CMakeLists.txt new file mode 100644 index 0000000000..7337777b9c --- /dev/null +++ b/tests/auto/qml/animation/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from animation.pro. + +add_subdirectory(qabstractanimationjob) +add_subdirectory(qanimationgroupjob) +add_subdirectory(qparallelanimationgroupjob) +add_subdirectory(qpauseanimationjob) +add_subdirectory(qsequentialanimationgroupjob) diff --git a/tests/auto/qml/animation/qabstractanimationjob/CMakeLists.txt b/tests/auto/qml/animation/qabstractanimationjob/CMakeLists.txt new file mode 100644 index 0000000000..638540fab3 --- /dev/null +++ b/tests/auto/qml/animation/qabstractanimationjob/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qabstractanimationjob.pro. + +##################################################################### +## tst_qabstractanimationjob Test: +##################################################################### + +qt_add_test(tst_qabstractanimationjob + SOURCES + tst_qabstractanimationjob.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/animation/qanimationgroupjob/CMakeLists.txt b/tests/auto/qml/animation/qanimationgroupjob/CMakeLists.txt new file mode 100644 index 0000000000..54c1abb691 --- /dev/null +++ b/tests/auto/qml/animation/qanimationgroupjob/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qanimationgroupjob.pro. + +##################################################################### +## tst_qanimationgroupjob Test: +##################################################################### + +qt_add_test(tst_qanimationgroupjob + SOURCES + tst_qanimationgroupjob.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/animation/qparallelanimationgroupjob/CMakeLists.txt b/tests/auto/qml/animation/qparallelanimationgroupjob/CMakeLists.txt new file mode 100644 index 0000000000..ba64d8cf0e --- /dev/null +++ b/tests/auto/qml/animation/qparallelanimationgroupjob/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from qparallelanimationgroupjob.pro. + +##################################################################### +## tst_qparallelanimationgroupjob Test: +##################################################################### + +qt_add_test(tst_qparallelanimationgroupjob + SOURCES + tst_qparallelanimationgroupjob.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp index a8bcadbc84..8c4c461813 100644 --- a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp +++ b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp @@ -432,8 +432,7 @@ void tst_QParallelAnimationGroupJob::deleteChildrenWithRunningGroup() QCOMPARE(group.state(), QAnimationGroupJob::Running); QCOMPARE(anim1->state(), QAnimationGroupJob::Running); - QTest::qWait(80); - QVERIFY(group.currentLoopTime() > 0); + QTRY_VERIFY(group.currentLoopTime() > 0); delete anim1; QVERIFY(!group.firstChild()); diff --git a/tests/auto/qml/animation/qpauseanimationjob/CMakeLists.txt b/tests/auto/qml/animation/qpauseanimationjob/CMakeLists.txt new file mode 100644 index 0000000000..a1d07be77c --- /dev/null +++ b/tests/auto/qml/animation/qpauseanimationjob/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qpauseanimationjob.pro. + +##################################################################### +## tst_qpauseanimationjob Test: +##################################################################### + +qt_add_test(tst_qpauseanimationjob + SOURCES + tst_qpauseanimationjob.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp b/tests/auto/qml/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp index 8f6b6a2ab7..1d644bf9b5 100644 --- a/tests/auto/qml/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp +++ b/tests/auto/qml/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp @@ -32,8 +32,8 @@ #include <QtQml/private/qsequentialanimationgroupjob_p.h> #include <QtQml/private/qparallelanimationgroupjob_p.h> -#ifdef Q_OS_WIN -static const char winTimerError[] = "On windows, consistent timing is not working properly due to bad timer resolution"; +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) +static const char timerError[] = "On some platforms, consistent timing is not working properly due to bad timer resolution"; #endif class TestablePauseAnimation : public QPauseAnimationJob @@ -144,7 +144,7 @@ void tst_QPauseAnimationJob::noTimerUpdates() #ifdef Q_OS_WIN if (animation.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation.state(), QAbstractAnimationJob::Stopped); @@ -152,7 +152,7 @@ void tst_QPauseAnimationJob::noTimerUpdates() #ifdef Q_OS_WIN if (animation.m_updateCurrentTimeCount != expectedLoopCount) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation.m_updateCurrentTimeCount, expectedLoopCount); } @@ -173,25 +173,25 @@ void tst_QPauseAnimationJob::multiplePauseAnimations() #ifdef Q_OS_WIN if (animation.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation.state(), QAbstractAnimationJob::Stopped); #ifdef Q_OS_WIN if (animation2.state() != QAbstractAnimationJob::Running) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation2.state(), QAbstractAnimationJob::Running); #ifdef Q_OS_WIN if (animation.m_updateCurrentTimeCount != 2) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation.m_updateCurrentTimeCount, 2); #ifdef Q_OS_WIN if (animation2.m_updateCurrentTimeCount != 2) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(animation2.m_updateCurrentTimeCount, 2); @@ -388,7 +388,7 @@ void tst_QPauseAnimationJob::multipleSequentialGroups() #ifdef Q_OS_WIN if (group.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); QCOMPARE(group.state(), QAbstractAnimationJob::Stopped); #else QTRY_COMPARE(group.state(), QAbstractAnimationJob::Stopped); @@ -396,31 +396,31 @@ void tst_QPauseAnimationJob::multipleSequentialGroups() #ifdef Q_OS_WIN if (subgroup1.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(subgroup1.state(), QAbstractAnimationJob::Stopped); #ifdef Q_OS_WIN if (subgroup2.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(subgroup2.state(), QAbstractAnimationJob::Stopped); #ifdef Q_OS_WIN if (subgroup3.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(subgroup3.state(), QAbstractAnimationJob::Stopped); #ifdef Q_OS_WIN if (subgroup4.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(subgroup4.state(), QAbstractAnimationJob::Stopped); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) if (pause5.m_updateCurrentTimeCount != 4) - QEXPECT_FAIL("", winTimerError, Abort); + QEXPECT_FAIL("", timerError, Abort); #endif QCOMPARE(pause5.m_updateCurrentTimeCount, 4); } diff --git a/tests/auto/qml/animation/qsequentialanimationgroupjob/CMakeLists.txt b/tests/auto/qml/animation/qsequentialanimationgroupjob/CMakeLists.txt new file mode 100644 index 0000000000..b675121510 --- /dev/null +++ b/tests/auto/qml/animation/qsequentialanimationgroupjob/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qsequentialanimationgroupjob.pro. + +##################################################################### +## tst_qsequentialanimationgroupjob Test: +##################################################################### + +qt_add_test(tst_qsequentialanimationgroupjob + SOURCES + tst_qsequentialanimationgroupjob.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp index 57b0905a8a..add19273d9 100644 --- a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp +++ b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp @@ -1332,6 +1332,8 @@ void tst_QSequentialAnimationGroupJob::stopUncontrolledAnimations() void tst_QSequentialAnimationGroupJob::finishWithUncontrolledAnimation() { + const int targetDuration = 300; + //1st case: //first we test a group with one uncontrolled animation QSequentialAnimationGroupJob group; @@ -1346,7 +1348,7 @@ void tst_QSequentialAnimationGroupJob::finishWithUncontrolledAnimation() QCOMPARE(group.currentLoopTime(), 0); QCOMPARE(notTimeDriven.currentLoopTime(), 0); - QTest::qWait(300); //wait for the end of notTimeDriven + QTest::qWait(targetDuration); //wait for the end of notTimeDriven QTRY_COMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); const int actualDuration = notTimeDriven.currentLoopTime(); QCOMPARE(group.state(), QAnimationGroupJob::Stopped); @@ -1361,10 +1363,15 @@ void tst_QSequentialAnimationGroupJob::finishWithUncontrolledAnimation() StateChangeListener animStateChangedSpy; anim.addAnimationChangeListener(&animStateChangedSpy, QAbstractAnimationJob::StateChange); - group.setCurrentTime(300); + group.setCurrentTime(targetDuration); QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven.currentLoopTime(), actualDuration); - QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimationJob*>(&anim)); + if (actualDuration > targetDuration) { + QCOMPARE(notTimeDriven.currentLoopTime(), targetDuration); + QCOMPARE(group.currentAnimation(), ¬TimeDriven); + } else { + QCOMPARE(notTimeDriven.currentLoopTime(), actualDuration); + QCOMPARE(group.currentAnimation(), &anim); + } //3rd case: //now let's add a perfectly defined animation at the end @@ -1377,13 +1384,13 @@ void tst_QSequentialAnimationGroupJob::finishWithUncontrolledAnimation() QCOMPARE(animStateChangedSpy.count(), 0); - QTest::qWait(300); //wait for the end of notTimeDriven + QTest::qWait(targetDuration); //wait for the end of notTimeDriven QTRY_COMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); QCOMPARE(group.state(), QAnimationGroupJob::Running); QCOMPARE(anim.state(), QAnimationGroupJob::Running); QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimationJob*>(&anim)); QCOMPARE(animStateChangedSpy.count(), 1); - QTest::qWait(300); //wait for the end of anim + QTest::qWait(targetDuration); //wait for the end of anim QTRY_COMPARE(anim.state(), QAnimationGroupJob::Stopped); QCOMPARE(anim.currentLoopTime(), anim.duration()); diff --git a/tests/auto/qml/bindingdependencyapi/CMakeLists.txt b/tests/auto/qml/bindingdependencyapi/CMakeLists.txt new file mode 100644 index 0000000000..60e58bb08f --- /dev/null +++ b/tests/auto/qml/bindingdependencyapi/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from bindingdependencyapi.pro. + +##################################################################### +## tst_bindingdependencyapi 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_bindingdependencyapi + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_bindingdependencyapi.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_bindingdependencyapi CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_bindingdependencyapi CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/CMakeLists.txt b/tests/auto/qml/debugger/CMakeLists.txt new file mode 100644 index 0000000000..871f11820e --- /dev/null +++ b/tests/auto/qml/debugger/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from debugger.pro. + +add_subdirectory(qqmldebugjsserver) +add_subdirectory(qdebugmessageservice) +add_subdirectory(qqmldebugtranslationservice) +add_subdirectory(qqmlenginedebugservice) +add_subdirectory(qqmldebugjs) +add_subdirectory(qqmlinspector) +add_subdirectory(qqmlprofilerservice) +add_subdirectory(qpacketprotocol) +add_subdirectory(qqmlenginedebuginspectorintegrationtest) +add_subdirectory(qqmlenginecontrol) +add_subdirectory(qqmldebuggingenabler) +add_subdirectory(qqmlnativeconnector) +add_subdirectory(qqmldebugprocess) +add_subdirectory(qqmlpreview) +if(QT_FEATURE_private_tests) + add_subdirectory(qqmldebugclient) + add_subdirectory(qqmldebuglocal) + add_subdirectory(qqmldebugservice) + add_subdirectory(qv4debugger) +endif() diff --git a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt new file mode 100644 index 0000000000..bc1d98bfb9 --- /dev/null +++ b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qdebugmessageservice.pro. + +##################################################################### +## tst_qdebugmessageservice 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_qdebugmessageservice + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qdebugmessageservice.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qdebugmessageservice.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qdebugmessageservice CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qdebugmessageservice CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt new file mode 100644 index 0000000000..390cc30d0f --- /dev/null +++ b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from qpacketprotocol.pro. + +##################################################################### +## tst_qpacketprotocol Test: +##################################################################### + +qt_add_test(tst_qpacketprotocol + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qpacketprotocol.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlDebugPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qpacketprotocol CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qpacketprotocol CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt new file mode 100644 index 0000000000..dfdaadb869 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmldebugclient.pro. + +##################################################################### +## tst_qqmldebugclient Test: +##################################################################### + +qt_add_test(tst_qqmldebugclient + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + ../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h + tst_qqmldebugclient.cpp + DEFINES + QT_QML_DEBUG + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldebugclient CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldebugclient CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/CMakeLists.txt new file mode 100644 index 0000000000..8ba39c1d93 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qqmldebuggingenabler.pro. + +add_subdirectory(qqmldebuggingenabler) +add_subdirectory(qqmldebuggingenablerserver) diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt new file mode 100644 index 0000000000..1bdc1ec192 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmldebuggingenabler.pro. + +##################################################################### +## tst_qqmldebuggingenabler Test: +##################################################################### + +qt_add_test(tst_qqmldebuggingenabler + SOURCES + ../../../../shared/util.cpp ../../../../shared/util.h + ../../shared/debugutil.cpp ../../shared/debugutil_p.h + ../../shared/qqmldebugprocess.cpp ../../shared/qqmldebugprocess_p.h + tst_qqmldebuggingenabler.cpp + INCLUDE_DIRECTORIES + ../../../../shared + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlDebugPrivate +) + +#### Keys ignored in scope 1:.:.:qqmldebuggingenabler.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldebuggingenabler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldebuggingenabler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/.prev_CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/.prev_CMakeLists.txt new file mode 100644 index 0000000000..818e639fb5 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/.prev_CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from qqmldebuggingenablerserver.pro. + +##################################################################### +## qqmldebuggingenablerserver Binary: +##################################################################### + +qt_add_executable(qqmldebuggingenablerserver + INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qqmldebuggingenabler" + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../qqmldebuggingenabler" + SOURCES + qqmldebuggingenablerserver.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Test +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/CMakeLists.txt new file mode 100644 index 0000000000..16dfb7b494 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from qqmldebuggingenablerserver.pro. + +##################################################################### +## qqmldebuggingenablerserver Binary: +##################################################################### + +qt_add_executable(qqmldebuggingenablerserver + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../qqmldebuggingenabler" + # special case begin + # Remove INSTALL_DIRECTORY with $$[QT_INSTALL_TESTS] + # as these are invalid + # INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qqmldebuggingenabler" + # special case end + SOURCES + qqmldebuggingenablerserver.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Test +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt new file mode 100644 index 0000000000..11d16879ed --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qqmldebugjs.pro. + +##################################################################### +## tst_qqmldebugjs 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_qqmldebugjs + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmldebugjs.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmldebugjs.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" "data/test.js" "data/timer.qml" "data/exception.qml" "data/oncompleted.qml" "data/loadjsfile.qml" "data/condition.qml" "data/changeBreakpoint.qml" "data/stepAction.qml" "data/breakpointRelocation.qml" "data/createComponent.qml" "data/encodeQmlScope.qml" "data/breakOnAnchor.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldebugjs CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldebugjs CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebugjsserver/.prev_CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjsserver/.prev_CMakeLists.txt new file mode 100644 index 0000000000..7d82431f5d --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugjsserver/.prev_CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from qqmldebugjsserver.pro. + +##################################################################### +## qqmldebugjsserver Binary: +##################################################################### + +qt_add_executable(qqmldebugjsserver + OUTPUT_DIRECTORY "${INSTALL_TESTSDIR}/qqmldebugjsserver" + INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/qqmldebugjsserver" + SOURCES + qqmldebugjsserver.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Test +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebugjsserver/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjsserver/CMakeLists.txt new file mode 100644 index 0000000000..605ad3562e --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugjsserver/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from qqmldebugjsserver.pro. + +##################################################################### +## qqmldebugjsserver Binary: +##################################################################### + +qt_add_executable(qqmldebugjsserver + # special case begin + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + # INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/qqmldebugjsserver" + # special case end + SOURCES + qqmldebugjsserver.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Test +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt new file mode 100644 index 0000000000..2b25248b0b --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmldebuglocal.pro. + +##################################################################### +## tst_qqmldebuglocal Test: +##################################################################### + +qt_add_test(tst_qqmldebuglocal + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + ../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h + tst_qqmldebuglocal.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldebuglocal CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldebuglocal CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebugprocess/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/CMakeLists.txt new file mode 100644 index 0000000000..41482ab37c --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugprocess/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qqmldebugprocess.pro. + +add_subdirectory(qqmldebugprocess) +add_subdirectory(qqmldebugprocessprocess) diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt new file mode 100644 index 0000000000..a98a809c7b --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qqmldebugprocess.pro. + +##################################################################### +## tst_qqmldebugprocess Test: +##################################################################### + +qt_add_test(tst_qqmldebugprocess + SOURCES + ../../shared/qqmldebugprocess.cpp ../../shared/qqmldebugprocess_p.h + tst_qqmldebugprocess.cpp + INCLUDE_DIRECTORIES + ../../shared +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/.prev_CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f5b04b18b5 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/.prev_CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qqmldebugprocessprocess.pro. + +##################################################################### +## qqmldebugprocessprocess Binary: +##################################################################### + +qt_add_executable(qqmldebugprocessprocess + INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qqmldebugprocess" + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../qqmldebugprocess" + SOURCES + qqmldebugprocessprocess.cpp +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/CMakeLists.txt new file mode 100644 index 0000000000..35e602d4f9 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qqmldebugprocessprocess.pro. + +##################################################################### +## qqmldebugprocessprocess Binary: +##################################################################### + +qt_add_executable(qqmldebugprocessprocess + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../qqmldebugprocess" +# special case begin +# Remove INSTALL_DIRECTORY which starts with +# $$[QT_INSTALL_TESTS] +# INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qqmldebugprocess" +# special case end + SOURCES + qqmldebugprocessprocess.cpp +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt new file mode 100644 index 0000000000..93ad4c76a7 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from qqmldebugservice.pro. + +##################################################################### +## tst_qqmldebugservice 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_qqmldebugservice + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + ../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h + tst_qqmldebugservice.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmldebugservice.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldebugservice CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldebugservice CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt new file mode 100644 index 0000000000..7264d7cbe5 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qqmldebugtranslationservice.pro. + +##################################################################### +## tst_qdebugtranslationservice 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_qdebugtranslationservice + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmldebugtranslationservice.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmldebugtranslationservice.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qdebugtranslationservice CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qdebugtranslationservice CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt new file mode 100644 index 0000000000..a998af77cf --- /dev/null +++ b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qqmlenginecontrol.pro. + +##################################################################### +## tst_qqmlenginecontrol 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_qqmlenginecontrol + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlenginecontrol.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlenginecontrol.pro:<TRUE>: +# OTHER_FILES = "data/test.qml" "data/exit.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlenginecontrol CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlenginecontrol CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt new file mode 100644 index 0000000000..f3fb518bfe --- /dev/null +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from qqmlenginedebuginspectorintegrationtest.pro. + +##################################################################### +## tst_qqmlenginedebuginspectorintegration 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_qqmlenginedebuginspectorintegration + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlenginedebuginspectorintegration.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlenginedebuginspectorintegration CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlenginedebuginspectorintegration CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt new file mode 100644 index 0000000000..fa7f15939e --- /dev/null +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qqmlenginedebugservice.pro. + +##################################################################### +## tst_qqmlenginedebugservice Test: +##################################################################### + +qt_add_test(tst_qqmlenginedebugservice + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlenginedebugservice.cpp + DEFINES + QT_QML_DEBUG_NO_WARNING + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlDebugPrivate + Qt::QmlPrivate + Qt::Quick +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlenginedebugservice CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlenginedebugservice CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt new file mode 100644 index 0000000000..4ddb1d436d --- /dev/null +++ b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from qqmlinspector.pro. + +##################################################################### +## tst_qqmlinspector 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_qqmlinspector + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlinspector.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlinspector CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlinspector CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt new file mode 100644 index 0000000000..bbff6a73c5 --- /dev/null +++ b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qqmlnativeconnector.pro. + +##################################################################### +## tst_qqmlnativeconnector Test: +##################################################################### + +qt_add_test(tst_qqmlnativeconnector + SOURCES + tst_qqmlnativeconnector.cpp + DEFINES + QT_QML_DEBUG + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Qml +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt new file mode 100644 index 0000000000..6a509748ba --- /dev/null +++ b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qqmlpreview.pro. + +##################################################################### +## tst_qqmlpreview Test: +##################################################################### + +# Collect test data +list(APPEND test_data "data/window.qml") +list(APPEND test_data "data/qtquick2.qml") +list(APPEND test_data "data/window2.qml") +list(APPEND test_data "data/window1.qml") +list(APPEND test_data "data/broken.qml") +list(APPEND test_data "data/zoom.qml") +list(APPEND test_data "data/i18n/qml_fr_FR.qm") + +qt_add_test(tst_qqmlpreview + SOURCES + ../../../../../src/plugins/qmltooling/qmldbg_preview/qqmlpreviewblacklist.cpp ../../../../../src/plugins/qmltooling/qmldbg_preview/qqmlpreviewblacklist.h + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlpreview.cpp + INCLUDE_DIRECTORIES + ../../../../../src/plugins/qmltooling/qmldbg_preview + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlpreview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlpreview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt new file mode 100644 index 0000000000..2395c84e7d --- /dev/null +++ b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from qqmlprofilerservice.pro. + +##################################################################### +## tst_qqmlprofilerservice 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_qqmlprofilerservice + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../shared/debugutil.cpp ../shared/debugutil_p.h + ../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h + tst_qqmlprofilerservice.cpp + INCLUDE_DIRECTORIES + ../../../shared + ../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::QmlDebugPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlprofilerservice.pro:<TRUE>: +# OTHER_FILES = "data/pixmapCacheTest.qml" "data/controlFromJS.qml" "data/test.qml" "data/exit.qml" "data/scenegraphTest.qml" "data/TestImage_2x2.png" "data/signalSourceLocation.qml" "data/javascript.qml" "data/timer.qml" "data/qstr.qml" "data/memory.qml" "data/batchOverflow.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlprofilerservice CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlprofilerservice CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt new file mode 100644 index 0000000000..8d8aeb396b --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from qv4debugger.pro. + +##################################################################### +## tst_qv4debugger Test: +##################################################################### + +qt_add_test(tst_qv4debugger + SOURCES + ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h + ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4debugger.h + ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp ../../../../../src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.h + tst_qv4debugger.cpp + INCLUDE_DIRECTORIES + ../../../../../src/plugins/qmltooling/qmldbg_debugger + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/ecmascripttests/CMakeLists.txt b/tests/auto/qml/ecmascripttests/CMakeLists.txt new file mode 100644 index 0000000000..06296fd91d --- /dev/null +++ b/tests/auto/qml/ecmascripttests/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from ecmascripttests.pro. + +##################################################################### +## tst_ecmascripttests Test: +##################################################################### + +add_qt_test(tst_ecmascripttests + SOURCES + qjstest/test262runner.cpp qjstest/test262runner.h + tst_ecmascripttests.cpp + DEFINES + SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + PUBLIC_LIBRARIES + Qt::QmlPrivate +) + +#### Keys ignored in scope 2:.:.:testcase.pro:<TRUE>: +# QT_TOOL_ENV = "checkenv" +# checkenv.name = "QTEST_FUNCTION_TIMEOUT" +# checkenv.value = "500000" + +## Scopes: +##################################################################### +add_subdirectory(qjstest) diff --git a/tests/auto/qml/ecmascripttests/qjstest/CMakeLists.txt b/tests/auto/qml/ecmascripttests/qjstest/CMakeLists.txt new file mode 100644 index 0000000000..434c207024 --- /dev/null +++ b/tests/auto/qml/ecmascripttests/qjstest/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from qjstest.pro. + +##################################################################### +## qjstest Tool: +##################################################################### + +qt_add_tool(qjstest + SOURCES + main.cpp + test262runner.cpp test262runner.h + DEFINES + QT_DEPRECATED_WARNINGS + INCLUDE_DIRECTORIES + . + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:qjstest.pro:<TRUE>: +# QMAKE_TARGET_DESCRIPTION = "Javascript" "test" "runner" +# TEMPLATE = "app" diff --git a/tests/auto/qml/ecmascripttests/qjstest/qjstest.pro b/tests/auto/qml/ecmascripttests/qjstest/qjstest.pro index 6dec5f8f23..adead821e4 100644 --- a/tests/auto/qml/ecmascripttests/qjstest/qjstest.pro +++ b/tests/auto/qml/ecmascripttests/qjstest/qjstest.pro @@ -3,6 +3,8 @@ TARGET = qjstest QT += qml-private INCLUDEPATH += . +CONFIG += c++14 + DEFINES += QT_DEPRECATED_WARNINGS HEADERS += test262runner.h diff --git a/tests/auto/qml/ecmascripttests/test262 b/tests/auto/qml/ecmascripttests/test262 -Subproject db73deb3bdede559bb7639bf3d0a07a32a17c6d +Subproject 6b0c42c63c2492bd0a7a96d3179d122b5f71793 diff --git a/tests/auto/qml/ecmascripttests/testcase.pro b/tests/auto/qml/ecmascripttests/testcase.pro index 5bf7ecd696..9405095050 100644 --- a/tests/auto/qml/ecmascripttests/testcase.pro +++ b/tests/auto/qml/ecmascripttests/testcase.pro @@ -6,6 +6,8 @@ SOURCES += tst_ecmascripttests.cpp qjstest/test262runner.cpp HEADERS += qjstest/test262runner.h DEFINES += SRCDIR=\\\"$$PWD\\\" +CONFIG += c++14 + # The ES test suite takes approximately 5 mins to run, on a fairly # vanilla developer machine, so the default watchdog timer kills the # test some of the time. Fix by raising time-out to 400s when diff --git a/tests/auto/qml/parserstress/CMakeLists.txt b/tests/auto/qml/parserstress/CMakeLists.txt new file mode 100644 index 0000000000..e18c6fd8fe --- /dev/null +++ b/tests/auto/qml/parserstress/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from parserstress.pro. + +##################################################################### +## tst_parserstress Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + tests/*) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_parserstress + SOURCES + tst_parserstress.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qjsengine/CMakeLists.txt b/tests/auto/qml/qjsengine/CMakeLists.txt new file mode 100644 index 0000000000..aaff27ee03 --- /dev/null +++ b/tests/auto/qml/qjsengine/CMakeLists.txt @@ -0,0 +1,55 @@ +# Generated from qjsengine.pro. + +##################################################################### +## tst_qjsengine Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + script/*) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_qjsengine + SOURCES + tst_qjsengine.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate + Qt::Widgets + TESTDATA ${test_data} +) + +# Resources: +set(qjsengine_resource_files + "translations/idtranslatable-unicode.qm" + "translations/idtranslatable_la.qm" + "translations/translatable-unicode.qm" + "translations/translatable_la.qm" +) + +qt_add_resource(tst_qjsengine "qjsengine" + PREFIX + "/" + FILES + ${qjsengine_resource_files} +) +set(qmake_immediate_resource_files + "exporterror1.mjs" + "importerror1.mjs" + "modulewithlexicals.mjs" + "testmodule.mjs" +) + +qt_add_resource(tst_qjsengine "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index aeb0303899..8dd0f7b188 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -4763,13 +4763,11 @@ void tst_QJSEngine::mathMinMax() QJSValue result = engine.evaluate("var a = .5; Math.min(1, 2, 3.5 + a, '5')"); QCOMPARE(result.toNumber(), 1.0); - QVERIFY(QJSValuePrivate::getValue(&result) != nullptr); - QVERIFY(QJSValuePrivate::getValue(&result)->isInteger()); + QVERIFY(QV4::Value(QJSValuePrivate::asReturnedValue(&result)).isInteger()); result = engine.evaluate("var a = .5; Math.max('0', 1, 2, 3.5 + a)"); QCOMPARE(result.toNumber(), 4.0); - QVERIFY(QJSValuePrivate::getValue(&result) != nullptr); - QVERIFY(QJSValuePrivate::getValue(&result)->isInteger()); + QVERIFY(QV4::Value(QJSValuePrivate::asReturnedValue(&result)).isInteger()); } void tst_QJSEngine::importModule() diff --git a/tests/auto/qml/qjsonbinding/CMakeLists.txt b/tests/auto/qml/qjsonbinding/CMakeLists.txt new file mode 100644 index 0000000000..d4c3ef3dac --- /dev/null +++ b/tests/auto/qml/qjsonbinding/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qjsonbinding.pro. + +##################################################################### +## tst_qjsonbinding 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_qjsonbinding + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qjsonbinding.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qjsonbinding CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qjsonbinding CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qjsvalue/CMakeLists.txt b/tests/auto/qml/qjsvalue/CMakeLists.txt new file mode 100644 index 0000000000..74789968d3 --- /dev/null +++ b/tests/auto/qml/qjsvalue/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qjsvalue.pro. + +##################################################################### +## tst_qjsvalue Test: +##################################################################### + +qt_add_test(tst_qjsvalue + SOURCES + tst_qjsvalue.cpp tst_qjsvalue.h + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate + Qt::Widgets +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp index 0d0bd2ae7e..85c29957b4 100644 --- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp +++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp @@ -66,7 +66,7 @@ void tst_QJSValue::ctor_undefinedWithEngine() QVERIFY(v.isUndefined()); QCOMPARE(v.isObject(), false); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // undefined is not managed #endif } } @@ -80,7 +80,7 @@ void tst_QJSValue::ctor_nullWithEngine() QCOMPARE(v.isNull(), true); QCOMPARE(v.isObject(), false); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // null is not managed #endif } } @@ -95,7 +95,7 @@ void tst_QJSValue::ctor_boolWithEngine() QCOMPARE(v.isObject(), false); QCOMPARE(v.toBool(), false); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // bool is not managed #endif } } @@ -110,7 +110,7 @@ void tst_QJSValue::ctor_intWithEngine() QCOMPARE(v.isObject(), false); QCOMPARE(v.toNumber(), 1.0); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // int is not managed #endif } } @@ -144,7 +144,7 @@ void tst_QJSValue::ctor_uintWithEngine() QCOMPARE(v.isObject(), false); QCOMPARE(v.toNumber(), 1.0); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // uint is not managed #endif } } @@ -178,7 +178,7 @@ void tst_QJSValue::ctor_floatWithEngine() QCOMPARE(v.isObject(), false); QCOMPARE(v.toNumber(), 1.0); #ifdef QT_DEPRECATED - QCOMPARE(v.engine(), &eng); + QCOMPARE(v.engine(), nullptr); // float is not managed #endif } } @@ -250,14 +250,14 @@ void tst_QJSValue::ctor_copyAndAssignWithEngine() QJSValue v2(v); QCOMPARE(v2.strictlyEquals(v), true); #ifdef QT_DEPRECATED - QCOMPARE(v2.engine(), &eng); + QCOMPARE(v2.engine(), nullptr); // not managed #endif QJSValue v3(v); QCOMPARE(v3.strictlyEquals(v), true); QCOMPARE(v3.strictlyEquals(v2), true); #ifdef QT_DEPRECATED - QCOMPARE(v3.engine(), &eng); + QCOMPARE(v3.engine(), nullptr); // not managed #endif QJSValue v4 = eng.toScriptValue(2.0); @@ -466,6 +466,7 @@ void tst_QJSValue::toString() #ifdef QT_DEPRECATED QVERIFY(!o.engine()); #endif + QEXPECT_FAIL("", "We cannot save and restore objects to/from a data stream", Continue); QCOMPARE(o.toString(), QStringLiteral("[object Object]")); } @@ -480,6 +481,7 @@ void tst_QJSValue::toString() #ifdef QT_DEPRECATED QVERIFY(!o.engine()); #endif + QEXPECT_FAIL("", "We cannot save and restore arrays to/from a data stream", Continue); QCOMPARE(o.toString(), QStringLiteral("1,2,3")); } @@ -1627,10 +1629,15 @@ void tst_QJSValue::getSetProperty_twoEngines() QJSEngine otherEngine; QJSValue otherNum = otherEngine.toScriptValue(123); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setProperty(oof) failed: cannot set value created in a different engine"); object.setProperty("oof", otherNum); - QVERIFY(!object.hasOwnProperty("oof")); - QVERIFY(object.property("oof").isUndefined()); + QVERIFY(object.hasOwnProperty("oof")); // primitive values don't have an engine + QVERIFY(object.property("oof").isNumber()); + + QJSValue otherString = otherEngine.toScriptValue(QString::fromLatin1("nope")); + QTest::ignoreMessage(QtWarningMsg, "QJSValue::setProperty(eek) failed: cannot set value created in a different engine"); + object.setProperty("eek", otherString); + QVERIFY(!object.hasOwnProperty("eek")); // strings are managed + QVERIFY(object.property("eek").isUndefined()); } void tst_QJSValue::getSetProperty_gettersAndSettersThrowErrorJS() @@ -1696,7 +1703,7 @@ void tst_QJSValue::getSetProperty() object.setProperty("foo", strstr); QCOMPARE(object.property("foo").toString(), strstr.toString()); #ifdef QT_DEPRECATED - QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine + QVERIFY(strstr.engine() != &eng); // the value has not been bound to the engine #endif QJSValue numnum = QJSValue(123.0); @@ -1941,10 +1948,15 @@ void tst_QJSValue::call_twoEngines() "cannot call function with thisObject created in " "a different engine"); QVERIFY(fun.callWithInstance(object).isUndefined()); + + // Primitive value doesn't need an engine + QVERIFY(!fun.call(QJSValueList() << eng.toScriptValue(123)).isUndefined()); + QTest::ignoreMessage(QtWarningMsg, "QJSValue::call() failed: " "cannot call function with argument created in " "a different engine"); - QVERIFY(fun.call(QJSValueList() << eng.toScriptValue(123)).isUndefined()); + QVERIFY(fun.call(QJSValueList() << eng.toScriptValue(QString::fromLatin1("string"))) + .isUndefined()); { QJSValue fun = eng.evaluate("Object"); QVERIFY(fun.isCallable()); @@ -2079,10 +2091,15 @@ void tst_QJSValue::construct_twoEngines() QJSEngine engine; QJSEngine otherEngine; QJSValue ctor = engine.evaluate("(function (a, b) { this.foo = 123; })"); + QJSValue arg = otherEngine.toScriptValue(124567); + QVERIFY(!ctor.callAsConstructor(QJSValueList() << arg).isUndefined()); + + QJSValue arg2 = otherEngine.toScriptValue(QString::fromLatin1("string")); QTest::ignoreMessage(QtWarningMsg, "QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine"); - QVERIFY(ctor.callAsConstructor(QJSValueList() << arg).isUndefined()); + QVERIFY(ctor.callAsConstructor(QJSValueList() << arg2).isUndefined()); QTest::ignoreMessage(QtWarningMsg, "QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine"); + QVERIFY(ctor.callAsConstructor(QJSValueList() << arg << otherEngine.newObject()).isUndefined()); } @@ -2588,7 +2605,7 @@ void tst_QJSValue::engineDeleted() delete eng; - QVERIFY(v1.isUndefined()); + QVERIFY(!v1.isUndefined()); // Primitive value is stored inline QVERIFY(v2.isUndefined()); QVERIFY(v3.isUndefined()); QVERIFY(v4.isUndefined()); @@ -2777,6 +2794,7 @@ void tst_QJSValue::jsvalueArrayToSequenceType() QCOMPARE(instanceCount, 0); } +struct QJSValuePrivateAccess : public QJSValuePrivate { using QJSValuePrivate::setRawValue; }; void tst_QJSValue::deleteFromDifferentThread() { #if !QT_CONFIG(thread) @@ -2785,7 +2803,7 @@ void tst_QJSValue::deleteFromDifferentThread() QV4::PersistentValueStorage storage(engine->handle()); QCOMPARE(storage.firstPage, nullptr); QJSValue jsval; - QJSValuePrivate::setRawValue(&jsval, storage.allocate()); + QJSValuePrivateAccess::setRawValue(&jsval, storage.allocate()); QVERIFY(storage.firstPage != nullptr); QMutex mutex; @@ -2794,7 +2812,7 @@ void tst_QJSValue::deleteFromDifferentThread() std::unique_ptr<QThread> thread(QThread::create([&]() { QMutexLocker locker(&mutex); QJSValuePrivate::free(&jsval); - QJSValuePrivate::setRawValue(&jsval, nullptr); + QJSValuePrivate::setValue(&jsval, QV4::Encode::undefined()); QVERIFY(storage.firstPage != nullptr); condition.wakeOne(); })); diff --git a/tests/auto/qml/qjsvalueiterator/CMakeLists.txt b/tests/auto/qml/qjsvalueiterator/CMakeLists.txt new file mode 100644 index 0000000000..48edd77265 --- /dev/null +++ b/tests/auto/qml/qjsvalueiterator/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qjsvalueiterator.pro. + +##################################################################### +## tst_qjsvalueiterator Test: +##################################################################### + +qt_add_test(tst_qjsvalueiterator + SOURCES + tst_qjsvalueiterator.cpp + PUBLIC_LIBRARIES + Qt::Qml +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro index 7a08cc805c..7a2ba10096 100644 --- a/tests/auto/qml/qml.pro +++ b/tests/auto/qml/qml.pro @@ -12,7 +12,6 @@ PUBLICTESTS += \ qqmlfileselector PUBLICTESTS += \ - qmlmin \ qqmlcomponent \ qqmlconsole \ qqmlengine \ diff --git a/tests/auto/qml/qmlcachegen/CMakeLists.txt b/tests/auto/qml/qmlcachegen/CMakeLists.txt new file mode 100644 index 0000000000..e20f276cc1 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/CMakeLists.txt @@ -0,0 +1,124 @@ +# Generated from qmlcachegen.pro. + +##################################################################### +## tst_qmlcachegen 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_qmlcachegen + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qmlcachegen.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_workerscripts_test_resource_files + "data/worker.js" + "data/worker.qml" +) + +qt_add_resource(tst_qmlcachegen "qmake_workerscripts_test" + PREFIX + "/workerscripts" + FILES + ${qmake_workerscripts_test_resource_files} +) +set_source_files_properties("data/trickypaths.qml" + PROPERTIES QT_RESOURCE_ALIAS "file name with spaces.qml" +) +set_source_files_properties("data/versionStyleSuffix-1.2-core-yc.qml" + PROPERTIES QT_RESOURCE_ALIAS "versionStyleSuffix-1.2-core-yc.qml" +) +set_source_files_properties("data/versionStyleSuffix-1.2-more.qml" + PROPERTIES QT_RESOURCE_ALIAS "versionStyleSuffix-1.2-more.qml" +) +set(trickypaths_resource_files + "data/trickypaths.qml" + "data/versionStyleSuffix-1.2-core-yc.qml" + "data/versionStyleSuffix-1.2-more.qml" +) + +qt_add_resource(tst_qmlcachegen "trickypaths" + PREFIX + "/directory with spaces" + FILES + ${trickypaths_resource_files} +) +set_source_files_properties("data/Retain.qml" + PROPERTIES QT_RESOURCE_ALIAS "Retain.qml" +) +set(retain_resource_files + "Retain.qml" +) + +qt_add_resource(tst_qmlcachegen "retain" + PREFIX + "/" + BASE + "data" + FILES + ${retain_resource_files} +) +set(qmake_immediate_resource_files + "data/Enums.qml" + "data/componentInItem.qml" + "data/jsimport.qml" + "data/jsmoduleimport.qml" + "data/library.js" + "data/module.mjs" + "data/parameterAdjustment.qml" + "data/script.js" + "data/script.mjs" + "data/utils.mjs" + "data/versionchecks.qml" +) + +qt_add_resource(tst_qmlcachegen "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### + +if(UNIX) + # Resources: + set_source_files_properties("data/umlaut.qml" + PROPERTIES QT_RESOURCE_ALIAS "Bäh.qml" + ) + set(trickypaths_umlaut_resource_files + "data/umlaut.qml" + ) + + qt_add_resource(tst_qmlcachegen "trickypaths_umlaut" + PREFIX + "/" + FILES + ${trickypaths_umlaut_resource_files} + ) +endif() + +qt_extend_target(tst_qmlcachegen CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qmlcachegen CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qmldiskcache/.prev_CMakeLists.txt b/tests/auto/qml/qmldiskcache/.prev_CMakeLists.txt new file mode 100644 index 0000000000..86bcca1bba --- /dev/null +++ b/tests/auto/qml/qmldiskcache/.prev_CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from qmldiskcache.pro. + +##################################################################### +## tst_qmldiskcache Test: +##################################################################### + +qt_add_test(tst_qmldiskcache + SOURCES + tst_qmldiskcache.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate +) + +# Resources: +set(qmake_immediate_resource_files + "importmodule.qml" + "module.mjs" + "test.qml" +) + +qt_add_resource(tst_qmldiskcache "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qmldiskcache/CMakeLists.txt b/tests/auto/qml/qmldiskcache/CMakeLists.txt new file mode 100644 index 0000000000..b4ff957331 --- /dev/null +++ b/tests/auto/qml/qmldiskcache/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from qmldiskcache.pro. + +##################################################################### +## tst_qmldiskcache Test: +##################################################################### + +qt_add_test(tst_qmldiskcache + SOURCES + tst_qmldiskcache.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate +) + +# special case begin +# Disable quick compiler for this test +set_source_files_properties( + importmodule.qml + module.mjs + test.qml + PROPERTIES + QT_SKIP_QUICKCOMPILER TRUE +) +# special case end + +# Resources: +set(qmake_immediate_resource_files + "importmodule.qml" + "module.mjs" + "test.qml" +) + +qt_add_resource(tst_qmldiskcache "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qmlformat/CMakeLists.txt b/tests/auto/qml/qmlformat/CMakeLists.txt new file mode 100644 index 0000000000..14a8acb5d9 --- /dev/null +++ b/tests/auto/qml/qmlformat/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qmlformat.pro. + +##################################################################### +## tst_qmlformat 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_qmlformat + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qmlformat.cpp + DEFINES + SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qmlformat CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qmlformat CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml b/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml new file mode 100644 index 0000000000..d8e4ffb087 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml @@ -0,0 +1,9 @@ +QtObject { + small1: 3 + small2: foo + // THIS NEEDS TO BE LAST + largeBinding: { + var x = 300; + console.log(x); + } +} diff --git a/tests/auto/qml/qmlformat/data/largeBindings.qml b/tests/auto/qml/qmlformat/data/largeBindings.qml new file mode 100644 index 0000000000..a2249f6815 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/largeBindings.qml @@ -0,0 +1,11 @@ +QtObject +{ + // THIS NEEDS TO BE LAST + largeBinding: { + var x = 300; + console.log(x); + } + + small1: 3 + small2: foo +} diff --git a/tests/auto/qml/qmlformat/data/statesAndTransitions.formatted.qml b/tests/auto/qml/qmlformat/data/statesAndTransitions.formatted.qml new file mode 100644 index 0000000000..bd063ac498 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/statesAndTransitions.formatted.qml @@ -0,0 +1,16 @@ +QtObject { + id: foo + + // This needs to be *before* states and transitions after formatting + Item { + } + + states: [ + State { + } + ] + transitions: [ + Transition { + } + ] +} diff --git a/tests/auto/qml/qmlformat/data/statesAndTransitions.qml b/tests/auto/qml/qmlformat/data/statesAndTransitions.qml new file mode 100644 index 0000000000..648bdce6b9 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/statesAndTransitions.qml @@ -0,0 +1,10 @@ +QtObject { + id: foo + + states: [ State {} ] + transitions: [ Transition {} ] + + // This needs to be *before* states and transitions after formatting + Item {} + +} diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index 47255d7745..21d5ae46a9 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -45,6 +45,8 @@ private Q_SLOTS: void testAnnotationsNoSort(); void testReadOnlyProps(); + void testStatesAndTransitions(); + void testLargeBindings(); #if !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled void testExample(); @@ -200,6 +202,16 @@ void TestQmlformat::testReadOnlyProps() QCOMPARE(runQmlformat(testFile("readOnlyProps.qml"), false, true), readTestFile("readOnlyProps.formatted.qml")); } +void TestQmlformat::testStatesAndTransitions() +{ + QCOMPARE(runQmlformat(testFile("statesAndTransitions.qml"), false, true), readTestFile("statesAndTransitions.formatted.qml")); +} + +void TestQmlformat::testLargeBindings() +{ + QCOMPARE(runQmlformat(testFile("largeBindings.qml"), false, true), readTestFile("largeBindings.formatted.qml")); +} + #if !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled void TestQmlformat::testExample_data() { diff --git a/tests/auto/qml/qmllint/CMakeLists.txt b/tests/auto/qml/qmllint/CMakeLists.txt new file mode 100644 index 0000000000..a66507f625 --- /dev/null +++ b/tests/auto/qml/qmllint/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from qmllint.pro. + +##################################################################### +## tst_qmllint 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_qmllint + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qmllint.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qmllint CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qmllint CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qmlmin/qmlmin.pro b/tests/auto/qml/qmlmin/qmlmin.pro deleted file mode 100644 index 93e5caabcf..0000000000 --- a/tests/auto/qml/qmlmin/qmlmin.pro +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmlmin -QT += qml testlib gui-private -macx:CONFIG -= app_bundle - -SOURCES += tst_qmlmin.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" - -# Boot2qt is cross compiled but it has sources available -!boot2qt { - cross_compile: DEFINES += QTEST_CROSS_COMPILED -} diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp deleted file mode 100644 index 0501a8112a..0000000000 --- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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:GPL-EXCEPT$ -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qtest.h> -#include <QLibraryInfo> -#include <QDir> -#if QT_CONFIG(process) -#include <QProcess> -#endif -#include <QDebug> -#include <QQmlError> -#include <cstdlib> - -class tst_qmlmin : public QObject -{ - Q_OBJECT -public: - tst_qmlmin(); - -private slots: - void initTestCase(); -#if QT_CONFIG(process) && !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled - void qmlMinify_data(); - void qmlMinify(); -#endif - -private: - QString qmlminPath; - QStringList excludedDirs; - QStringList invalidFiles; - - QStringList findFiles(const QDir &); - bool isInvalidFile(const QFileInfo &fileName) const; -}; - -tst_qmlmin::tst_qmlmin() -{ -} - -void tst_qmlmin::initTestCase() -{ -#if QT_CONFIG(process) && !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled - qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin"); -#ifdef Q_OS_WIN - qmlminPath += QLatin1String(".exe"); -#endif - if (!QFileInfo(qmlminPath).exists()) { - QString message = QString::fromLatin1("qmlmin executable not found (looked for %0)") - .arg(qmlminPath); - QFAIL(qPrintable(message)); - } - - // Add directories you want excluded here - - // These snippets are not expected to run on their own. - excludedDirs << "doc/src/snippets/qml/visualdatamodel_rootindex"; - excludedDirs << "doc/src/snippets/qml/qtbinding"; - excludedDirs << "doc/src/snippets/qml/imports"; - excludedDirs << "doc/src/snippets/qtquick1/visualdatamodel_rootindex"; - excludedDirs << "doc/src/snippets/qtquick1/qtbinding"; - excludedDirs << "doc/src/snippets/qtquick1/imports"; - excludedDirs << "tests/manual/v4"; - excludedDirs << "tests/auto/qml/ecmascripttests"; - excludedDirs << "tests/auto/qml/qmllint"; - - // Add invalid files (i.e. files with syntax errors) - invalidFiles << "tests/auto/quick/qquickloader/data/InvalidSourceComponent.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.2.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.3.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.5.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/property.4.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/empty.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/missingObject.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/insertedSemicolon.1.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/nonexistantProperty.5.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/invalidRoot.1.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/invalidQmlEnumValue.1.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/invalidQmlEnumValue.2.qml"; - invalidFiles << "tests/auto/qml/qquickfolderlistmodel/data/dummy.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/qtbug_22843.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/qtbug_22843.library.js"; - invalidFiles << "tests/auto/qml/qquickworkerscript/data/script_error_onLoad.js"; - invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedFileQualifier.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedFileQualifier.2.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedImport.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModule.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedFile.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModuleQualifier.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModuleQualifier.2.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModuleVersion.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingFileQualifier.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleQualifier.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleVersion.js"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.6.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml"; - invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml"; - invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js"; - invalidFiles << "tests/auto/qml/qjsengine/script/com/trolltech/syntaxerror/__init__.js"; - invalidFiles << "tests/auto/qml/debugger/qqmlpreview/data/broken.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/fuzzed.2.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/fuzzed.3.qml"; - invalidFiles << "tests/auto/qml/qqmllanguage/data/requiredProperties.2.qml"; - // generatorFunction.qml is not invalid per se, but the minifier cannot handle yield statements - invalidFiles << "tests/auto/qml/qqmlecmascript/data/generatorFunction.qml"; -#endif -} - -QStringList tst_qmlmin::findFiles(const QDir &d) -{ - for (int ii = 0; ii < excludedDirs.count(); ++ii) { - QString s = excludedDirs.at(ii); - if (d.absolutePath().endsWith(s)) - return QStringList(); - } - - QStringList rv; - - QStringList files = d.entryList(QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), - QDir::Files); - foreach (const QString &file, files) { - rv << d.absoluteFilePath(file); - } - - QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | - QDir::NoSymLinks); - foreach (const QString &dir, dirs) { - QDir sub = d; - sub.cd(dir); - rv << findFiles(sub); - } - - return rv; -} - -bool tst_qmlmin::isInvalidFile(const QFileInfo &fileName) const -{ - foreach (const QString &invalidFile, invalidFiles) { - if (fileName.absoluteFilePath().endsWith(invalidFile)) - return true; - } - return false; -} - -/* -This test runs all the examples in the Qt QML UI source tree and ensures -that they start and exit cleanly. - -Examples are any .qml files under the examples/ directory that start -with a lower case letter. -*/ - -#if QT_CONFIG(process) && !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled -void tst_qmlmin::qmlMinify_data() -{ - QTest::addColumn<QString>("file"); - - QString examples = QLatin1String(SRCDIR) + "/../../../../examples/"; - QString tests = QLatin1String(SRCDIR) + "/../../../../tests/"; - - QStringList files; - files << findFiles(QDir(examples)); - files << findFiles(QDir(tests)); - - foreach (const QString &file, files) - QTest::newRow(qPrintable(file)) << file; -} -#endif - -#if QT_CONFIG(process) && !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled -void tst_qmlmin::qmlMinify() -{ - QFETCH(QString, file); - - QProcess qmlminify; - - // Restrict line width to 100 characters - qmlminify.start(qmlminPath, QStringList() << QLatin1String("--verify-only") << QLatin1String("-w100") << file); - qmlminify.waitForFinished(); - - QCOMPARE(qmlminify.error(), QProcess::UnknownError); - QCOMPARE(qmlminify.exitStatus(), QProcess::NormalExit); - - if (isInvalidFile(file)) - QCOMPARE(qmlminify.exitCode(), EXIT_FAILURE); // cannot minify files with syntax errors - else - QCOMPARE(qmlminify.exitCode(), 0); -} -#endif - -QTEST_MAIN(tst_qmlmin) - -#include "tst_qmlmin.moc" diff --git a/tests/auto/qml/qmlplugindump/CMakeLists.txt b/tests/auto/qml/qmlplugindump/CMakeLists.txt new file mode 100644 index 0000000000..5f806b498b --- /dev/null +++ b/tests/auto/qml/qmlplugindump/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from qmlplugindump.pro. + +##################################################################### +## tst_qmlplugindump Test: +##################################################################### + +add_qt_test(tst_qmlplugindump + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qmlplugindump.cpp + DEFINES + QT_QMLTEST_DIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::GuiPrivate + Qt::Qml +) + +## Scopes: +##################################################################### + +extend_target(tst_qmlplugindump CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +extend_target(tst_qmlplugindump CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) +add_subdirectory(data/dumper/Dummy) +add_subdirectory(data/dumper/Imports) +add_subdirectory(data/dumper/Versions) +add_subdirectory(data/dumper/ExtendedType) diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/.prev_CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/.prev_CMakeLists.txt new file mode 100644 index 0000000000..e8f6a9f7b7 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/.prev_CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from dummy.pro. + +##################################################################### +## Dummy Generic Library: +##################################################################### + +qt_add_cmake_library(Dummy + MODULE + SOURCES + dummy.cpp dummy.h + dummy_plugin.cpp dummy_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:dummy.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:dummy.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Dummy) diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/CMakeLists.txt new file mode 100644 index 0000000000..933b3f152e --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from dummy.pro. + +##################################################################### +## Dummy Generic Library: +##################################################################### + +qt_add_cmake_library(Dummy + MODULE + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + SOURCES + dummy.cpp dummy.h + dummy_plugin.cpp dummy_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:dummy.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:dummy.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Dummy) +# special case begin +get_target_property(binary_dir Dummy BINARY_DIR) +file(COPY qmldir plugins.qmltypes + DESTINATION ${binary_dir} +) +# special case end diff --git a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/.prev_CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/.prev_CMakeLists.txt new file mode 100644 index 0000000000..993c3e19e6 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/.prev_CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from extendedtype.pro. + +##################################################################### +## ExtendedType Generic Library: +##################################################################### + +qt_add_cmake_library(ExtendedType + MODULE + SOURCES + plugin.cpp plugin.h + types.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:extendedtype.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:extendedtype.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(ExtendedType) diff --git a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/CMakeLists.txt new file mode 100644 index 0000000000..9e934eff60 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from extendedtype.pro. + +##################################################################### +## ExtendedType Generic Library: +##################################################################### + +qt_add_cmake_library(ExtendedType + MODULE + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + SOURCES + plugin.cpp plugin.h + types.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:extendedtype.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:extendedtype.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(ExtendedType) +# special case begin +get_target_property(binary_dir ExtendedType BINARY_DIR) +file(COPY qmldir plugins.qmltypes + DESTINATION ${binary_dir} +) +# special case end diff --git a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/plugins.qmltypes index d84eb0011a..5c5ae73ca5 100644 --- a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/plugins.qmltypes +++ b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/plugins.qmltypes @@ -27,9 +27,9 @@ Module { "dumper.ExtendedType/Type 1.0", "dumper.ExtendedType/Type 1.1" ] - exportMetaObjectRevisions: [0, 101] + exportMetaObjectRevisions: [0, 257] Property { name: "baseProperty"; type: "int" } - Property { name: "extendedProperty"; revision: 101; type: "int" } - Property { name: "data"; revision: 101; type: "QObject"; isList: true; isReadonly: true } + Property { name: "extendedProperty"; revision: 257; type: "int" } + Property { name: "data"; revision: 257; type: "QObject"; isList: true; isReadonly: true } } } diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/.prev_CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Imports/.prev_CMakeLists.txt new file mode 100644 index 0000000000..ae80ac867a --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/.prev_CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from imports.pro. + +##################################################################### +## Imports Generic Library: +##################################################################### + +qt_add_cmake_library(Imports + MODULE + SOURCES + imports.cpp imports.h + imports_plugin.cpp imports_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:imports.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:imports.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" "CompositeImports.qml" "Derived.qml" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Imports) diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Imports/CMakeLists.txt new file mode 100644 index 0000000000..cf9871b42e --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from imports.pro. + +##################################################################### +## Imports Generic Library: +##################################################################### + +qt_add_cmake_library(Imports + MODULE + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + SOURCES + imports.cpp imports.h + imports_plugin.cpp imports_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:imports.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:imports.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cp" +# cp.files = "qmldir" "plugins.qmltypes" "CompositeImports.qml" "Derived.qml" +# cp.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Imports) +# special case begin +get_target_property(binary_dir Imports BINARY_DIR) +file(COPY qmldir plugins.qmltypes CompositeImports.qml Derived.qml + DESTINATION ${binary_dir} +) +# special case end diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/.prev_CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Versions/.prev_CMakeLists.txt new file mode 100644 index 0000000000..2edf46a96a --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/.prev_CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from versions.pro. + +##################################################################### +## Versions Generic Library: +##################################################################### + +qt_add_cmake_library(Versions + MODULE + SOURCES + versions.cpp versions.h + versions_plugin.cpp versions_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:versions.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:versions.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cpqmldir" +# cpqmldir.files = "qmldir" "plugins.qmltypes" +# cpqmldir.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Versions) diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/CMakeLists.txt b/tests/auto/qml/qmlplugindump/data/dumper/Versions/CMakeLists.txt new file mode 100644 index 0000000000..950ffda821 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from versions.pro. + +##################################################################### +## Versions Generic Library: +##################################################################### + +qt_add_cmake_library(Versions + MODULE + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + SOURCES + versions.cpp versions.h + versions_plugin.cpp versions_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml +) + +#### Keys ignored in scope 1:.:.:versions.pro:<TRUE>: +# TEMPLATE = "lib" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:versions.pro:NOT _PRO_FILE_PWD____equals____ss_OUT_PWD: +# COPIES = "cpqmldir" +# cpqmldir.files = "qmldir" "plugins.qmltypes" +# cpqmldir.path = "$$OUT_PWD" + +qt_autogen_tools_initial_setup(Versions) +# special case begin +get_target_property(binary_dir Versions BINARY_DIR) +file(COPY qmldir plugins.qmltypes + DESTINATION ${binary_dir} +) +# special case end diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes index 3a33590139..ce003fc535 100644 --- a/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes +++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes @@ -15,9 +15,9 @@ Module { "dumper.Versions/Versions 1.0", "dumper.Versions/Versions 1.1" ] - exportMetaObjectRevisions: [0, 1] + exportMetaObjectRevisions: [0, 65281] Property { name: "foo"; type: "int" } - Property { name: "bar"; revision: 1; type: "int" } - Property { name: "baz"; revision: 2; type: "int" } + Property { name: "bar"; revision: 65281; type: "int" } + Property { name: "baz"; revision: 65282; type: "int" } } } diff --git a/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt b/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt new file mode 100644 index 0000000000..cecbcba683 --- /dev/null +++ b/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt @@ -0,0 +1,56 @@ +# Generated from qqmlapplicationengine.pro. + +##################################################################### +## tst_qqmlapplicationengine Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qqmlapplicationengine + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlapplicationengine.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(tst_qqmlapplicationengine_resource_files + "data/i18n/qml.qm" + "data/loadTranslation.qml" +) + +add_qt_resource(tst_qqmlapplicationengine "tst_qqmlapplicationengine" + PREFIX + "/" + FILES + ${tst_qqmlapplicationengine_resource_files} +) + + +#### Keys ignored in scope 2:.:.:tst_qqmlapplicationengine.pro:<TRUE>: +# TRANSLATIONS = "data/i18n/qml_ja.ts" + +## Scopes: +##################################################################### + +extend_target(tst_qqmlapplicationengine CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +extend_target(tst_qqmlapplicationengine CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) +add_subdirectory(testapp) diff --git a/tests/auto/qml/qqmlapplicationengine/testapp/CMakeLists.txt b/tests/auto/qml/qqmlapplicationengine/testapp/CMakeLists.txt new file mode 100644 index 0000000000..b97251f0b8 --- /dev/null +++ b/tests/auto/qml/qqmlapplicationengine/testapp/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from testapp.pro. + +##################################################################### +## testapp Binary: +##################################################################### + +qt_add_executable(testapp + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml +) + +# Resources: +set(main_resource_files + "delayedExit.qml" + "delayedQuit.qml" + "immediateExit.qml" + "immediateQuit.qml" +) + +qt_add_resource(testapp "main" + PREFIX + "/" + FILES + ${main_resource_files} +) + + +#### Keys ignored in scope 1:.:.:testapp.pro:<TRUE>: +# TEMPLATE = "app" diff --git a/tests/auto/qml/qqmlbinding/CMakeLists.txt b/tests/auto/qml/qqmlbinding/CMakeLists.txt new file mode 100644 index 0000000000..f885560bbe --- /dev/null +++ b/tests/auto/qml/qqmlbinding/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmlbinding.pro. + +##################################################################### +## tst_qqmlbinding 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_qqmlbinding + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlbinding.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlbinding CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlbinding CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlchangeset/CMakeLists.txt b/tests/auto/qml/qqmlchangeset/CMakeLists.txt new file mode 100644 index 0000000000..fafffa2a68 --- /dev/null +++ b/tests/auto/qml/qqmlchangeset/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qqmlchangeset.pro. + +##################################################################### +## tst_qqmlhangeset Test: +##################################################################### + +qt_add_test(tst_qqmlhangeset + SOURCES + tst_qqmlchangeset.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlcomponent/CMakeLists.txt b/tests/auto/qml/qqmlcomponent/CMakeLists.txt new file mode 100644 index 0000000000..e773e58cd2 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/CMakeLists.txt @@ -0,0 +1,54 @@ +# Generated from qqmlcomponent.pro. + +##################################################################### +## tst_qqmlcomponent 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_qqmlcomponent + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qqmlcomponent.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_immediate_resource_files + "data/QtObjectComponent.qml" +) + +qt_add_resource(tst_qqmlcomponent "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlcomponent CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlcomponent CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlconnections/CMakeLists.txt b/tests/auto/qml/qqmlconnections/CMakeLists.txt new file mode 100644 index 0000000000..8f6b9ce87f --- /dev/null +++ b/tests/auto/qml/qqmlconnections/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmlconnections.pro. + +##################################################################### +## tst_qqmlconnections 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_qqmlconnections + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlconnections.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlconnections CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlconnections CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlconsole/CMakeLists.txt b/tests/auto/qml/qqmlconsole/CMakeLists.txt new file mode 100644 index 0000000000..f22fcbc4da --- /dev/null +++ b/tests/auto/qml/qqmlconsole/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qqmlconsole.pro. + +##################################################################### +## tst_qqmlconsole 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_qqmlconsole + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlconsole.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlconsole CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlconsole CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlcontext/CMakeLists.txt b/tests/auto/qml/qqmlcontext/CMakeLists.txt new file mode 100644 index 0000000000..08982b837b --- /dev/null +++ b/tests/auto/qml/qqmlcontext/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlcontext.pro. + +##################################################################### +## tst_qqmlcontext 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_qqmlcontext + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlcontext.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlcontext CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlcontext CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlcpputils/CMakeLists.txt b/tests/auto/qml/qqmlcpputils/CMakeLists.txt new file mode 100644 index 0000000000..ad6febe94f --- /dev/null +++ b/tests/auto/qml/qqmlcpputils/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from qqmlcpputils.pro. + +##################################################################### +## tst_qqmlcpputils Test: +##################################################################### + +qt_add_test(tst_qqmlcpputils + SOURCES + tst_qqmlcpputils.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmldirparser/CMakeLists.txt b/tests/auto/qml/qqmldirparser/CMakeLists.txt new file mode 100644 index 0000000000..36f010d682 --- /dev/null +++ b/tests/auto/qml/qqmldirparser/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qqmldirparser.pro. + +##################################################################### +## tst_qqmldirparser 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_qqmldirparser + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmldirparser.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmldirparser CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmldirparser CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp index 7e96205743..627347df06 100644 --- a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp +++ b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp @@ -94,7 +94,8 @@ namespace { QString toString(const QQmlDirParser::Component &c) { return c.typeName + QLatin1Char('|') + c.fileName + QLatin1Char('|') - + QString::number(c.majorVersion) + QLatin1Char('|') + QString::number(c.minorVersion) + + QString::number(c.version.majorVersion()) + QLatin1Char('|') + + QString::number(c.version.minorVersion()) + QLatin1Char('|') + (c.internal ? "true" : "false"); } @@ -112,7 +113,8 @@ namespace { QString toString(const QQmlDirParser::Script &s) { return s.nameSpace + QLatin1Char('|') + s.fileName + QLatin1Char('|') - + QString::number(s.majorVersion) + '|' + QString::number(s.minorVersion); + + QString::number(s.version.majorVersion()) + '|' + + QString::number(s.version.minorVersion()); } QStringList toStringList(const QList<QQmlDirParser::Script> &scripts) @@ -248,7 +250,7 @@ void tst_qqmldirparser::parse_data() << "unversioned-component/qmldir" << QStringList() << QStringList() - << (QStringList() << "foo|bar|-1|-1|false") + << (QStringList() << "foo|bar|255|255|false") << QStringList() << QStringList() << false; diff --git a/tests/auto/qml/qqmlecmascript/.prev_CMakeLists.txt b/tests/auto/qml/qqmlecmascript/.prev_CMakeLists.txt new file mode 100644 index 0000000000..a30688cfaa --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/.prev_CMakeLists.txt @@ -0,0 +1,62 @@ +# Generated from qqmlecmascript.pro. + +##################################################################### +## tst_qqmlecmascript 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_qqmlecmascript + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmlecmascript.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qqmlecmascript_resource_files + "data/include.js" + "data/include.qml" + "data/js/include2.js" + "data/js/include3.js" +) + +qt_add_resource(tst_qqmlecmascript "qqmlecmascript" + PREFIX + "/" + FILES + ${qqmlecmascript_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlecmascript CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qqmlecmascript CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlecmascript CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlecmascript/CMakeLists.txt b/tests/auto/qml/qqmlecmascript/CMakeLists.txt new file mode 100644 index 0000000000..bf74b8ccba --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/CMakeLists.txt @@ -0,0 +1,69 @@ +# Generated from qqmlecmascript.pro. + +##################################################################### +## tst_qqmlecmascript 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_qqmlecmascript + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmlecmascript.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qqmlecmascript_resource_files + "data/include.js" + "data/include.qml" + "data/js/include2.js" + "data/js/include3.js" +) + +# special case begin +set_source_files_properties( + ${qqmlecmascript_resource_files} + PROPERTIES + QT_SKIP_QUICKCOMPILER 1) +# special case end + +qt_add_resource(tst_qqmlecmascript "qqmlecmascript" + PREFIX + "/" + FILES + ${qqmlecmascript_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlecmascript CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qqmlecmascript CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlecmascript CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 4b0cbfa1aa..cfbc329198 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -1273,44 +1273,36 @@ void tst_qqmlecmascript::enums() // Non-existent enums { QUrl file = testFileUrl("enums.2.qml"); - QString w1 = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'MyEnum' for property 'MyUnregisteredEnumTypeObject::enumProperty'"); QString w2 = QLatin1String("QQmlExpression: Expression ") + testFileUrl("enums.2.qml").toString() + QLatin1String(":9:5 depends on non-NOTIFYable properties:"); QString w3 = QLatin1String(" MyUnregisteredEnumTypeObject::enumProperty"); QString w4 = file.toString() + ":7:5: Unable to assign [undefined] to int"; QString w5 = file.toString() + ":8:5: Unable to assign [undefined] to int"; - QString w6 = file.toString() + ":9:5: Unable to assign [undefined] to int"; - QString w7 = file.toString() + ":13:9: Unable to assign [undefined] to [unknown property type]"; - QString w8 = file.toString() + ":31:9: Unable to assign int to [unknown property type]"; - QTest::ignoreMessage(QtWarningMsg, qPrintable(w1)); + QString w7 = file.toString() + ":13:9: Unable to assign [undefined] to MyUnregisteredEnumTypeObject::MyEnum"; QTest::ignoreMessage(QtWarningMsg, qPrintable(w2)); QTest::ignoreMessage(QtWarningMsg, qPrintable(w3)); QTest::ignoreMessage(QtWarningMsg, qPrintable(w4)); QTest::ignoreMessage(QtWarningMsg, qPrintable(w5)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(w6)); QTest::ignoreMessage(QtWarningMsg, qPrintable(w7)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(w8)); QQmlComponent component(&engine, testFileUrl("enums.2.qml")); QObject *object = component.create(); QVERIFY(object != nullptr); QCOMPARE(object->property("a").toInt(), 0); QCOMPARE(object->property("b").toInt(), 0); - QCOMPARE(object->property("c").toInt(), 0); + QCOMPARE(object->property("c").toInt(), 1); // Change from Qt 5: type gets automatically registered - QString w9 = file.toString() + ":18: Error: Cannot assign JavaScript function to [unknown property type]"; + QString w9 = file.toString() + ":18: Error: Cannot assign JavaScript function to MyUnregisteredEnumTypeObject::MyEnum"; QTest::ignoreMessage(QtWarningMsg, qPrintable(w9)); QMetaObject::invokeMethod(object, "testAssignmentOne"); - QString w10 = file.toString() + ":21: Error: Cannot assign [undefined] to [unknown property type]"; + QString w10 = file.toString() + ":21: Error: Cannot assign [undefined] to MyUnregisteredEnumTypeObject::MyEnum"; QTest::ignoreMessage(QtWarningMsg, qPrintable(w10)); QMetaObject::invokeMethod(object, "testAssignmentTwo"); - QString w11 = file.toString() + ":24: Error: Cannot assign [undefined] to [unknown property type]"; + QString w11 = file.toString() + ":24: Error: Cannot assign [undefined] to MyUnregisteredEnumTypeObject::MyEnum"; QTest::ignoreMessage(QtWarningMsg, qPrintable(w11)); QMetaObject::invokeMethod(object, "testAssignmentThree"); - QString w12 = file.toString() + ":34: Error: Cannot assign int to an unregistered type"; - QTest::ignoreMessage(QtWarningMsg, qPrintable(w12)); QMetaObject::invokeMethod(object, "testAssignmentFour"); delete object; @@ -4036,13 +4028,16 @@ void tst_qqmlecmascript::signalWithJSValueInVariant_twoEngines() object->setProperty("compare", compare); object->setProperty("pass", false); - QTest::ignoreMessage(QtWarningMsg, "JSValue can't be reassigned to another engine."); + const bool isManaged = QJSValuePrivate::asManagedType<QV4::Managed>(&value) != nullptr; + + if (isManaged) + QTest::ignoreMessage(QtWarningMsg, "JSValue can't be reassigned to another engine."); emit object->signalWithVariant(QVariant::fromValue(value)); if (expression == "undefined") // if the engine is wrong, we return undefined to the other engine, // making this one case pass return; - QVERIFY(!object->property("pass").toBool()); + QCOMPARE(object->property("pass").toBool(), !isManaged); } void tst_qqmlecmascript::signalWithQJSValue_data() @@ -4514,9 +4509,9 @@ void tst_qqmlecmascript::importScripts_data() QTest::newRow("missing module version") << testFileUrl("jsimportfail/missingModuleVersion.qml") - << false /* compilation should succeed */ + << true /* compilation should succeed */ << QString() - << (QStringList() << testFileUrl("jsimportfail/missingModuleVersion.js").toString() + QLatin1String(":1:17: Module import requires a version")) + << QStringList() << QStringList() << QVariantList(); @@ -4524,7 +4519,7 @@ void tst_qqmlecmascript::importScripts_data() << testFileUrl("jsimportfail/malformedModuleVersion.qml") << false /* compilation should succeed */ << QString() - << (QStringList() << testFileUrl("jsimportfail/malformedModuleVersion.js").toString() + QLatin1String(":1:17: Module import requires a version")) + << (QStringList() << testFileUrl("jsimportfail/malformedModuleVersion.js").toString() + QLatin1String(":1:17: Module import requires a qualifier")) << QStringList() << QVariantList(); @@ -5771,9 +5766,7 @@ void tst_qqmlecmascript::sequenceConversionRead() QVERIFY(seq != nullptr); // we haven't registered QList<NonRegisteredType> as a sequence type. - QString warningOne = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'QList<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); - QString warningTwo = qmlFile.toString() + QLatin1String(":18: TypeError: Cannot read property 'length' of undefined"); - QTest::ignoreMessage(QtWarningMsg, warningOne.toLatin1().constData()); + QString warningTwo = qmlFile.toString() + QLatin1String(":18: Error: Cannot assign [undefined] to int"); QTest::ignoreMessage(QtWarningMsg, warningTwo.toLatin1().constData()); QMetaObject::invokeMethod(object, "performTest"); @@ -5781,10 +5774,6 @@ void tst_qqmlecmascript::sequenceConversionRead() // QList<NonRegisteredType> has not been registered as a sequence type. QCOMPARE(object->property("pointListLength").toInt(), 0); QVERIFY(!object->property("pointList").isValid()); - QTest::ignoreMessage(QtWarningMsg, "QMetaProperty::read: Unable to handle unregistered datatype 'QList<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); - QQmlProperty seqProp(seq, "typeListProperty", &engine); - QVERIFY(!seqProp.read().isValid()); // not a valid/known sequence type - delete object; } } @@ -5937,7 +5926,7 @@ void tst_qqmlecmascript::sequenceConversionBindings() { QUrl qmlFile = testFileUrl("sequenceConversion.bindings.error.qml"); - QString warning = QString(QLatin1String("%1:17:9: Unable to assign QList<int> to QList<bool>")).arg(qmlFile.toString()); + QString warning = QString(QLatin1String("%1:17:9: Unable to assign QVector<int> to QVector<bool>")).arg(qmlFile.toString()); QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); QQmlComponent component(&engine, qmlFile); QObject *object = component.create(); diff --git a/tests/auto/qml/qqmlengine/CMakeLists.txt b/tests/auto/qml/qqmlengine/CMakeLists.txt new file mode 100644 index 0000000000..f692a1a3a5 --- /dev/null +++ b/tests/auto/qml/qqmlengine/CMakeLists.txt @@ -0,0 +1,58 @@ +# Generated from qqmlengine.pro. + +##################################################################### +## tst_qqmlengine 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_qqmlengine + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlengine.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_immediate_resource_files + "data/qrcurls.js" + "data/qrcurls.qml" +) + +qt_add_resource(tst_qqmlengine "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlengine CONDITION boot2qt + DEFINES + SKIP_GCCORRUPTION_TEST +) + +qt_extend_target(tst_qqmlengine CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlengine CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlengine/data/qtqmlModule.10.qml b/tests/auto/qml/qqmlengine/data/qtqmlModule.10.qml new file mode 100644 index 0000000000..3fc0cc217d --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/qtqmlModule.10.qml @@ -0,0 +1,4 @@ +import QtQml 6.50 + +QtObject { +} diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index cfbbd2a94c..35071997ec 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -687,9 +687,9 @@ void tst_qqmlengine::qtqmlModule_data() << QString(testFileUrl("qtqmlModule.3.qml").toString() + QLatin1String(":1 module \"QtQml\" version 1.0 is not installed\n")) << QStringList(); - QTest::newRow("import QtQml of incorrect version (2.50)") + QTest::newRow("import QtQml of old version (2.50)") << testFileUrl("qtqmlModule.4.qml") - << QString(testFileUrl("qtqmlModule.4.qml").toString() + QLatin1String(":1 module \"QtQml\" version 2.50 is not installed\n")) + << QString() << QStringList(); QTest::newRow("QtQml 2.0 module provides Component, QtObject, Connections, Binding and Timer") @@ -716,6 +716,11 @@ void tst_qqmlengine::qtqmlModule_data() << testFileUrl("qtqmlModule.9.qml") << QString(testFileUrl("qtqmlModule.9.qml").toString() + QLatin1String(":4 Item is not a type\n")) << QStringList(); + + QTest::newRow("import QtQml of incorrect version (6.50)") + << testFileUrl("qtqmlModule.10.qml") + << QString(testFileUrl("qtqmlModule.10.qml").toString() + QLatin1String(":1 module \"QtQml\" version 6.50 is not installed\n")) + << QStringList(); } // Test that the engine registers the QtQml module @@ -847,7 +852,7 @@ void tst_qqmlengine::urlInterceptor() e.addImportPath(testFileUrl("interception/imports").url()); CustomSelector cs(testFileUrl("")); cs.m_interceptionPoints = interceptionPoint; - e.setUrlInterceptor(&cs); + e.addUrlInterceptor(&cs); QQmlComponent c(&e, testFile); //Note that this can get intercepted too QObject *o = c.create(); if (!o) diff --git a/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt b/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt new file mode 100644 index 0000000000..fd45760a35 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from tst_qqmlenginecleanup.pro. + +##################################################################### +## tst_qqmlenginecleanup Test: +##################################################################### + +qt_add_test(tst_qqmlenginecleanup + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlenginecleanup.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlenginecleanup CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlenginecleanup CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/.prev_CMakeLists.txt b/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f16ce3e6c3 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/.prev_CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from CustomModule.pro. + +##################################################################### +## CustomModule Generic Library: +##################################################################### + +qt_add_cmake_library(CustomModule + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../CustomModule" + SOURCES + moduleplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(moduleplugin_resource_files + "ModuleType.qml" +) + +qt_add_resource(CustomModule "moduleplugin" + PREFIX + "/" + FILES + ${moduleplugin_resource_files} +) + + +#### Keys ignored in scope 1:.:.:CustomModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/CMakeLists.txt b/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/CMakeLists.txt new file mode 100644 index 0000000000..f98f97cf81 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/CustomModuleImport/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from CustomModule.pro. + +##################################################################### +## CustomModule Generic Library: +##################################################################### + +qt_add_cmake_library(CustomModule + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../CustomModule" + SOURCES + moduleplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(moduleplugin_resource_files + "ModuleType.qml" +) + +qt_add_resource(CustomModule "moduleplugin" + PREFIX + "/" + FILES + ${moduleplugin_resource_files} +) + + +#### Keys ignored in scope 1:.:.:CustomModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(CustomModule) +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../CustomModule" +) +# special case end diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp index 846ac842db..26b2b839ea 100644 --- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp +++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp @@ -78,7 +78,8 @@ void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations() QUrl testFile = testFileUrl("types.qml"); const auto qmlTypeForTestType = []() { - return QQmlMetaType::qmlType(QStringLiteral("TestTypeCpp"), QStringLiteral("Test"), 2, 0); + return QQmlMetaType::qmlType(QStringLiteral("TestTypeCpp"), QStringLiteral("Test"), + QTypeRevision::fromVersion(2, 0)); }; QVERIFY(!qmlTypeForTestType().isValid()); diff --git a/tests/auto/qml/qqmlerror/CMakeLists.txt b/tests/auto/qml/qqmlerror/CMakeLists.txt new file mode 100644 index 0000000000..c4d218fb8e --- /dev/null +++ b/tests/auto/qml/qqmlerror/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlerror.pro. + +##################################################################### +## tst_qqmlerror 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_qqmlerror + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlerror.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlerror CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlerror CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlexpression/CMakeLists.txt b/tests/auto/qml/qqmlexpression/CMakeLists.txt new file mode 100644 index 0000000000..55f85089bf --- /dev/null +++ b/tests/auto/qml/qqmlexpression/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlexpression.pro. + +##################################################################### +## tst_qqmlexpression 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_qqmlexpression + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlexpression.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlexpression CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlexpression CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlextensionplugin/CMakeLists.txt b/tests/auto/qml/qqmlextensionplugin/CMakeLists.txt new file mode 100644 index 0000000000..d0716ed8ff --- /dev/null +++ b/tests/auto/qml/qqmlextensionplugin/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qqmlextensionplugin.pro. + +##################################################################### +## tst_qqmlextensionplugin Test: +##################################################################### + +qt_add_test(tst_qqmlextensionplugin + SOURCES + tst_qqmlextensionplugin.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlfile/CMakeLists.txt b/tests/auto/qml/qqmlfile/CMakeLists.txt new file mode 100644 index 0000000000..2a0fa63bb8 --- /dev/null +++ b/tests/auto/qml/qqmlfile/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qqmlfile.pro. + +##################################################################### +## tst_qqmlfile Test: +##################################################################### + +qt_add_test(tst_qqmlfile + SOURCES + tst_qqmlfile.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlfileselector/CMakeLists.txt b/tests/auto/qml/qqmlfileselector/CMakeLists.txt new file mode 100644 index 0000000000..34e80921cb --- /dev/null +++ b/tests/auto/qml/qqmlfileselector/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlfileselector.pro. + +##################################################################### +## tst_qqmlfileselector 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_qqmlfileselector + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlfileselector.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlfileselector CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlfileselector CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlglobal/CMakeLists.txt b/tests/auto/qml/qqmlglobal/CMakeLists.txt new file mode 100644 index 0000000000..50ced86ee4 --- /dev/null +++ b/tests/auto/qml/qqmlglobal/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from qqmlglobal.pro. + +##################################################################### +## tst_qqmlglobal Test: +##################################################################### + +qt_add_test(tst_qqmlglobal + SOURCES + tst_qqmlglobal.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlimport/CMakeLists.txt b/tests/auto/qml/qqmlimport/CMakeLists.txt new file mode 100644 index 0000000000..175543232f --- /dev/null +++ b/tests/auto/qml/qqmlimport/CMakeLists.txt @@ -0,0 +1,50 @@ +# Generated from qqmlimport.pro. + +##################################################################### +## tst_qqmlimport Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + MyPluginSupported/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + MyPluginUnsupported/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + FormFromQmlDir/*) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_qqmlimport + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlimport.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate + Qt::Quick + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlimport CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlimport CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp index 9c865b3f73..d5d2b061e9 100644 --- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp +++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp @@ -48,6 +48,8 @@ private slots: void interceptQmldir(); void singletonVersionResolution(); void removeDynamicPlugin(); + void partialImportVersions_data(); + void partialImportVersions(); void cleanup(); }; @@ -162,35 +164,57 @@ void tst_QQmlImport::completeQmldirPaths_data() { QTest::addColumn<QString>("uri"); QTest::addColumn<QStringList>("basePaths"); - QTest::addColumn<int>("majorVersion"); - QTest::addColumn<int>("minorVersion"); + QTest::addColumn<QTypeRevision>("version"); QTest::addColumn<QStringList>("expectedPaths"); - QTest::newRow("QtQml") << "QtQml" << (QStringList() << "qtbase/qml/" << "path/to/qml") << 2 << 7 + QTest::newRow("QtQml") << "QtQml" << (QStringList() << "qtbase/qml/" << "path/to/qml") + << QTypeRevision::fromVersion(2, 7) << (QStringList() << "qtbase/qml/QtQml.2.7/qmldir" << "path/to/qml/QtQml.2.7/qmldir" << "qtbase/qml/QtQml.2/qmldir" << "path/to/qml/QtQml.2/qmldir" << "qtbase/qml/QtQml/qmldir" << "path/to/qml/QtQml/qmldir"); - QTest::newRow("QtQml.Models") << "QtQml.Models" << QStringList("qtbase/qml/") << 2 << 2 + QTest::newRow("QtQml.Models") << "QtQml.Models" << QStringList("qtbase/qml/") + << QTypeRevision::fromVersion(2, 2) << (QStringList() << "qtbase/qml/QtQml/Models.2.2/qmldir" << "qtbase/qml/QtQml.2.2/Models/qmldir" << "qtbase/qml/QtQml/Models.2/qmldir" << "qtbase/qml/QtQml.2/Models/qmldir" << "qtbase/qml/QtQml/Models/qmldir"); - QTest::newRow("org.qt-project.foo.bar") << "org.qt-project.foo.bar" << QStringList("qtbase/qml/") << 0 << 1 - << (QStringList() << "qtbase/qml/org/qt-project/foo/bar.0.1/qmldir" << "qtbase/qml/org/qt-project/foo.0.1/bar/qmldir" << "qtbase/qml/org/qt-project.0.1/foo/bar/qmldir" << "qtbase/qml/org.0.1/qt-project/foo/bar/qmldir" - << "qtbase/qml/org/qt-project/foo/bar.0/qmldir" << "qtbase/qml/org/qt-project/foo.0/bar/qmldir" << "qtbase/qml/org/qt-project.0/foo/bar/qmldir" << "qtbase/qml/org.0/qt-project/foo/bar/qmldir" - << "qtbase/qml/org/qt-project/foo/bar/qmldir"); + QTest::newRow("org.qt-project.foo.bar 0.1") << "org.qt-project.foo.bar" << QStringList("qtbase/qml/") + << QTypeRevision::fromVersion(0, 1) + << (QStringList() + << "qtbase/qml/org/qt-project/foo/bar.0.1/qmldir" + << "qtbase/qml/org/qt-project/foo.0.1/bar/qmldir" + << "qtbase/qml/org/qt-project.0.1/foo/bar/qmldir" + << "qtbase/qml/org.0.1/qt-project/foo/bar/qmldir" + << "qtbase/qml/org/qt-project/foo/bar.0/qmldir" + << "qtbase/qml/org/qt-project/foo.0/bar/qmldir" + << "qtbase/qml/org/qt-project.0/foo/bar/qmldir" + << "qtbase/qml/org.0/qt-project/foo/bar/qmldir" + << "qtbase/qml/org/qt-project/foo/bar/qmldir"); + + QTest::newRow("org.qt-project.foo.bar 4") << "org.qt-project.foo.bar" << QStringList("qtbase/qml/") + << QTypeRevision::fromMajorVersion(4) + << (QStringList() + << "qtbase/qml/org/qt-project/foo/bar.4/qmldir" + << "qtbase/qml/org/qt-project/foo.4/bar/qmldir" + << "qtbase/qml/org/qt-project.4/foo/bar/qmldir" + << "qtbase/qml/org.4/qt-project/foo/bar/qmldir" + << "qtbase/qml/org/qt-project/foo/bar/qmldir"); + + QTest::newRow("org.qt-project.foo.bar") << "org.qt-project.foo.bar" << QStringList("qtbase/qml/") + << QTypeRevision() + << (QStringList() + << "qtbase/qml/org/qt-project/foo/bar/qmldir"); } void tst_QQmlImport::completeQmldirPaths() { QFETCH(QString, uri); QFETCH(QStringList, basePaths); - QFETCH(int, majorVersion); - QFETCH(int, minorVersion); + QFETCH(QTypeRevision, version); QFETCH(QStringList, expectedPaths); - QCOMPARE(QQmlImports::completeQmldirPaths(uri, basePaths, majorVersion, minorVersion), expectedPaths); + QCOMPARE(QQmlImports::completeQmldirPaths(uri, basePaths, version), expectedPaths); } class QmldirUrlInterceptor : public QQmlAbstractUrlInterceptor { @@ -209,7 +233,7 @@ void tst_QQmlImport::interceptQmldir() { QQmlEngine engine; QmldirUrlInterceptor interceptor; - engine.setUrlInterceptor(&interceptor); + engine.addUrlInterceptor(&interceptor); QQmlComponent component(&engine); component.loadUrl(testFileUrl("interceptQmldir.qml")); @@ -281,6 +305,38 @@ void tst_QQmlImport::removeDynamicPlugin() qmlClearTypeRegistrations(); } +void tst_QQmlImport::partialImportVersions_data() +{ + QTest::addColumn<QString>("version"); + QTest::addColumn<bool>("valid"); + + QTest::addRow("empty") << "" << true; + QTest::addRow("2") << "2" << true; + QTest::addRow("6") << "6" << true; + QTest::addRow("2.0") << "2.0" << false; + QTest::addRow("2.3") << "2.3" << true; + QTest::addRow("2.15") << "2.15" << true; + QTest::addRow("6.0") << "6.0" << true; +} + +void tst_QQmlImport::partialImportVersions() +{ + QFETCH(QString, version); + QFETCH(bool, valid); + + QQmlEngine engine; + + QQmlComponent component(&engine); + + component.setData("import QtQml " + version.toUtf8() + "; Connections { enabled: false }", + QUrl()); + QCOMPARE(component.isReady(), valid); + if (valid) { + QScopedPointer<QObject> obj(component.create()); + QVERIFY(!obj.isNull()); + } +} + QTEST_MAIN(tst_QQmlImport) diff --git a/tests/auto/qml/qqmlincubator/CMakeLists.txt b/tests/auto/qml/qqmlincubator/CMakeLists.txt new file mode 100644 index 0000000000..36879eee87 --- /dev/null +++ b/tests/auto/qml/qqmlincubator/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmlincubator.pro. + +##################################################################### +## tst_qqmlincubator 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_qqmlincubator + SOURCES + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmlincubator.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlincubator CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlincubator CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp index 549aae8c2b..6c5416c784 100644 --- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp +++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp @@ -1166,7 +1166,7 @@ void tst_qqmlincubator::garbageCollection() // turn the last strong reference to the incubator into a weak one and collect QV4::WeakValue weakIncubatorRef; - weakIncubatorRef.set(QQmlEnginePrivate::getV4Engine(&engine), *QJSValuePrivate::getValue(&strongRef)); + weakIncubatorRef.set(QQmlEnginePrivate::getV4Engine(&engine), QJSValuePrivate::asReturnedValue(&strongRef)); strongRef = QJSValue(); incubatorVariant.clear(); diff --git a/tests/auto/qml/qqmlinfo/CMakeLists.txt b/tests/auto/qml/qqmlinfo/CMakeLists.txt new file mode 100644 index 0000000000..70ba9cc1ba --- /dev/null +++ b/tests/auto/qml/qqmlinfo/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlinfo.pro. + +##################################################################### +## tst_qqmlinfo 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_qqmlinfo + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlinfo.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlinfo CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlinfo CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlinstantiator/CMakeLists.txt b/tests/auto/qml/qqmlinstantiator/CMakeLists.txt new file mode 100644 index 0000000000..36c496cbf3 --- /dev/null +++ b/tests/auto/qml/qqmlinstantiator/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmlinstantiator.pro. + +##################################################################### +## tst_qqmlinstantiator 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_qqmlinstantiator + SOURCES + ../../shared/util.cpp ../../shared/util.h + stringmodel.h + tst_qqmlinstantiator.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlinstantiator CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlinstantiator CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlitemmodels/CMakeLists.txt b/tests/auto/qml/qqmlitemmodels/CMakeLists.txt new file mode 100644 index 0000000000..e531ac95c4 --- /dev/null +++ b/tests/auto/qml/qqmlitemmodels/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from qqmlitemmodels.pro. + +##################################################################### +## tst_qqmlitemmodels 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_qqmlitemmodels + SOURCES + ../../shared/util.cpp ../../shared/util.h + qtestmodel.h + testtypes.h + tst_qqmlitemmodels.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlitemmodels.pro:<TRUE>: +# DISTFILES = "data/modelindex.qml" "data/persistentmodelindex.qml" "data/itemselectionrange.qml" "data/modelindexlist.qml" "data/itemselection.qml" "data/modelindexconversion.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlitemmodels CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlitemmodels CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlitemmodels/qtestmodel.h b/tests/auto/qml/qqmlitemmodels/qtestmodel.h index 6a022b3135..de42253708 100644 --- a/tests/auto/qml/qqmlitemmodels/qtestmodel.h +++ b/tests/auto/qml/qqmlitemmodels/qtestmodel.h @@ -31,6 +31,8 @@ #include <QtCore/qabstractitemmodel.h> +#include <limits.h> + class TestModel: public QAbstractItemModel { Q_OBJECT diff --git a/tests/auto/qml/qqmllanguage/CMakeLists.txt b/tests/auto/qml/qqmllanguage/CMakeLists.txt new file mode 100644 index 0000000000..568ab7537e --- /dev/null +++ b/tests/auto/qml/qqmllanguage/CMakeLists.txt @@ -0,0 +1,71 @@ +# Generated from qqmllanguage.pro. + +##################################################################### +## tst_qqmllanguage 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_qqmllanguage + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmllanguage.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmllanguage.pro:<TRUE>: +# OTHER_FILES = "data/readonlyObjectProperty.qml" +# QML_IMPORT_NAME = "StaticTest" +# QML_IMPORT_VERSION = "1.0" + +## Scopes: +##################################################################### + +if(ANDROID) + # Resources: + set_source_files_properties("data/I18nType30.qml" + PROPERTIES QT_RESOURCE_ALIAS "data/I18nTypeÁâãäå.qml" + ) + set(qqmllanguage_resource_files + "data/I18nType30.qml" + ) + + qt_add_resource(tst_qqmllanguage "qqmllanguage" + PREFIX + "/" + FILES + ${qqmllanguage_resource_files} + ) +endif() + +qt_extend_target(tst_qqmllanguage CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmllanguage CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) + +set_target_properties(tst_qqmllanguage PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION 1.0 + QT_QML_MODULE_URI StaticTest +) + +qt6_qml_type_registration(tst_qqmllanguage) diff --git a/tests/auto/qml/qqmllanguage/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/qml/qqmllanguage/data/importVersionMissingBuiltIn.errors.txt index c7d880e79e..e69de29bb2 100644 --- a/tests/auto/qml/qqmllanguage/data/importVersionMissingBuiltIn.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/importVersionMissingBuiltIn.errors.txt @@ -1 +0,0 @@ -1:16:Library import requires a version diff --git a/tests/auto/qml/qqmllanguage/data/importVersionMissingInstalled.errors.txt b/tests/auto/qml/qqmllanguage/data/importVersionMissingInstalled.errors.txt index 59b0b87477..9900700753 100644 --- a/tests/auto/qml/qqmllanguage/data/importVersionMissingInstalled.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/importVersionMissingInstalled.errors.txt @@ -1 +1 @@ -1:39:Library import requires a version +1:1:module "org.qtproject.installedtest" is not installed diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 6abcf13b5f..6d932c2665 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -326,6 +326,7 @@ private slots: void listContainingDeletedObject(); void overrideSingleton(); + void revisionedPropertyOfAttachedObjectProperty(); void arrayToContainer(); void qualifiedScopeInCustomParser(); @@ -5440,7 +5441,7 @@ void tst_qqmllanguage::selfReference() const QMetaObject *metaObject = o->metaObject(); QMetaProperty selfProperty = metaObject->property(metaObject->indexOfProperty("self")); - QCOMPARE(selfProperty.userType(), compilationUnit->metaTypeId); + QCOMPARE(selfProperty.userType(), compilationUnit->metaTypeId.id()); QByteArray typeName = selfProperty.typeName(); QVERIFY(typeName.endsWith('*')); @@ -5449,7 +5450,7 @@ void tst_qqmllanguage::selfReference() QMetaMethod selfFunction = metaObject->method(metaObject->indexOfMethod("returnSelf()")); QVERIFY(selfFunction.isValid()); - QCOMPARE(selfFunction.returnType(), compilationUnit->metaTypeId); + QCOMPARE(selfFunction.returnType(), compilationUnit->metaTypeId.id()); QMetaMethod selfSignal; @@ -5463,7 +5464,7 @@ void tst_qqmllanguage::selfReference() QVERIFY(selfSignal.isValid()); QCOMPARE(selfSignal.parameterCount(), 1); - QCOMPARE(selfSignal.parameterType(0), compilationUnit->metaTypeId); + QCOMPARE(selfSignal.parameterType(0), compilationUnit->metaTypeId.id()); } void tst_qqmllanguage::selfReferencingSingleton() @@ -5540,6 +5541,85 @@ void tst_qqmllanguage::overrideSingleton() check("uncreatable", "UncreatableSingleton"); } +class AttachedObject; +class InnerObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool revisionedProperty READ revisionedProperty WRITE setRevisionedProperty + NOTIFY revisionedPropertyChanged REVISION 2) + +public: + InnerObject(QObject *parent = nullptr) : QObject(parent) {} + + bool revisionedProperty() const { return m_revisionedProperty; } + void setRevisionedProperty(bool revisionedProperty) + { + if (revisionedProperty != m_revisionedProperty) { + m_revisionedProperty = revisionedProperty; + emit revisionedPropertyChanged(); + } + } + + static AttachedObject *qmlAttachedProperties(QObject *object); + +signals: + Q_REVISION(2) void revisionedPropertyChanged(); + +private: + bool m_revisionedProperty = false; +}; + +class AttachedObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(InnerObject *attached READ attached CONSTANT) + +public: + explicit AttachedObject(QObject *parent = nullptr) : + QObject(parent), + m_attached(new InnerObject(this)) + {} + + InnerObject *attached() const { return m_attached; } + +private: + InnerObject *m_attached; +}; + +class OuterObject : public QObject +{ + Q_OBJECT +public: + explicit OuterObject(QObject *parent = nullptr) : QObject(parent) {} +}; + +AttachedObject *InnerObject::qmlAttachedProperties(QObject *object) +{ + return new AttachedObject(object); +} + +QML_DECLARE_TYPE(InnerObject) +QML_DECLARE_TYPEINFO(InnerObject, QML_HAS_ATTACHED_PROPERTIES) + +void tst_qqmllanguage::revisionedPropertyOfAttachedObjectProperty() +{ + qmlRegisterAnonymousType<AttachedObject>("foo", 2); + qmlRegisterType<InnerObject>("foo", 2, 0, "InnerObject"); + qmlRegisterType<InnerObject, 2>("foo", 2, 2, "InnerObject"); + qmlRegisterType<OuterObject>("foo", 2, 2, "OuterObject"); + + QQmlEngine engine; + QQmlComponent component(&engine); + component.setData("import foo 2.2\n" + "OuterObject {\n" + " InnerObject.attached.revisionedProperty: true\n" + "}", QUrl()); + + QVERIFY(component.isReady()); + QScopedPointer<QObject> obj(component.create()); + QVERIFY(!obj.isNull()); +} + void tst_qqmllanguage::inlineComponent() { QFETCH(QUrl, componentUrl); diff --git a/tests/auto/qml/qqmllistcompositor/CMakeLists.txt b/tests/auto/qml/qqmllistcompositor/CMakeLists.txt new file mode 100644 index 0000000000..940a41f5cd --- /dev/null +++ b/tests/auto/qml/qqmllistcompositor/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qqmllistcompositor.pro. + +##################################################################### +## tst_qqmllistcompositor Test: +##################################################################### + +qt_add_test(tst_qqmllistcompositor + SOURCES + tst_qqmllistcompositor.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmllistmodel/CMakeLists.txt b/tests/auto/qml/qqmllistmodel/CMakeLists.txt new file mode 100644 index 0000000000..b83e2b3cf1 --- /dev/null +++ b/tests/auto/qml/qqmllistmodel/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmllistmodel.pro. + +##################################################################### +## tst_qqmllistmodel 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_qqmllistmodel + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmllistmodel.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmllistmodel CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmllistmodel CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt b/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt new file mode 100644 index 0000000000..436f38a13b --- /dev/null +++ b/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmllistmodelworkerscript.pro. + +##################################################################### +## tst_qqmllistmodelworkerscript 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_qqmllistmodelworkerscript + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmllistmodelworkerscript.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmllistmodelworkerscript CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmllistmodelworkerscript CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmllistreference/CMakeLists.txt b/tests/auto/qml/qqmllistreference/CMakeLists.txt new file mode 100644 index 0000000000..cb2d91826c --- /dev/null +++ b/tests/auto/qml/qqmllistreference/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmllistreference.pro. + +##################################################################### +## tst_qqmllistreference 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_qqmllistreference + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmllistreference.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmllistreference CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmllistreference CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmllocale/CMakeLists.txt b/tests/auto/qml/qqmllocale/CMakeLists.txt new file mode 100644 index 0000000000..408f4a5c19 --- /dev/null +++ b/tests/auto/qml/qqmllocale/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qqmllocale.pro. + +##################################################################### +## tst_qqmllocale 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_qqmllocale + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmllocale.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmllocale CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmllocale CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlmetaobject/CMakeLists.txt b/tests/auto/qml/qqmlmetaobject/CMakeLists.txt new file mode 100644 index 0000000000..20e8fff759 --- /dev/null +++ b/tests/auto/qml/qqmlmetaobject/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qqmlmetaobject.pro. + +##################################################################### +## tst_qqmlmetaobject 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_qqmlmetaobject + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlmetaobject.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlmetaobject CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlmetaobject CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlmetatype/CMakeLists.txt b/tests/auto/qml/qqmlmetatype/CMakeLists.txt new file mode 100644 index 0000000000..66f2a6586e --- /dev/null +++ b/tests/auto/qml/qqmlmetatype/CMakeLists.txt @@ -0,0 +1,63 @@ +# Generated from qqmlmetatype.pro. + +##################################################################### +## tst_qqmlmetatype 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_qqmlmetatype + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlmetatype.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_qmlfiles_resource_files + "data/CompositeType.qml" +) + +qt_add_resource(tst_qqmlmetatype "qmake_qmlfiles" + PREFIX + "/tstqqmlmetatype" + FILES + ${qmake_qmlfiles_resource_files} +) +set(qmake_qmldirresource_resource_files + "data/Components/App.qml" + "data/Components/qmldir" + "data/enumsInRecursiveImport.qml" +) + +qt_add_resource(tst_qqmlmetatype "qmake_qmldirresource" + PREFIX + "/" + FILES + ${qmake_qmldirresource_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlmetatype CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlmetatype CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp index 296d1b14e0..b69b466947 100644 --- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp +++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp @@ -217,13 +217,14 @@ void tst_qqmlmetatype::qmlPropertyValueInterceptorCast() void tst_qqmlmetatype::qmlType() { - QQmlType type = QQmlMetaType::qmlType(QString("ParserStatusTestType"), QString("Test"), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("ParserStatusTestType"), QString("Test"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(type.module() == QLatin1String("Test")); QVERIFY(type.elementName() == QLatin1String("ParserStatusTestType")); QCOMPARE(type.qmlTypeName(), QLatin1String("Test/ParserStatusTestType")); - type = QQmlMetaType::qmlType("Test/ParserStatusTestType", 1, 0); + type = QQmlMetaType::qmlType("Test/ParserStatusTestType", QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(type.module() == QLatin1String("Test")); QVERIFY(type.elementName() == QLatin1String("ParserStatusTestType")); @@ -282,19 +283,22 @@ void tst_qqmlmetatype::defaultObject() void tst_qqmlmetatype::registrationType() { - QQmlType type = QQmlMetaType::qmlType(QString("TestType"), QString("Test"), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("TestType"), QString("Test"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(!type.isSingleton()); QVERIFY(!type.isComposite()); - type = QQmlMetaType::qmlType(QString("TestTypeSingleton"), QString("Test"), 1, 0); + type = QQmlMetaType::qmlType(QString("TestTypeSingleton"), QString("Test"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(type.isSingleton()); QVERIFY(!type.isComposite()); - type = QQmlMetaType::qmlType(QString("TestTypeComposite"), QString("Test"), 1, 0); + type = QQmlMetaType::qmlType(QString("TestTypeComposite"), QString("Test"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(!type.isSingleton()); @@ -310,7 +314,8 @@ void tst_qqmlmetatype::compositeType() QScopedPointer<QObject> obj(c.create()); QVERIFY(obj); - QQmlType type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(type.module().isEmpty()); QCOMPARE(type.elementName(), QLatin1String("ImplicitType")); @@ -380,70 +385,76 @@ void tst_qqmlmetatype::unregisterCustomType() int controllerId = 0; { QQmlEngine engine; - QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(!type.isValid()); + QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(!type.isValid(), "Type is not valid yet"); controllerId = qmlRegisterType<Controller1>("mytypes", 1, 0, "Controller"); - type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(type.isValid()); - QVERIFY(!type.isInterface()); - QVERIFY(!type.isSingleton()); - QVERIFY(!type.isComposite()); + type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(type.isValid(), "Type is valid now"); + QVERIFY2(!type.isInterface(), "Type is not an interface"); + QVERIFY2(!type.isSingleton(), "Type is not a singleton"); + QVERIFY2(!type.isComposite(), "Types is not a composite type"); QQmlComponent c(&engine, testFileUrl("testUnregisterCustomType.qml")); QScopedPointer<QObject> obj(c.create()); - QVERIFY(obj); + QVERIFY2(obj, "obj is not null"); QObject *controller = obj->findChild<QObject *>("controller"); - QVERIFY(qobject_cast<Controller1 *>(controller)); + QVERIFY2(qobject_cast<Controller1 *>(controller), "child 'controller' could be found and is a Controller1*"); QVariant stringVal = controller->property("string"); QCOMPARE(stringVal.userType(), QVariant::String); QCOMPARE(stringVal.toString(), QStringLiteral("Controller #1")); QVariant enumVal = controller->property("enumVal"); - QCOMPARE(enumVal.userType(), QVariant::Int); + QVERIFY2(QMetaType(enumVal.userType()).flags() & QMetaType::IsEnumeration, "enumVal's type is enumeratoion"); QCOMPARE(enumVal.toInt(), 1); } QQmlMetaType::unregisterType(controllerId); { QQmlEngine engine; - QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(!type.isValid()); + QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(!type.isValid(), "Type is not valid anymore"); controllerId = qmlRegisterType<Controller2>("mytypes", 1, 0, "Controller"); - type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(type.isValid()); - QVERIFY(!type.isInterface()); - QVERIFY(!type.isSingleton()); - QVERIFY(!type.isComposite()); + type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(type.isValid(), "Type is valid again"); + QVERIFY2(!type.isInterface(), "Type is not an interface"); + QVERIFY2(!type.isSingleton(), "Type is not a singleton"); + QVERIFY2(!type.isComposite(), "Type is not a composite"); QQmlComponent c(&engine, testFileUrl("testUnregisterCustomType.qml")); QScopedPointer<QObject> obj(c.create()); - QVERIFY(obj); + QVERIFY2(obj, "obj is not null"); QObject *controller = obj->findChild<QObject *>("controller"); - QVERIFY(qobject_cast<Controller2 *>(controller)); + QVERIFY2(qobject_cast<Controller2 *>(controller), "child 'controller' could be found and is a Controller2*"); QVariant stringVal = controller->property("string"); QCOMPARE(stringVal.userType(), QVariant::String); QCOMPARE(stringVal.toString(), QStringLiteral("Controller #2")); QVariant enumVal = controller->property("enumVal"); - QCOMPARE(enumVal.userType(), QVariant::Int); + QVERIFY2(QMetaType(enumVal.userType()).flags() & QMetaType::IsEnumeration, "enumVal's type is enumeratoion"); QCOMPARE(enumVal.toInt(), 111); } QQmlMetaType::unregisterType(controllerId); { QQmlEngine engine; - QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(!type.isValid()); + QQmlType type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(!type.isValid(), "Type is not valid anymore"); controllerId = qmlRegisterType<Controller1>("mytypes", 1, 0, "Controller"); - type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), 1, 0); - QVERIFY(type.isValid()); - QVERIFY(!type.isInterface()); - QVERIFY(!type.isSingleton()); - QVERIFY(!type.isComposite()); + type = QQmlMetaType::qmlType(QString("Controller"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); + QVERIFY2(type.isValid(), "Type is valid again"); + QVERIFY2(!type.isInterface(), "Type is not an interface"); + QVERIFY2(!type.isSingleton(), "Type is not a singleton"); + QVERIFY2(!type.isComposite(), "Type is not a composite"); QQmlComponent c(&engine, testFileUrl("testUnregisterCustomType.qml")); QScopedPointer<QObject> obj(c.create()); - QVERIFY(obj); + QVERIFY2(obj, "obj is not null"); QObject *controller = obj->findChild<QObject *>("controller"); - QVERIFY(qobject_cast<Controller1 *>(controller)); + QVERIFY2(qobject_cast<Controller1 *>(controller), "child 'controller' could be found and is a Controller1*"); QVariant stringVal = controller->property("string"); QCOMPARE(stringVal.userType(), QVariant::String); QCOMPARE(stringVal.toString(), QStringLiteral("Controller #1")); QVariant enumVal = controller->property("enumVal"); - QCOMPARE(enumVal.userType(), QVariant::Int); + QVERIFY2(QMetaType(enumVal.userType()).flags() & QMetaType::IsEnumeration, "enumVal's type is enumeratoion"); QCOMPARE(enumVal.toInt(), 1); } } @@ -480,7 +491,8 @@ void tst_qqmlmetatype::unregisterCustomSingletonType() { QQmlEngine engine; staticProviderId = qmlRegisterSingletonType<StaticProvider1>("mytypes", 1, 0, "StaticProvider", createStaticProvider1); - QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(type.isSingleton()); @@ -496,7 +508,8 @@ void tst_qqmlmetatype::unregisterCustomSingletonType() { QQmlEngine engine; staticProviderId = qmlRegisterSingletonType<StaticProvider2>("mytypes", 1, 0, "StaticProvider", createStaticProvider2); - QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(type.isSingleton()); @@ -512,7 +525,8 @@ void tst_qqmlmetatype::unregisterCustomSingletonType() { QQmlEngine engine; staticProviderId = qmlRegisterSingletonType<StaticProvider1>("mytypes", 1, 0, "StaticProvider", createStaticProvider1); - QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), 1, 0); + QQmlType type = QQmlMetaType::qmlType(QString("StaticProvider"), QString("mytypes"), + QTypeRevision::fromVersion(1, 0)); QVERIFY(type.isValid()); QVERIFY(!type.isInterface()); QVERIFY(type.isSingleton()); @@ -548,7 +562,8 @@ void tst_qqmlmetatype::unregisterAttachedProperties() QQmlComponent c(&e); c.setData("import QtQuick 2.2\n Item { }", dummy); - const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation", 2, 2); + const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation", + QTypeRevision::fromVersion(2, 2)); QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)), attachedType.metaObject()); @@ -568,7 +583,8 @@ void tst_qqmlmetatype::unregisterAttachedProperties() "import QtQuick 2.2 \n" "Item { KeyNavigation.up: null }", dummy); - const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation", 2, 2); + const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation", + QTypeRevision::fromVersion(2, 2)); QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)), attachedType.metaObject()); diff --git a/tests/auto/qml/qqmlmoduleplugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..d7665ece5e --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/.prev_CMakeLists.txt @@ -0,0 +1,91 @@ +# Generated from qqmlmoduleplugin.pro. + +##################################################################### +## tst_qqmlmoduleplugin Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + imports/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/imports/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qqmlmoduleplugin + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qqmlmoduleplugin.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_waitingPlugin_resource_files + "moduleWithWaitingPlugin" +) + +add_qt_resource(tst_qqmlmoduleplugin "qmake_waitingPlugin" + PREFIX + "/qt-project.org/imports/" + FILES + ${qmake_waitingPlugin_resource_files} +) +set(qmake_staticPlugin_resource_files + "moduleWithStaticPlugin" +) + +add_qt_resource(tst_qqmlmoduleplugin "qmake_staticPlugin" + PREFIX + "/qt-project.org/imports/" + FILES + ${qmake_staticPlugin_resource_files} +) + + +## Scopes: +##################################################################### + +extend_target(tst_qqmlmoduleplugin CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +extend_target(tst_qqmlmoduleplugin CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) +add_subdirectory(plugin) +add_subdirectory(plugin.2) +add_subdirectory(plugin.2.1) +add_subdirectory(pluginWrongCase) +add_subdirectory(pluginWithQmlFile) +add_subdirectory(pluginMixed) +add_subdirectory(pluginVersion) +add_subdirectory(nestedPlugin) +add_subdirectory(strictModule) +add_subdirectory(strictModule.2) +add_subdirectory(nonstrictModule) +add_subdirectory(preemptiveModule) +add_subdirectory(preemptedStrictModule) +add_subdirectory(invalidNamespaceModule) +add_subdirectory(invalidFirstCommandModule) +add_subdirectory(protectedModule) +add_subdirectory(plugin/childplugin) +add_subdirectory(plugin.2/childplugin) +add_subdirectory(plugin.2.1/childplugin) +add_subdirectory(plugin.2.2) +add_subdirectory(moduleWithQmlSingleton) diff --git a/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt new file mode 100644 index 0000000000..111fdafb88 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt @@ -0,0 +1,109 @@ +# Generated from qqmlmoduleplugin.pro. + +##################################################################### +## tst_qqmlmoduleplugin Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + imports/*) +list(APPEND test_data ${test_data_glob}) +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/imports/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qqmlmoduleplugin + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qqmlmoduleplugin.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(qmake_waitingPlugin_resource_files + "moduleWithWaitingPlugin" +) + +add_qt_resource(tst_qqmlmoduleplugin "qmake_waitingPlugin" + PREFIX + "/qt-project.org/imports/" + FILES + ${qmake_waitingPlugin_resource_files} +) +set(qmake_staticPlugin_resource_files + "moduleWithStaticPlugin" +) + +add_qt_resource(tst_qqmlmoduleplugin "qmake_staticPlugin" + PREFIX + "/qt-project.org/imports/" + FILES + ${qmake_staticPlugin_resource_files} +) + + +#### Keys ignored in scope 2:.:.:tst_qqmlmoduleplugin.pro:<TRUE>: +# CONFIG = "testcase" "-app_bundle" +# staticPlugin.files = "moduleWithStaticPlugin" +# staticPlugin.prefix = "/qt-project.org/imports/" +# waitingPlugin.files = "moduleWithWaitingPlugin" +# waitingPlugin.prefix = "/qt-project.org/imports/" + +# special case begin +add_qt_resource(tst_qqmlmoduleplugin waitingPlugin + PREFIX /qt-project.org/imports + FILES moduleWithWaitingPlugin/qmldir +) +add_qt_resource(tst_qqmlmoduleplugin staticPlugin + PREFIX /qt-project.org/imports + FILES moduleWithStaticPlugin/qmldir +) +# special case end + +## Scopes: +##################################################################### + +extend_target(tst_qqmlmoduleplugin CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +extend_target(tst_qqmlmoduleplugin CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) +add_subdirectory(plugin) +add_subdirectory(plugin.2) +add_subdirectory(plugin.2.1) +add_subdirectory(pluginWrongCase) +add_subdirectory(pluginWithQmlFile) +add_subdirectory(pluginMixed) +add_subdirectory(pluginVersion) +add_subdirectory(nestedPlugin) +add_subdirectory(strictModule) +add_subdirectory(strictModule.2) +add_subdirectory(nonstrictModule) +add_subdirectory(preemptiveModule) +add_subdirectory(preemptedStrictModule) +add_subdirectory(invalidNamespaceModule) +add_subdirectory(invalidFirstCommandModule) +add_subdirectory(protectedModule) +add_subdirectory(plugin/childplugin) +add_subdirectory(plugin.2/childplugin) +add_subdirectory(plugin.2.1/childplugin) +add_subdirectory(plugin.2.2) +add_subdirectory(moduleWithQmlSingleton) diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml index b13b2004c2..ba6bb3d7ac 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.5 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml index 563c0b28e3..f1268075c1 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.0 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..d337235cd8 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from invalidFirstCommandModule.pro. + +##################################################################### +## invalidFirstCommandModule Generic Library: +##################################################################### + +qt_add_cmake_library(invalidFirstCommandModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidFirstCommandModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:invalidFirstCommandModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(invalidFirstCommandModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/CMakeLists.txt new file mode 100644 index 0000000000..c580c9d517 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from invalidFirstCommandModule.pro. + +##################################################################### +## invalidFirstCommandModule Generic Library: +##################################################################### + +qt_add_cmake_library(invalidFirstCommandModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidFirstCommandModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:invalidFirstCommandModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(invalidFirstCommandModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidFirstCommandModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..9c762abc48 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from invalidNamespaceModule.pro. + +##################################################################### +## invalidNamespaceModule Generic Library: +##################################################################### + +qt_add_cmake_library(invalidNamespaceModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidNamespaceModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:invalidNamespaceModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(invalidNamespaceModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/CMakeLists.txt new file mode 100644 index 0000000000..a223ecffbf --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from invalidNamespaceModule.pro. + +##################################################################### +## invalidNamespaceModule Generic Library: +##################################################################### + +qt_add_cmake_library(invalidNamespaceModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidNamespaceModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:invalidNamespaceModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(invalidNamespaceModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/InvalidNamespaceModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f420295e84 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/.prev_CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from moduleWithQmlSingleton.pro. + +##################################################################### +## moduleWithQmlSingleton Generic Library: +##################################################################### + +qt_add_cmake_library(moduleWithQmlSingleton + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ModuleWithQmlSingleton" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:moduleWithQmlSingleton.pro:<TRUE>: +# COPIES = "importfiles" "subfiles" +# IMPORT_FILES = "qmldir" "MySingleton.qml" "MySingleton2.qml" +# TEMPLATE = "lib" +# subfiles.files = "internal/InternalType.qml" +# subfiles.path = "$$DESTDIR/internal" + +qt_autogen_tools_initial_setup(moduleWithQmlSingleton) diff --git a/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/CMakeLists.txt new file mode 100644 index 0000000000..e0f8f3043a --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from moduleWithQmlSingleton.pro. + +##################################################################### +## moduleWithQmlSingleton Generic Library: +##################################################################### + +qt_add_cmake_library(moduleWithQmlSingleton + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ModuleWithQmlSingleton" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:moduleWithQmlSingleton.pro:<TRUE>: +# COPIES = "importfiles" "subfiles" +# IMPORT_FILES = "qmldir" "MySingleton.qml" "MySingleton2.qml" +# TEMPLATE = "lib" +# subfiles.files = "internal/InternalType.qml" +# subfiles.path = "$$DESTDIR/internal" + +# special case begin +file(COPY qmldir MySingleton.qml MySingleton2.qml + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ModuleWithQmlSingleton" +) +# special case end + +qt_autogen_tools_initial_setup(moduleWithQmlSingleton) diff --git a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..8a5bfaab59 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/.prev_CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from nestedPlugin.pro. + +##################################################################### +## nestedPlugin Generic Library: +##################################################################### + +qt_add_cmake_library(nestedPlugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlNestedPluginType" + SOURCES + nestedPlugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:nestedPlugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/CMakeLists.txt new file mode 100644 index 0000000000..abaf01573a --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from nestedPlugin.pro. + +##################################################################### +## nestedPlugin Generic Library: +##################################################################### + +qt_add_cmake_library(nestedPlugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlNestedPluginType" + SOURCES + nestedPlugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:nestedPlugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(nestedPlugin) +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlNestedPluginType" +) +# special case end TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..fd9a4a9038 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from nonstrictModule.pro. + +##################################################################### +## nonstrictModule Generic Library: +##################################################################### + +qt_add_cmake_library(nonstrictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/NonstrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:nonstrictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(nonstrictModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/CMakeLists.txt new file mode 100644 index 0000000000..c871907e01 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from nonstrictModule.pro. + +##################################################################### +## nonstrictModule Generic Library: +##################################################################### + +qt_add_cmake_library(nonstrictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/NonstrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:nonstrictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(nonstrictModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/NonstrictModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/.prev_CMakeLists.txt new file mode 100644 index 0000000000..8bb52a6323 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from plugin.2.1.pro. + +##################################################################### +## plugin.2.1 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2.1 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.1" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.1.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2.1) diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/CMakeLists.txt new file mode 100644 index 0000000000..9d1f1c1ca8 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from plugin.2.1.pro. + +##################################################################### +## plugin.2.1 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2.1 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.1" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.1.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2.1) +# special case begin +set_target_properties(plugin.2.1 PROPERTIES OUTPUT_NAME "plugin") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.1" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..d945c031cb --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/.prev_CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2.1/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/CMakeLists.txt new file mode 100644 index 0000000000..95a9153499 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin.2.1 # special case + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2.1/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(childplugin.2.1) +set_target_properties(childplugin.2.1 PROPERTIES OUTPUT_NAME "childplugin") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2.1/ChildPlugin" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/.prev_CMakeLists.txt new file mode 100644 index 0000000000..b4af645c81 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from plugin.2.2.pro. + +##################################################################### +## plugin.2.2 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2.2) diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/CMakeLists.txt new file mode 100644 index 0000000000..e2b36e8f09 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from plugin.2.2.pro. + +##################################################################### +## plugin.2.2 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2.2) +# special case begin +set_target_properties(plugin.2.2 PROPERTIES OUTPUT_NAME "plugin") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2.2" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2/.prev_CMakeLists.txt new file mode 100644 index 0000000000..1cbd74d97a --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from plugin.2.pro. + +##################################################################### +## plugin.2 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2) diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2/CMakeLists.txt new file mode 100644 index 0000000000..0a546866de --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from plugin.2.pro. + +##################################################################### +## plugin.2 Generic Library: +##################################################################### + +qt_add_cmake_library(plugin.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin.2) +# special case begin +set_target_properties(plugin.2 PROPERTIES OUTPUT_NAME "plugin") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType.2" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..036b2237a5 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_DIR = "DESTDIR" +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/CMakeLists.txt new file mode 100644 index 0000000000..aeab9f84fa --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin.2 # special case + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_DIR = "DESTDIR" +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(childplugin.2) +set_target_properties(childplugin.2 PROPERTIES OUTPUT_NAME "childplugin") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType.2/ChildPlugin" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..4de3788caa --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from plugin.pro. + +##################################################################### +## plugin Generic Library: +##################################################################### + +qt_add_cmake_library(plugin + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin) diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin/CMakeLists.txt new file mode 100644 index 0000000000..50e30ecf09 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from plugin.pro. + +##################################################################### +## plugin Generic Library: +##################################################################### + +qt_add_cmake_library(plugin + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:plugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(plugin) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlPluginType" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/.prev_CMakeLists.txt new file mode 100644 index 0000000000..e137159431 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/.prev_CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/CMakeLists.txt new file mode 100644 index 0000000000..bc7d85029a --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from childplugin.pro. + +##################################################################### +## childplugin Generic Library: +##################################################################### + +qt_add_cmake_library(childplugin + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType/ChildPlugin" + SOURCES + childplugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:childplugin.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(childplugin) +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../../imports/org/qtproject/AutoTestQmlPluginType/ChildPlugin" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginMixed/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginMixed/.prev_CMakeLists.txt new file mode 100644 index 0000000000..0d27da3434 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginMixed/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from pluginMixed.pro. + +##################################################################### +## pluginMixed Generic Library: +##################################################################### + +qt_add_cmake_library(pluginMixed + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlMixedPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginMixed.pro:<TRUE>: +# IMPORT_FILES = "Foo.qml" "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginMixed) diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginMixed/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginMixed/CMakeLists.txt new file mode 100644 index 0000000000..967868a674 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginMixed/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from pluginMixed.pro. + +##################################################################### +## pluginMixed Generic Library: +##################################################################### + +qt_add_cmake_library(pluginMixed + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlMixedPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginMixed.pro:<TRUE>: +# IMPORT_FILES = "Foo.qml" "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginMixed) +# special case begin +file(COPY qmldir Foo.qml + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlMixedPluginType" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginVersion/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginVersion/.prev_CMakeLists.txt new file mode 100644 index 0000000000..278d100ed9 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginVersion/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from pluginVersion.pro. + +##################################################################### +## pluginVersion Generic Library: +##################################################################### + +qt_add_cmake_library(pluginVersion + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlVersionPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginVersion.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginVersion) diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginVersion/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginVersion/CMakeLists.txt new file mode 100644 index 0000000000..7e58ea3b18 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginVersion/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from pluginVersion.pro. + +##################################################################### +## pluginVersion Generic Library: +##################################################################### + +qt_add_cmake_library(pluginVersion + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlVersionPluginType" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginVersion.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginVersion) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestQmlVersionPluginType" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/.prev_CMakeLists.txt new file mode 100644 index 0000000000..7db53592e1 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from pluginWithQmlFile.pro. + +##################################################################### +## pluginWithQmlFile Generic Library: +##################################################################### + +qt_add_cmake_library(pluginWithQmlFile + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestPluginWithQmlFile" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginWithQmlFile.pro:<TRUE>: +# IMPORT_FILES = "qmldir" "MyQmlFile.qml" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginWithQmlFile) diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/CMakeLists.txt new file mode 100644 index 0000000000..ad21516b1c --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from pluginWithQmlFile.pro. + +##################################################################### +## pluginWithQmlFile Generic Library: +##################################################################### + +qt_add_cmake_library(pluginWithQmlFile + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestPluginWithQmlFile" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginWithQmlFile.pro:<TRUE>: +# IMPORT_FILES = "qmldir" "MyQmlFile.qml" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(pluginWithQmlFile) +# special case begin +file(COPY qmldir MyQmlFile.qml + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/AutoTestPluginWithQmlFile" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/.prev_CMakeLists.txt new file mode 100644 index 0000000000..93a10a2169 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from pluginWrongCase.pro. + +##################################################################### +## Plugin Generic Library: +##################################################################### + +qt_add_cmake_library(Plugin + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/WrongCase" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginWrongCase.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(Plugin) diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/CMakeLists.txt new file mode 100644 index 0000000000..7938f93465 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from pluginWrongCase.pro. + +##################################################################### +## Plugin Generic Library: +##################################################################### + +qt_add_cmake_library(Plugin + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/WrongCase" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:pluginWrongCase.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(Plugin) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/WrongCase" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..1e803e65af --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from preemptedStrictModule.pro. + +##################################################################### +## preemptedStrictModule Generic Library: +##################################################################### + +qt_add_cmake_library(preemptedStrictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptedStrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:preemptedStrictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(preemptedStrictModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/CMakeLists.txt new file mode 100644 index 0000000000..2c13ea8aa6 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from preemptedStrictModule.pro. + +##################################################################### +## preemptedStrictModule Generic Library: +##################################################################### + +qt_add_cmake_library(preemptedStrictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptedStrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:preemptedStrictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(preemptedStrictModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptedStrictModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..3addc1aacb --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from preemptiveModule.pro. + +##################################################################### +## preemptiveModule Generic Library: +##################################################################### + +qt_add_cmake_library(preemptiveModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptiveModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:preemptiveModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(preemptiveModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/CMakeLists.txt new file mode 100644 index 0000000000..d473bff09c --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from preemptiveModule.pro. + +##################################################################### +## preemptiveModule Generic Library: +##################################################################### + +qt_add_cmake_library(preemptiveModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptiveModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:preemptiveModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(preemptiveModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/PreemptiveModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/protectedModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/protectedModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..5ff2840aef --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/protectedModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from protectedModule.pro. + +##################################################################### +## protectedModule Generic Library: +##################################################################### + +qt_add_cmake_library(protectedModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ProtectedModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:protectedModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(protectedModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/protectedModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/protectedModule/CMakeLists.txt new file mode 100644 index 0000000000..24da9a078e --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/protectedModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from protectedModule.pro. + +##################################################################### +## protectedModule Generic Library: +##################################################################### + +qt_add_cmake_library(protectedModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ProtectedModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:protectedModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(protectedModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/ProtectedModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/.prev_CMakeLists.txt new file mode 100644 index 0000000000..d832421c8f --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from strictModule.2.pro. + +##################################################################### +## strictModule.2 Generic Library: +##################################################################### + +qt_add_cmake_library(strictModule.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:strictModule.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(strictModule.2) diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/CMakeLists.txt new file mode 100644 index 0000000000..9b69cf90ca --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from strictModule.2.pro. + +##################################################################### +## strictModule.2 Generic Library: +##################################################################### + +qt_add_cmake_library(strictModule.2 + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule.2" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:strictModule.2.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(strictModule.2) +# special case begin +set_target_properties(strictModule.2 PROPERTIES OUTPUT_NAME "strictModule") +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule.2" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule/.prev_CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/strictModule/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f8bb888bd9 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from strictModule.pro. + +##################################################################### +## strictModule Generic Library: +##################################################################### + +qt_add_cmake_library(strictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:strictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(strictModule) diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/strictModule/CMakeLists.txt new file mode 100644 index 0000000000..d3013fef73 --- /dev/null +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from strictModule.pro. + +##################################################################### +## strictModule Generic Library: +##################################################################### + +qt_add_cmake_library(strictModule + MODULE + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule" + SOURCES + plugin.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::CorePrivate + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate +) + +#### Keys ignored in scope 1:.:.:strictModule.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +qt_autogen_tools_initial_setup(strictModule) +# special case begin +file(COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../imports/org/qtproject/StrictModule" +) +# special case end diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index 75885bc84a..f15d53d022 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -34,6 +34,10 @@ #include <QtCore/qjsondocument.h> #include <QtCore/qjsonarray.h> #include <QDebug> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QCborMap> +#include <QCborValue> +#endif #if defined(Q_OS_MAC) // For _PC_CASE_SENSITIVE @@ -131,8 +135,7 @@ QByteArray SecondStaticPlugin::metaData; template <typename PluginType> void registerStaticPlugin(const char *uri) { - QStaticPlugin plugin; - plugin.instance = []() { + auto instanceFunctor = []() { static PluginType plugin; return static_cast<QObject*>(&plugin); }; @@ -143,12 +146,28 @@ void registerStaticPlugin(const char *uri) uris.append(uri); md.insert(QStringLiteral("uri"), uris); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + PluginType::metaData.append(QLatin1String("QTMETADATA !")); + PluginType::metaData.append(char(0)); // current version + PluginType::metaData.append(char(QT_VERSION_MAJOR)); + PluginType::metaData.append(char(QT_VERSION_MINOR)); + PluginType::metaData.append(char(qPluginArchRequirements())); + PluginType::metaData.append(QCborValue(QCborMap::fromJsonObject(md)).toCbor()); + + auto rawMetaDataFunctor = []() -> QPluginMetaData { + return {reinterpret_cast<const uchar *>(PluginType::metaData.constData()), size_t(PluginType::metaData.length())}; + }; + QStaticPlugin plugin(instanceFunctor, rawMetaDataFunctor); +#else PluginType::metaData.append(QLatin1String("QTMETADATA ")); PluginType::metaData.append(QJsonDocument(md).toBinaryData()); + QStaticPlugin plugin; + plugin.instance = instanceFunctor; plugin.rawMetaData = []() { return PluginType::metaData.constData(); }; +#endif qRegisterStaticPluginFunction(plugin); }; diff --git a/tests/auto/qml/qqmlnotifier/CMakeLists.txt b/tests/auto/qml/qqmlnotifier/CMakeLists.txt new file mode 100644 index 0000000000..75c4893e26 --- /dev/null +++ b/tests/auto/qml/qqmlnotifier/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qqmlnotifier.pro. + +##################################################################### +## tst_qqmlnotifier 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_qqmlnotifier + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlnotifier.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlnotifier CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlnotifier CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlobjectmodel/CMakeLists.txt b/tests/auto/qml/qqmlobjectmodel/CMakeLists.txt new file mode 100644 index 0000000000..347a68a8de --- /dev/null +++ b/tests/auto/qml/qqmlobjectmodel/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qqmlobjectmodel.pro. + +##################################################################### +## tst_qqmlobjectmodel Test: +##################################################################### + +qt_add_test(tst_qqmlobjectmodel + SOURCES + tst_qqmlobjectmodel.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::Qml + Qt::QmlModelsPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlopenmetaobject/CMakeLists.txt b/tests/auto/qml/qqmlopenmetaobject/CMakeLists.txt new file mode 100644 index 0000000000..361ea61ae9 --- /dev/null +++ b/tests/auto/qml/qqmlopenmetaobject/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from qqmlopenmetaobject.pro. + +##################################################################### +## tst_qqmlopenmetaobject Test: +##################################################################### + +qt_add_test(tst_qqmlopenmetaobject + SOURCES + tst_qqmlopenmetaobject.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmlparser/CMakeLists.txt b/tests/auto/qml/qqmlparser/CMakeLists.txt new file mode 100644 index 0000000000..6fc6135e5f --- /dev/null +++ b/tests/auto/qml/qqmlparser/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qqmlparser.pro. + +##################################################################### +## tst_qqmlparser 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_qqmlparser + SOURCES + ../../shared/qqmljsastdumper.cpp ../../shared/qqmljsastdumper.h + ../../shared/util.cpp ../../shared/util.h + tst_qqmlparser.cpp + DEFINES + SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + INCLUDE_DIRECTORIES + ../../shared ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlparser CONDITION CMAKE_CROSSCOMPILING + DEFINES + QTEST_CROSS_COMPILED +) + +qt_extend_target(tst_qqmlparser CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlparser CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp index c7d09f9d6e..e4bcfa7796 100644 --- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp +++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp @@ -38,6 +38,7 @@ #include <qtest.h> #include <QDir> #include <QDebug> +#include <QRegularExpression> #include <cstdlib> class tst_qqmlparser : public QQmlDataTest @@ -58,7 +59,7 @@ private slots: void templateLiteral(); void leadingSemicolonInClass(); void templatedReadonlyProperty(); - void qmlImportInJSRequiresFullVersion(); + void qmlImportInJS(); void typeAnnotations_data(); void typeAnnotations(); void disallowedTypeAnnotations_data(); @@ -68,6 +69,8 @@ private slots: void typeAssertion(); void annotations_data(); void annotations(); + void invalidImportVersion_data(); + void invalidImportVersion(); private: QStringList excludedDirs; @@ -358,37 +361,28 @@ void tst_qqmlparser::templatedReadonlyProperty() QVERIFY(parser.parse()); } -void tst_qqmlparser::qmlImportInJSRequiresFullVersion() +void tst_qqmlparser::qmlImportInJS() { { QQmlJS::Engine engine; QQmlJS::Lexer lexer(&engine); lexer.setCode(QLatin1String(".import Test 1.0 as T"), 0, false); QQmlJS::Parser parser(&engine); - bool b = parser.parseProgram(); - qDebug() << parser.errorMessage(); - QVERIFY(b); + QVERIFY(parser.parseProgram()); } { QQmlJS::Engine engine; QQmlJS::Lexer lexer(&engine); lexer.setCode(QLatin1String(".import Test 1 as T"), 0, false); QQmlJS::Parser parser(&engine); - QVERIFY(!parser.parseProgram()); - } - { - QQmlJS::Engine engine; - QQmlJS::Lexer lexer(&engine); - lexer.setCode(QLatin1String(".import Test 1 as T"), 0, false); - QQmlJS::Parser parser(&engine); - QVERIFY(!parser.parseProgram()); + QVERIFY(parser.parseProgram()); } { QQmlJS::Engine engine; QQmlJS::Lexer lexer(&engine); lexer.setCode(QLatin1String(".import Test as T"), 0, false); QQmlJS::Parser parser(&engine); - QVERIFY(!parser.parseProgram()); + QVERIFY(parser.parseProgram()); } } @@ -585,6 +579,47 @@ void tst_qqmlparser::annotations() } } +void tst_qqmlparser::invalidImportVersion_data() +{ + QTest::addColumn<QString>("expression"); + + const QStringList segments = { + "0", "255", "500", "3030303030303030303030303" + }; + + for (const QString &major : segments) { + if (major != "0") { + QTest::addRow("%s", qPrintable(major)) + << QString::fromLatin1("import Foo %1").arg(major); + } + + for (const QString &minor : segments) { + if (major == "0" && minor == "0") + continue; + + QTest::addRow("%s.%s", qPrintable(major), qPrintable(minor)) + << QString::fromLatin1("import Foo %1.%2").arg(major).arg(minor); + } + } + + +} + +void tst_qqmlparser::invalidImportVersion() +{ + QFETCH(QString, expression); + + QQmlJS::Engine engine; + QQmlJS::Lexer lexer(&engine); + lexer.setCode(expression, 1); + QQmlJS::Parser parser(&engine); + QVERIFY(!parser.parse()); + + QRegularExpression regexp( + "^Invalid (major )?version. Version numbers must be >= 0 and < 255\\.$"); + QVERIFY(regexp.match(parser.errorMessage()).hasMatch()); +} + QTEST_MAIN(tst_qqmlparser) #include "tst_qqmlparser.moc" diff --git a/tests/auto/qml/qqmlpromise/CMakeLists.txt b/tests/auto/qml/qqmlpromise/CMakeLists.txt new file mode 100644 index 0000000000..591ad850db --- /dev/null +++ b/tests/auto/qml/qqmlpromise/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qqmlpromise.pro. + +##################################################################### +## tst_qqmlpromise 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_qqmlpromise + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlpromise.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlpromise.pro:<TRUE>: +# DISTFILES = "data/then-fulfilled-non-callable.qml" "data/then-reject-non-callable.qml" "data/then-resolve-multiple-then.qml" "data/then-resolve-chaining.qml" "data/then-reject-chaining.qml" "data/promise-resolve-with-value.qml" "data/promise-resolve-with-promise.qml" "data/promise-reject-with-value.qml" "data/promise-executor-resolve.qml" "data/promise-get-length.qml" "data/promise-executor-reject.qml" "data/promise-reject-catch.qml" "data/promise-async-resolve-with-value.qml" "data/promise-async-reject-with-value.qml" "data/promise-all-resolve.qml" "data/promise-all-empty-input.qml" "data/promise-resolve-with-array.qml" "data/promise-all-reject-reject-is-last.qml" "data/promise-all-reject-reject-is-mid.qml" "data/promise-race-resolve-1st.qml" "data/promise-race-empty-input.qml" "data/promise-race-resolve-2nd.qml" "data/promise-race-resolve-1st-in-executor-function.qml" "data/promise-resolve-is-a-function.qml" "data/promise-resolve-function-length.qml" "data/promise-all-invoke-then-method.qml" "data/promise-resolve-with-empty.qml" "data/promise-executor-throw-exception.qml" "data/promise-executor-function-extensible.qml" "data/promise-all-noniterable-input.qml" +# OTHER_FILES = <EMPTY> + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlpromise CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlpromise CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlproperty/CMakeLists.txt b/tests/auto/qml/qqmlproperty/CMakeLists.txt new file mode 100644 index 0000000000..ea81a3f337 --- /dev/null +++ b/tests/auto/qml/qqmlproperty/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from qqmlproperty.pro. + +##################################################################### +## tst_qqmlproperty 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_qqmlproperty + SOURCES + ../../shared/util.cpp ../../shared/util.h + interfaces.h + tst_qqmlproperty.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlproperty.pro:<TRUE>: +# QML_IMPORT_NAME = "io.qt.bugreports" +# QML_IMPORT_VERSION = "2.0" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlproperty CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlproperty CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) + +set_target_properties(tst_qqmlproperty PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION 2.0 + QT_QML_MODULE_URI io.qt.bugreports +) + +qt6_qml_type_registration(tst_qqmlproperty) diff --git a/tests/auto/qml/qqmlpropertycache/CMakeLists.txt b/tests/auto/qml/qqmlpropertycache/CMakeLists.txt new file mode 100644 index 0000000000..7c84ef687a --- /dev/null +++ b/tests/auto/qml/qqmlpropertycache/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qqmlpropertycache.pro. + +##################################################################### +## tst_qqmlpropertycache 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_qqmlpropertycache + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlpropertycache.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlpropertycache CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlpropertycache CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp index c9e92cd3c9..2e040eec18 100644 --- a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp +++ b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp @@ -114,7 +114,8 @@ void tst_qqmlpropertycache::properties() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "propertyA"))); @@ -136,8 +137,11 @@ void tst_qqmlpropertycache::propertiesDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "propertyA"))); @@ -161,8 +165,11 @@ void tst_qqmlpropertycache::revisionedProperties() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cacheWithoutVersion(new QQmlPropertyCache(metaObject)); - QQmlRefPointer<QQmlPropertyCache> cacheWithVersion(new QQmlPropertyCache(metaObject, 1)); + QQmlRefPointer<QQmlPropertyCache> cacheWithoutVersion(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cacheWithVersion( + new QQmlPropertyCache(metaObject, QTypeRevision::fromMinorVersion(1)), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cacheWithoutVersion, "propertyE"))); @@ -176,7 +183,8 @@ void tst_qqmlpropertycache::methods() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "slotA"))); @@ -210,8 +218,11 @@ void tst_qqmlpropertycache::methodsDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "slotA"))); @@ -245,7 +256,8 @@ void tst_qqmlpropertycache::signalHandlers() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "onSignalA"))); @@ -273,8 +285,11 @@ void tst_qqmlpropertycache::signalHandlersDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "onSignalA"))); @@ -478,7 +493,9 @@ class TestClassWithClassInfo : public QObject int(sizeof(arr) / sizeof(arr[0])) #define TEST_CLASS(Class) \ - QTest::newRow(#Class) << &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_##Class) << ARRAY_SIZE(qt_meta_stringdata_##Class.data) + QTest::newRow(#Class) \ + << &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_##Class) \ + << int(sizeof(qt_meta_stringdata_##Class.offsetsAndSize) / (sizeof(uint) * 2)) Q_DECLARE_METATYPE(const QMetaObject*); diff --git a/tests/auto/qml/qqmlpropertymap/CMakeLists.txt b/tests/auto/qml/qqmlpropertymap/CMakeLists.txt new file mode 100644 index 0000000000..7d5bce3056 --- /dev/null +++ b/tests/auto/qml/qqmlpropertymap/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmlpropertymap.pro. + +##################################################################### +## tst_qqmlpropertymap 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_qqmlpropertymap + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlpropertymap.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlpropertymap CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlpropertymap CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlqt/CMakeLists.txt b/tests/auto/qml/qqmlqt/CMakeLists.txt new file mode 100644 index 0000000000..085c7e0f75 --- /dev/null +++ b/tests/auto/qml/qqmlqt/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmlqt.pro. + +##################################################################### +## tst_qqmlqt 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_qqmlqt + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlqt.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlqt CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlqt CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlqt/data/formatting.qml b/tests/auto/qml/qqmlqt/data/formatting.qml index f2d1e1b5c8..14af9ba88b 100644 --- a/tests/auto/qml/qqmlqt/data/formatting.qml +++ b/tests/auto/qml/qqmlqt/data/formatting.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.15 QtObject { property date dateFromString: "2008-12-24" @@ -8,7 +8,7 @@ QtObject { var v = eval(prop) return [ Qt.formatDate(v), - Qt.formatDate(v, Qt.DefaultLocaleLongDate), + Qt.formatDate(v, Qt.locale(), Locale.LongFormat), Qt.formatDate(v, "ddd MMMM d yy") ] } @@ -17,7 +17,7 @@ QtObject { var v = eval(prop) return [ Qt.formatTime(v), - Qt.formatTime(v, Qt.DefaultLocaleLongDate), + Qt.formatTime(v, Qt.locale(), Locale.LongFormat), Qt.formatTime(v, "H:m:s a"), Qt.formatTime(v, "hh:mm:ss.zzz") ] @@ -27,7 +27,7 @@ QtObject { var v = eval(prop) return [ Qt.formatDateTime(v), - Qt.formatDateTime(v, Qt.DefaultLocaleLongDate), + Qt.formatDateTime(v, Qt.locale(), Locale.LongFormat), Qt.formatDateTime(v, "M/d/yy H:m:s a") ] } diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp index 1a54397f1a..60ee2a4d1c 100644 --- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp +++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp @@ -168,15 +168,13 @@ void tst_qqmlqt::initTestCase() void tst_qqmlqt::enums() { QQmlComponent component(&engine, testFileUrl("enums.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toInt(), (int)Qt::Key_Escape); QCOMPARE(object->property("test2").toInt(), (int)Qt::DescendingOrder); QCOMPARE(object->property("test3").toInt(), (int)Qt::ElideMiddle); QCOMPARE(object->property("test4").toInt(), (int)Qt::AlignRight); - - delete object; } void tst_qqmlqt::rgba() @@ -188,7 +186,7 @@ void tst_qqmlqt::rgba() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); @@ -198,8 +196,6 @@ void tst_qqmlqt::rgba() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromRgbF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromRgbF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::hsla() @@ -211,7 +207,7 @@ void tst_qqmlqt::hsla() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHslF(1, 0, 0, 0.8)); @@ -220,8 +216,6 @@ void tst_qqmlqt::hsla() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromHslF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromHslF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::hsva() @@ -233,7 +227,7 @@ void tst_qqmlqt::hsva() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHsvF(1, 0, 0, 0.8)); @@ -242,8 +236,6 @@ void tst_qqmlqt::hsva() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromHsvF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromHsvF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::colorEqual() @@ -261,7 +253,7 @@ void tst_qqmlqt::colorEqual() QTest::ignoreMessage(QtWarningMsg, qPrintable(component.url().toString() + ":34: Error: Qt.colorEqual(): Invalid color name")); QTest::ignoreMessage(QtWarningMsg, qPrintable(component.url().toString() + ":35: Error: Qt.colorEqual(): Invalid color name")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1a").toBool(), false); @@ -325,8 +317,6 @@ void tst_qqmlqt::colorEqual() QCOMPARE(object->property("test6c").toBool(), true); QCOMPARE(object->property("test6d").toBool(), false); QCOMPARE(object->property("test6e").toBool(), false); - - delete object; } void tst_qqmlqt::rect() @@ -338,7 +328,7 @@ void tst_qqmlqt::rect() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QRectF>(object->property("test1")), QRectF(10, 13, 100, 109)); @@ -346,8 +336,6 @@ void tst_qqmlqt::rect() QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF(10, 13, 100, -109)); - - delete object; } void tst_qqmlqt::point() @@ -359,15 +347,13 @@ void tst_qqmlqt::point() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QPointF>(object->property("test1")), QPointF(19, 34)); QCOMPARE(qvariant_cast<QPointF>(object->property("test2")), QPointF(-3, 109.2)); QCOMPARE(qvariant_cast<QPointF>(object->property("test3")), QPointF()); QCOMPARE(qvariant_cast<QPointF>(object->property("test4")), QPointF()); - - delete object; } void tst_qqmlqt::size() @@ -379,7 +365,7 @@ void tst_qqmlqt::size() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QSizeF>(object->property("test1")), QSizeF(19, 34)); @@ -387,8 +373,6 @@ void tst_qqmlqt::size() QCOMPARE(qvariant_cast<QSizeF>(object->property("test3")), QSizeF(-3, 10)); QCOMPARE(qvariant_cast<QSizeF>(object->property("test4")), QSizeF()); QCOMPARE(qvariant_cast<QSizeF>(object->property("test5")), QSizeF()); - - delete object; } void tst_qqmlqt::vector2d() @@ -400,15 +384,13 @@ void tst_qqmlqt::vector2d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector2D>(object->property("test1")), QVector2D(1, 0.9f)); QCOMPARE(qvariant_cast<QVector2D>(object->property("test2")), QVector2D(102, -982.1f)); QCOMPARE(qvariant_cast<QVector2D>(object->property("test3")), QVector2D()); QCOMPARE(qvariant_cast<QVector2D>(object->property("test4")), QVector2D()); - - delete object; } void tst_qqmlqt::vector3d() @@ -420,15 +402,13 @@ void tst_qqmlqt::vector3d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9f)); QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1f)); QCOMPARE(qvariant_cast<QVector3D>(object->property("test3")), QVector3D()); QCOMPARE(qvariant_cast<QVector3D>(object->property("test4")), QVector3D()); - - delete object; } void tst_qqmlqt::vector4d() @@ -440,15 +420,13 @@ void tst_qqmlqt::vector4d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector4D>(object->property("test1")), QVector4D(1, 0, 0.9f, 0.6f)); QCOMPARE(qvariant_cast<QVector4D>(object->property("test2")), QVector4D(102, -10, -982.1f, 10)); QCOMPARE(qvariant_cast<QVector4D>(object->property("test3")), QVector4D()); QCOMPARE(qvariant_cast<QVector4D>(object->property("test4")), QVector4D()); - - delete object; } void tst_qqmlqt::quaternion() @@ -460,15 +438,13 @@ void tst_qqmlqt::quaternion() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test1")), QQuaternion(2, 17, 0.9f, 0.6f)); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test2")), QQuaternion(102, -10, -982.1f, 10)); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test3")), QQuaternion()); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test4")), QQuaternion()); - - delete object; } void tst_qqmlqt::matrix4x4() @@ -482,7 +458,7 @@ void tst_qqmlqt::matrix4x4() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test1")), QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); @@ -490,8 +466,6 @@ void tst_qqmlqt::matrix4x4() QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test3")), QMatrix4x4()); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test4")), QMatrix4x4()); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test5")), QMatrix4x4()); - - delete object; } void tst_qqmlqt::font() @@ -503,7 +477,7 @@ void tst_qqmlqt::font() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QFont f; @@ -516,8 +490,6 @@ void tst_qqmlqt::font() QCOMPARE(qvariant_cast<QFont>(object->property("test2")), f); QCOMPARE(qvariant_cast<QFont>(object->property("test3")), QFont()); QCOMPARE(qvariant_cast<QFont>(object->property("test4")), QFont()); - - delete object; } void tst_qqmlqt::lighter() @@ -529,7 +501,7 @@ void tst_qqmlqt::lighter() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter()); @@ -538,8 +510,6 @@ void tst_qqmlqt::lighter() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").lighter()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor()); - - delete object; } void tst_qqmlqt::darker() @@ -551,7 +521,7 @@ void tst_qqmlqt::darker() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker()); @@ -560,8 +530,6 @@ void tst_qqmlqt::darker() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").darker()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor()); - - delete object; } void tst_qqmlqt::tint() @@ -574,7 +542,7 @@ void tst_qqmlqt::tint() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(0, 0, 1)); @@ -583,8 +551,6 @@ void tst_qqmlqt::tint() QCOMPARE(test3.rgba(), 0xFF7F0080); QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); - - delete object; } class MyUrlHandler : public QObject @@ -607,7 +573,7 @@ void tst_qqmlqt::openUrlExternally() QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QQmlComponent component(&engine, testFileUrl("openUrlExternally.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); @@ -629,7 +595,7 @@ void tst_qqmlqt::openUrlExternally_pragmaLibrary() QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QQmlComponent component(&engine, testFileUrl("openUrlExternally_lib.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); @@ -650,42 +616,37 @@ void tst_qqmlqt::md5() QString warning1 = component.url().toString() + ":4: Error: Qt.md5(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex())); - - delete object; } void tst_qqmlqt::createComponent() { { - QQmlComponent component(&engine, testFileUrl("createComponent.qml")); - - QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments"; - QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments"; - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QQmlComponent component(&engine, testFileUrl("createComponent.qml")); - QObject *object = component.create(); - QVERIFY(object != nullptr); + QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments"; + QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml")); - QCOMPARE(object->property("relativeUrl").toString(), testFileUrl("createComponentData.qml").toString()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); - QTRY_VERIFY(object->property("asyncResult").toBool()); + QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml")); + QCOMPARE(object->property("relativeUrl").toString(), testFileUrl("createComponentData.qml").toString()); - delete object; + QTRY_VERIFY(object->property("asyncResult").toBool()); } // simultaneous sync and async compilation { - QQmlComponent component(&engine, testFileUrl("createComponent.2.qml")); - QObject *object = component.create(); - QVERIFY(object != nullptr); - QTRY_VERIFY(object->property("success").toBool()); - delete object; + QQmlComponent component(&engine, testFileUrl("createComponent.2.qml")); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); + QTRY_VERIFY(object->property("success").toBool()); } } @@ -693,11 +654,10 @@ void tst_qqmlqt::createComponent_pragmaLibrary() { // Currently, just loading createComponent_lib.qml causes crash on some platforms QQmlComponent component(&engine, testFileUrl("createComponent_lib.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("status").toInt(), int(QQmlComponent::Ready)); QCOMPARE(object->property("readValue").toInt(), int(1913)); - delete object; } void tst_qqmlqt::createQmlObject() @@ -717,17 +677,15 @@ void tst_qqmlqt::createQmlObject() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning5)); QTest::ignoreMessage(QtDebugMsg, qPrintable(warning6)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("emptyArg").toBool(), true); QCOMPARE(object->property("success").toBool(), true); - QQuickItem *item = qobject_cast<QQuickItem *>(object); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item != nullptr); QCOMPARE(item->childItems().count(), 1); - - delete object; } @@ -750,7 +708,7 @@ void tst_qqmlqt::dateTimeConversion() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("dateTimeConversion.qml")); - QObject *obj = component.create(); + QScopedPointer<QObject> obj(component.create()); QCOMPARE(obj->property("qdate").toDate(), date); QCOMPARE(obj->property("qtime").toTime(), time); @@ -816,8 +774,6 @@ void tst_qqmlqt::dateTimeFormatting() void tst_qqmlqt::dateTimeFormatting_data() { - QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED - // Test intentionally uses deprecated enumerators from Qt::DateFormat QTest::addColumn<QString>("method"); QTest::addColumn<QStringList>("inputProperties"); QTest::addColumn<QStringList>("expectedResults"); @@ -829,25 +785,24 @@ void tst_qqmlqt::dateTimeFormatting_data() QTest::newRow("formatDate") << "formatDate" << (QStringList() << "dateFromString" << "jsdate" << "qdate" << "qdatetime") - << (QStringList() << date.toString(Qt::DefaultLocaleShortDate) - << date.toString(Qt::DefaultLocaleLongDate) + << (QStringList() << QLocale().toString(date, QLocale::ShortFormat) + << QLocale().toString(date, QLocale::LongFormat) << date.toString("ddd MMMM d yy")); QTest::newRow("formatTime") << "formatTime" << (QStringList() << "jsdate" << "qtime" << "qdatetime") - << (QStringList() << time.toString(Qt::DefaultLocaleShortDate) - << time.toString(Qt::DefaultLocaleLongDate) + << (QStringList() << QLocale().toString(time, QLocale::ShortFormat) + << QLocale().toString(time, QLocale::LongFormat) << time.toString("H:m:s a") << time.toString("hh:mm:ss.zzz")); QTest::newRow("formatDateTime") << "formatDateTime" << (QStringList() << "jsdate" << "qdatetime") - << (QStringList() << dateTime.toString(Qt::DefaultLocaleShortDate) - << dateTime.toString(Qt::DefaultLocaleLongDate) + << (QStringList() << QLocale().toString(dateTime, QLocale::ShortFormat) + << QLocale().toString(dateTime, QLocale::LongFormat) << dateTime.toString("M/d/yy H:m:s a")); - QT_WARNING_POP } void tst_qqmlqt::dateTimeFormattingVariants() @@ -886,8 +841,6 @@ void tst_qqmlqt::dateTimeFormattingVariants() void tst_qqmlqt::dateTimeFormattingVariants_data() { - QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED - // Test intentionally uses deprecated enumerators from Qt::DateFormat QTest::addColumn<QString>("method"); QTest::addColumn<QVariant>("variant"); QTest::addColumn<QStringList>("expectedResults"); @@ -896,39 +849,124 @@ void tst_qqmlqt::dateTimeFormattingVariants_data() QTime time(11, 16, 39, 755); temporary = QDateTime(QDate(1970,1,1), time); - QTest::newRow("formatTime, qtime") << "formatTime" << QVariant::fromValue(time) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); + QTest::newRow("formatTime, qtime") + << "formatTime" << QVariant::fromValue(time) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary.time().toString("H:m:s a") + << temporary.time().toString("hh:mm:ss.zzz")); QDate date(2011,5,31); // V4 reads the date in UTC but DateObject::toQDateTime() gives it back in local time: temporary = QDateTime(date, QTime(0, 0, 0), Qt::UTC).toLocalTime(); - QTest::newRow("formatDate, qdate") << "formatDate" << QVariant::fromValue(date) << (QStringList() << temporary.date().toString(Qt::DefaultLocaleShortDate) << temporary.date().toString(Qt::DefaultLocaleLongDate) << temporary.date().toString("ddd MMMM d yy")); - QTest::newRow("formatDateTime, qdate") << "formatDateTime" << QVariant::fromValue(date) << (QStringList() << temporary.toString(Qt::DefaultLocaleShortDate) << temporary.toString(Qt::DefaultLocaleLongDate) << temporary.toString("M/d/yy H:m:s a")); - QTest::newRow("formatTime, qdate") << "formatTime" << QVariant::fromValue(date) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); + QTest::newRow("formatDate, qdate") + << "formatDate" << QVariant::fromValue(date) + << (QStringList() + << QLocale().toString(temporary.date(), QLocale::ShortFormat) + << QLocale().toString(temporary.date(), QLocale::LongFormat) + << temporary.date().toString("ddd MMMM d yy")); + QTest::newRow("formatDateTime, qdate") + << "formatDateTime" << QVariant::fromValue(date) + << (QStringList() + << QLocale().toString(temporary, QLocale::ShortFormat) + << QLocale().toString(temporary, QLocale::LongFormat) + << temporary.toString("M/d/yy H:m:s a")); + QTest::newRow("formatTime, qdate") + << "formatTime" << QVariant::fromValue(date) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary + .time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); QDateTime dateTime(date, time); temporary = dateTime; - QTest::newRow("formatDate, qdatetime") << "formatDate" << QVariant::fromValue(dateTime) << (QStringList() << temporary.date().toString(Qt::DefaultLocaleShortDate) << temporary.date().toString(Qt::DefaultLocaleLongDate) << temporary.date().toString("ddd MMMM d yy")); - QTest::newRow("formatDateTime, qdatetime") << "formatDateTime" << QVariant::fromValue(dateTime) << (QStringList() << temporary.toString(Qt::DefaultLocaleShortDate) << temporary.toString(Qt::DefaultLocaleLongDate) << temporary.toString("M/d/yy H:m:s a")); - QTest::newRow("formatTime, qdatetime") << "formatTime" << QVariant::fromValue(dateTime) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); + QTest::newRow("formatDate, qdatetime") + << "formatDate" << QVariant::fromValue(dateTime) + << (QStringList() + << QLocale().toString(temporary.date(), QLocale::ShortFormat) + << QLocale().toString(temporary.date(), QLocale::LongFormat) + << temporary.date().toString("ddd MMMM d yy")); + QTest::newRow("formatDateTime, qdatetime") + << "formatDateTime" << QVariant::fromValue(dateTime) + << (QStringList() + << QLocale().toString(temporary, QLocale::ShortFormat) + << QLocale().toString(temporary, QLocale::LongFormat) + << temporary.toString("M/d/yy H:m:s a")); + QTest::newRow("formatTime, qdatetime") + << "formatTime" << QVariant::fromValue(dateTime) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary.time().toString("H:m:s a") + << temporary.time().toString("hh:mm:ss.zzz")); QString string(QLatin1String("2011/05/31 11:16:39.755")); temporary = QDateTime::fromString(string, "yyyy/MM/dd HH:mm:ss.zzz"); - QTest::newRow("formatDate, qstring") << "formatDate" << QVariant::fromValue(string) << (QStringList() << temporary.date().toString(Qt::DefaultLocaleShortDate) << temporary.date().toString(Qt::DefaultLocaleLongDate) << temporary.date().toString("ddd MMMM d yy")); - QTest::newRow("formatDateTime, qstring") << "formatDateTime" << QVariant::fromValue(string) << (QStringList() << temporary.toString(Qt::DefaultLocaleShortDate) << temporary.toString(Qt::DefaultLocaleLongDate) << temporary.toString("M/d/yy H:m:s a")); - QTest::newRow("formatTime, qstring") << "formatTime" << QVariant::fromValue(string) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); + QTest::newRow("formatDate, qstring") + << "formatDate" << QVariant::fromValue(string) + << (QStringList() + << QLocale().toString(temporary.date(), QLocale::ShortFormat) + << QLocale().toString(temporary.date(), QLocale::LongFormat) + << temporary.date().toString("ddd MMMM d yy")); + QTest::newRow("formatDateTime, qstring") + << "formatDateTime" << QVariant::fromValue(string) + << (QStringList() + << QLocale().toString(temporary, QLocale::ShortFormat) + << QLocale().toString(temporary, QLocale::LongFormat) + << temporary.toString("M/d/yy H:m:s a")); + QTest::newRow("formatTime, qstring") + << "formatTime" << QVariant::fromValue(string) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary.time().toString("H:m:s a") + << temporary.time().toString("hh:mm:ss.zzz")); QColor color(Qt::red); temporary = QVariant::fromValue(color).toDateTime(); - QTest::newRow("formatDate, qcolor") << "formatDate" << QVariant::fromValue(color) << (QStringList() << temporary.date().toString(Qt::DefaultLocaleShortDate) << temporary.date().toString(Qt::DefaultLocaleLongDate) << temporary.date().toString("ddd MMMM d yy")); - QTest::newRow("formatDateTime, qcolor") << "formatDateTime" << QVariant::fromValue(color) << (QStringList() << temporary.toString(Qt::DefaultLocaleShortDate) << temporary.toString(Qt::DefaultLocaleLongDate) << temporary.toString("M/d/yy H:m:s a")); - QTest::newRow("formatTime, qcolor") << "formatTime" << QVariant::fromValue(color) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); + QTest::newRow("formatDate, qcolor") + << "formatDate" << QVariant::fromValue(color) + << (QStringList() + << QLocale().toString(temporary.date(), QLocale::ShortFormat) + << QLocale().toString(temporary.date(), QLocale::LongFormat) + << temporary.date().toString("ddd MMMM d yy")); + QTest::newRow("formatDateTime, qcolor") + << "formatDateTime" << QVariant::fromValue(color) + << (QStringList() + << QLocale().toString(temporary, QLocale::ShortFormat) + << QLocale().toString(temporary, QLocale::LongFormat) + << temporary.toString("M/d/yy H:m:s a")); + QTest::newRow("formatTime, qcolor") + << "formatTime" << QVariant::fromValue(color) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary.time().toString("H:m:s a") + << temporary.time().toString("hh:mm:ss.zzz")); int integer(4); temporary = QVariant::fromValue(integer).toDateTime(); - QTest::newRow("formatDate, int") << "formatDate" << QVariant::fromValue(integer) << (QStringList() << temporary.date().toString(Qt::DefaultLocaleShortDate) << temporary.date().toString(Qt::DefaultLocaleLongDate) << temporary.date().toString("ddd MMMM d yy")); - QTest::newRow("formatDateTime, int") << "formatDateTime" << QVariant::fromValue(integer) << (QStringList() << temporary.toString(Qt::DefaultLocaleShortDate) << temporary.toString(Qt::DefaultLocaleLongDate) << temporary.toString("M/d/yy H:m:s a")); - QTest::newRow("formatTime, int") << "formatTime" << QVariant::fromValue(integer) << (QStringList() << temporary.time().toString(Qt::DefaultLocaleShortDate) << temporary.time().toString(Qt::DefaultLocaleLongDate) << temporary.time().toString("H:m:s a") << temporary.time().toString("hh:mm:ss.zzz")); - QT_WARNING_POP + QTest::newRow("formatDate, int") + << "formatDate" << QVariant::fromValue(integer) + << (QStringList() + << QLocale().toString(temporary.date(), QLocale::ShortFormat) + << QLocale().toString(temporary.date(), QLocale::LongFormat) + << temporary.date().toString("ddd MMMM d yy")); + QTest::newRow("formatDateTime, int") + << "formatDateTime" << QVariant::fromValue(integer) + << (QStringList() + << QLocale().toString(temporary, QLocale::ShortFormat) + << QLocale().toString(temporary, QLocale::LongFormat) + << temporary.toString("M/d/yy H:m:s a")); + QTest::newRow("formatTime, int") + << "formatTime" << QVariant::fromValue(integer) + << (QStringList() + << QLocale().toString(temporary.time(), QLocale::ShortFormat) + << QLocale().toString(temporary.time(), QLocale::LongFormat) + << temporary.time().toString("H:m:s a") + << temporary.time().toString("hh:mm:ss.zzz")); } void tst_qqmlqt::dateTimeFormattingWithLocale() @@ -955,7 +993,7 @@ void tst_qqmlqt::dateTimeFormattingWithLocale() void tst_qqmlqt::isQtObject() { QQmlComponent component(&engine, testFileUrl("isQtObject.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toBool(), true); @@ -963,8 +1001,6 @@ void tst_qqmlqt::isQtObject() QCOMPARE(object->property("test3").toBool(), false); QCOMPARE(object->property("test4").toBool(), false); QCOMPARE(object->property("test5").toBool(), false); - - delete object; } void tst_qqmlqt::btoa() @@ -974,12 +1010,10 @@ void tst_qqmlqt::btoa() QString warning1 = component.url().toString() + ":4: Error: Qt.btoa(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QString("SGVsbG8gd29ybGQh")); - - delete object; } void tst_qqmlqt::atob() @@ -989,12 +1023,10 @@ void tst_qqmlqt::atob() QString warning1 = component.url().toString() + ":4: Error: Qt.atob(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QString("Hello world!")); - - delete object; } void tst_qqmlqt::fontFamilies() @@ -1004,13 +1036,11 @@ void tst_qqmlqt::fontFamilies() QString warning1 = component.url().toString() + ":4: Error: Qt.fontFamilies(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QFontDatabase database; QCOMPARE(object->property("test2"), QVariant::fromValue(database.families())); - - delete object; } void tst_qqmlqt::quit() @@ -1018,11 +1048,9 @@ void tst_qqmlqt::quit() QQmlComponent component(&engine, testFileUrl("quit.qml")); QSignalSpy spy(&engine, SIGNAL(quit())); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(spy.count(), 1); - - delete object; } void tst_qqmlqt::exit() @@ -1030,26 +1058,22 @@ void tst_qqmlqt::exit() QQmlComponent component(&engine, testFileUrl("exit.qml")); QSignalSpy spy(&engine, &QQmlEngine::exit); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(spy.count(), 1); QList<QVariant> arguments = spy.takeFirst(); QVERIFY(arguments.at(0).toInt() == object->property("returnCode").toInt()); - - delete object; } void tst_qqmlqt::resolvedUrl() { QQmlComponent component(&engine, testFileUrl("resolvedUrl.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("result").toString(), component.url().toString()); QCOMPARE(object->property("isString").toBool(), true); - - delete object; } void tst_qqmlqt::later_data() @@ -1133,11 +1157,11 @@ void tst_qqmlqt::later() QTest::ignoreMessage(QtWarningMsg, qPrintable(w)); QQmlComponent component(&engine, testFileUrl("later.qml")); - QObject *root = component.create(); + QScopedPointer<QObject> root(component.create()); QVERIFY(root != nullptr); if (!function.isEmpty()) - QMetaObject::invokeMethod(root, qPrintable(function)); + QMetaObject::invokeMethod(root.data(), qPrintable(function)); for (int i = 0; i < propNames.size(); ++i) { if (propNames.at(i) == QLatin1String("processEvents")) { @@ -1149,21 +1173,13 @@ void tst_qqmlqt::later() QCOMPARE(root->property(qPrintable(propNames.at(i))), values.at(i)); } } - - delete root; } void tst_qqmlqt::qtObjectContents() { - struct StaticQtMetaObject : public QObject - { - static const QMetaObject *get() - { return &staticQtMetaObject; } - }; - QQmlComponent component(&engine, testFileUrl("qtObjectContents.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QVERIFY(object->property("values").canConvert<QJSValue>()); @@ -1171,7 +1187,7 @@ void tst_qqmlqt::qtObjectContents() QSet<const char *> keys; int uniqueKeys = 0; - const QMetaObject *qtMetaObject = StaticQtMetaObject::get(); + const QMetaObject *qtMetaObject = &Qt::staticMetaObject; for (int ii = 0; ii < qtMetaObject->enumeratorCount(); ++ii) { QMetaEnum enumerator = qtMetaObject->enumerator(ii); for (int jj = 0; jj < enumerator.keyCount(); ++jj) { @@ -1194,8 +1210,6 @@ void tst_qqmlqt::qtObjectContents() QCOMPARE(values.value("Synchronous").toInt(), 1); ++uniqueKeys; QCOMPARE(values.count(), uniqueKeys); - - delete object; } class TimeProvider: public QObject @@ -1289,7 +1303,8 @@ void tst_qqmlqt::timeRoundtrip() QQmlEngine eng; //qmlRegisterSingletonInstance("Test", 1, 0, "TimeProvider", &tp); QQmlComponent component(&eng, testFileUrl("timeRoundtrip.qml")); - QObject *obj = component.createWithInitialProperties({{"tp", QVariant::fromValue(&tp)}}); + QScopedPointer<QObject> obj(component.createWithInitialProperties( + {{"tp", QVariant::fromValue(&tp)}})); QVERIFY(obj != nullptr); // QML reads m_getTime and saves the result as m_putTime; this should come out the same, without diff --git a/tests/auto/qml/qqmlsettings/CMakeLists.txt b/tests/auto/qml/qqmlsettings/CMakeLists.txt new file mode 100644 index 0000000000..40bc827555 --- /dev/null +++ b/tests/auto/qml/qqmlsettings/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qqmlsettings.pro. + +##################################################################### +## tst_qqmlsettings 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_qqmlsettings + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlsettings.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlsettings CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlsettings CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt b/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt new file mode 100644 index 0000000000..bc4a88653b --- /dev/null +++ b/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmlsqldatabase.pro. + +##################################################################### +## tst_qqmlsqldatabase 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_qqmlsqldatabase + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlsqldatabase.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::Sql + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlsqldatabase CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlsqldatabase CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt new file mode 100644 index 0000000000..4ffe1c3906 --- /dev/null +++ b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from qqmlstatemachine.pro. + +##################################################################### +## tst_qqmlstatemachine Test: +##################################################################### + +qt_add_test(tst_qqmlstatemachine + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmlstatemachine.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlstatemachine CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlstatemachine CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmltablemodel/CMakeLists.txt b/tests/auto/qml/qqmltablemodel/CMakeLists.txt new file mode 100644 index 0000000000..ee33bb4517 --- /dev/null +++ b/tests/auto/qml/qqmltablemodel/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qqmltablemodel.pro. + +##################################################################### +## tst_qqmltablemodel 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_qqmltablemodel + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmltablemodel.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate + Qt::Quick + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmltablemodel CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmltablemodel CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmltimer/CMakeLists.txt b/tests/auto/qml/qqmltimer/CMakeLists.txt new file mode 100644 index 0000000000..aeb299c914 --- /dev/null +++ b/tests/auto/qml/qqmltimer/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qqmltimer.pro. + +##################################################################### +## tst_qqmltimer Test: +##################################################################### + +qt_add_test(tst_qqmltimer + SOURCES + tst_qqmltimer.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp index 4e42d02514..0168663cf2 100644 --- a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp +++ b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp @@ -311,7 +311,7 @@ void tst_qqmltimer::restart() { QQmlEngine engine; QQmlComponent component(&engine); - component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile("")); + component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 1000; repeat: true; running: true }"), QUrl::fromLocalFile("")); QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create()); QVERIFY(timer != nullptr); @@ -319,14 +319,16 @@ void tst_qqmltimer::restart() connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); QCOMPARE(helper.count, 0); - consistentWait(600); + consistentWait(1200); QCOMPARE(helper.count, 1); - consistentWait(300); + consistentWait(500); + QCOMPARE(helper.count, 1); timer->restart(); + QCOMPARE(helper.count, 1); - consistentWait(700); + consistentWait(1400); QCOMPARE(helper.count, 2); QVERIFY(timer->isRunning()); diff --git a/tests/auto/qml/qqmltranslation/.prev_CMakeLists.txt b/tests/auto/qml/qqmltranslation/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f62dfd9a3e --- /dev/null +++ b/tests/auto/qml/qqmltranslation/.prev_CMakeLists.txt @@ -0,0 +1,54 @@ +# Generated from qqmltranslation.pro. + +##################################################################### +## tst_qqmltranslation 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_qqmltranslation + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmltranslation.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(translation_resource_files + "qml_fr.qm" + "translation.qml" +) + +qt_add_resource(tst_qqmltranslation "translation" + PREFIX + "/" + BASE + "data" + FILES + ${translation_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmltranslation CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmltranslation CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmltranslation/CMakeLists.txt b/tests/auto/qml/qqmltranslation/CMakeLists.txt new file mode 100644 index 0000000000..8e280cc1de --- /dev/null +++ b/tests/auto/qml/qqmltranslation/CMakeLists.txt @@ -0,0 +1,68 @@ +# Generated from qqmltranslation.pro. + +##################################################################### +## tst_qqmltranslation 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_qqmltranslation + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qqmltranslation.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(translation_resource_files + "qml_fr.qm" + "translation.qml" +) + +# special case begin +set_source_files_properties( + data/translation.qml + PROPERTIES + QT_SKIP_QUICKCOMPILER 1 + QT_RESOURCE_ALIAS translation.qml +) +set_source_files_properties( + data/qml_fr.qm + PROPERTIES + QT_RESOURCE_ALIAS qml_fr.qm +) +# special case end + +qt_add_resource(tst_qqmltranslation "translation" + PREFIX + "/" + BASE + "data" + FILES + ${translation_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmltranslation CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmltranslation CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmltypeloader/CMakeLists.txt b/tests/auto/qml/qqmltypeloader/CMakeLists.txt new file mode 100644 index 0000000000..bad19361a5 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/CMakeLists.txt @@ -0,0 +1,52 @@ +# Generated from tst_qqmltypeloader.pro. + +##################################################################### +## tst_qqmltypeloader 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_qqmltypeloader + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + declarativetesttype.h + tst_qqmltypeloader.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate + Qt::Quick + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:tst_qqmltypeloader.pro:<TRUE>: +# QML_IMPORT_NAME = "declarative.import.for.typeloader.test" +# QML_IMPORT_VERSION = "3.2" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmltypeloader CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmltypeloader CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) + +set_target_properties(tst_qqmltypeloader PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION 3.2 + QT_QML_MODULE_URI declarative.import.for.typeloader.test +) + +qt6_qml_type_registration(tst_qqmltypeloader) diff --git a/tests/auto/qml/qqmltypeloader/SlowImport/.prev_CMakeLists.txt b/tests/auto/qml/qqmltypeloader/SlowImport/.prev_CMakeLists.txt new file mode 100644 index 0000000000..7dd4bb659c --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/SlowImport/.prev_CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from Slow.pro. + +##################################################################### +## Slow Generic Library: +##################################################################### + +qt_add_cmake_library(Slow + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../Slow" + SOURCES + plugin.cpp plugin.h + slow.cpp slow.h + INCLUDE_DIRECTORIES + . + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:Slow.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" diff --git a/tests/auto/qml/qqmltypeloader/SlowImport/CMakeLists.txt b/tests/auto/qml/qqmltypeloader/SlowImport/CMakeLists.txt new file mode 100644 index 0000000000..c377016682 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/SlowImport/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from Slow.pro. + +##################################################################### +## Slow Generic Library: +##################################################################### + +qt_add_cmake_library(Slow + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../Slow" + SOURCES + plugin.cpp plugin.h + slow.cpp slow.h + INCLUDE_DIRECTORIES + . + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:Slow.pro:<TRUE>: +# IMPORT_FILES = "qmldir" +# TEMPLATE = "lib" + +# special case begin +qt_autogen_tools_initial_setup(Slow) +file (COPY qmldir + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/../Slow" +) +# special case end diff --git a/tests/auto/qml/qqmltypeloader/dummy_imports.qml b/tests/auto/qml/qqmltypeloader/dummy_imports.qml new file mode 100644 index 0000000000..a4684b2007 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/dummy_imports.qml @@ -0,0 +1,9 @@ +// This file exists for the sole purpose for qmlimportscanner to find +// which modules it needs to extract for deployment. +// Otherwise, it fails to find the imports that are expressed in the +// C++ code belonging to the test. + +import QtQml 2.0 +import QtQuick 2.6 + +QtObject { } // This is needed in order to keep importscanner happy diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index 266a4e97d6..8a82db3456 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -63,10 +63,15 @@ private slots: void implicitImport(); void compositeSingletonCycle(); void declarativeCppType(); +private: + void checkSingleton(const QString & dataDirectory); }; void tst_QQMLTypeLoader::testLoadComplete() { +#ifdef Q_OS_ANDROID + QSKIP("Loading dynamic plugins does not work on Android"); +#endif QQuickView *window = new QQuickView(); window->engine()->addImportPath(QT_TESTCASE_BUILDDIR); qDebug() << window->engine()->importPathList(); @@ -170,7 +175,7 @@ void tst_QQMLTypeLoader::trimCache3() QCOMPARE(loader.isTypeLoaded(testFileUrl("ComponentWithIncubator.qml")), false); } -static void checkSingleton(const QString &dataDirectory) +void tst_QQMLTypeLoader::checkSingleton(const QString &dataDirectory) { QQmlEngine engine; engine.addImportPath(dataDirectory); @@ -179,8 +184,8 @@ static void checkSingleton(const QString &dataDirectory) "import QtQuick 2.6\n" "import \"..\"\n" "Item { property int t: ValueSource.something }", - QUrl::fromLocalFile(dataDirectory + "/abc/Xyz.qml")); - QCOMPARE(component.status(), QQmlComponent::Ready); + testFileUrl("abc/Xyz.qml")); + QVERIFY2(component.status() == QQmlComponent::Ready, qPrintable(component.errorString())); QScopedPointer<QObject> o(component.create()); QVERIFY(o.data()); QCOMPARE(o->property("t").toInt(), 10); @@ -402,6 +407,9 @@ public: void tst_QQMLTypeLoader::intercept() { +#ifdef Q_OS_ANDROID + QSKIP("Loading dynamic plugins does not work on Android"); +#endif qmlClearTypeRegistrations(); QQmlEngine engine; @@ -411,7 +419,7 @@ void tst_QQMLTypeLoader::intercept() UrlInterceptor interceptor; NetworkAccessManagerFactory factory; - engine.setUrlInterceptor(&interceptor); + engine.addUrlInterceptor(&interceptor); engine.setNetworkAccessManagerFactory(&factory); QQmlComponent component(&engine, testFileUrl("test_intercept.qml")); @@ -491,6 +499,9 @@ static void checkCleanCacheLoad(const QString &testCase) void tst_QQMLTypeLoader::multiSingletonModule() { +#ifdef Q_OS_ANDROID + QSKIP("Android seems to have problems with QProcess"); +#endif qmlClearTypeRegistrations(); QQmlEngine engine; engine.addImportPath(testFile("imports")); @@ -511,6 +522,9 @@ void tst_QQMLTypeLoader::multiSingletonModule() void tst_QQMLTypeLoader::implicitComponentModule() { +#ifdef Q_OS_ANDROID + QSKIP("Android seems to have problems with QProcess"); +#endif QQmlEngine engine; QQmlComponent component(&engine, testFileUrl("implicitcomponent.qml")); QCOMPARE(component.status(), QQmlComponent::Ready); diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro index 19834ff537..c868474b5b 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro @@ -15,3 +15,5 @@ QML_IMPORT_VERSION = 3.2 QML_IMPORT_NAME = "declarative.import.for.typeloader.test" include (../../shared/util.pri) + +TESTDATA = data/* diff --git a/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt b/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt new file mode 100644 index 0000000000..6af68cb1ce --- /dev/null +++ b/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmlvaluetypeproviders.pro. + +##################################################################### +## tst_qqmlvaluetypeproviders 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_qqmlvaluetypeproviders + SOURCES + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmlvaluetypeproviders.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlvaluetypeproviders CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlvaluetypeproviders CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt b/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt new file mode 100644 index 0000000000..0fc8045f38 --- /dev/null +++ b/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from qqmlvaluetypes.pro. + +##################################################################### +## tst_qqmlvaluetypes 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_qqmlvaluetypes + SOURCES + ../../shared/util.cpp ../../shared/util.h + testtypes.cpp testtypes.h + tst_qqmlvaluetypes.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qqmlvaluetypes.pro:<TRUE>: +# DISTFILES = "data/customvaluetype.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlvaluetypes CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlvaluetypes CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlvaluetypes/data/font_write.qml b/tests/auto/qml/qqmlvaluetypes/data/font_write.qml index ff4d0a1004..4d3ae32025 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/font_write.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/font_write.qml @@ -3,7 +3,7 @@ import Test 1.0 MyTypeObject { font.family: if(1) "Helvetica" font.bold: if(1) false - font.weight: "Normal" + font.weight: 50 font.italic: if(1) false font.underline: if(1) false font.overline: if(1) false diff --git a/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt b/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt new file mode 100644 index 0000000000..233a3aac62 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qqmlxmlhttprequest.pro. + +##################################################################### +## tst_qqmlxmlhttprequest 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_qqmlxmlhttprequest + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qqmlxmlhttprequest.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qqmlxmlhttprequest CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qqmlxmlhttprequest CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp index ae794e76a9..2c08c33fc8 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp +++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp @@ -1133,15 +1133,16 @@ void tst_qqmlxmlhttprequest::sendFileRequest() #if QT_CONFIG(process) void tst_qqmlxmlhttprequest::sendFileRequestNotSet() { if (qEnvironmentVariableIsSet("TEST_CUSTOM_PERMISSIONS")) { - // Test with no settings - // Should just result in warnings in Qt 5 - doFileRequest([](QObject* object, QTemporaryFile &writeFile) { - QTRY_COMPARE(object->property("readResult").toString(), testString); + // Test with no settings, neither reading nor writing should work + doFileRequest([](QObject *object, QTemporaryFile &writeFile) { + QTest::qWait(1000); - QTRY_VERIFY(object->property("writeDone").toBool()); + // Verify that the read has not yielded any value + QVERIFY(object->property("readResult").isNull()); + // Check that the file stays empty QVERIFY(writeFile.open()); - QCOMPARE(QString::fromUtf8(writeFile.readAll()), testString); + QCOMPARE(QString::fromUtf8(writeFile.readAll()), ""); writeFile.close(); }); return; @@ -1161,22 +1162,25 @@ void tst_qqmlxmlhttprequest::sendFileRequestNotSet() { // Check exit code QCOMPARE(child.exitCode(), 0); - // Check if all warnings were printed + // Check if all errors were printed QString output = QString::fromUtf8(child.readAllStandardOutput()); + // Due to differences in line endings on Windows, check for the error lines individually + const QStringList readingError = { + QLatin1String("XMLHttpRequest: Using GET on a local file is disabled by default."), + QLatin1String("Set QML_XHR_ALLOW_FILE_READ to 1 to enable this feature.") + }; - const QString readingWarning = QLatin1String( - "XMLHttpRequest: Using GET on a local file is dangerous " - "and will be disabled by default in a future Qt version." - "Set QML_XHR_ALLOW_FILE_READ to 1 if you wish to continue using this feature."); + const QStringList writingError = { + QLatin1String("XMLHttpRequest: Using PUT on a local file is disabled by default."), + QLatin1String("Set QML_XHR_ALLOW_FILE_WRITE to 1 to enable this feature.") + }; - const QString writingWarning = QLatin1String( - "XMLHttpRequest: Using PUT on a local file is dangerous " - "and will be disabled by default in a future Qt version." - "Set QML_XHR_ALLOW_FILE_WRITE to 1 if you wish to continue using this feature."); + for (const auto &readingErrorLine : readingError) + QVERIFY(output.contains(readingErrorLine)); - QVERIFY(output.contains(readingWarning)); - QVERIFY(output.contains(writingWarning)); + for (const auto &writingErrorLine : writingError) + QVERIFY(output.contains(writingErrorLine)); } #endif diff --git a/tests/auto/qml/qquickfolderlistmodel/.prev_CMakeLists.txt b/tests/auto/qml/qquickfolderlistmodel/.prev_CMakeLists.txt new file mode 100644 index 0000000000..b222e3db6d --- /dev/null +++ b/tests/auto/qml/qquickfolderlistmodel/.prev_CMakeLists.txt @@ -0,0 +1,53 @@ +# Generated from qquickfolderlistmodel.pro. + +##################################################################### +## tst_qquickfolderlistmodel 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_qquickfolderlistmodel + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickfolderlistmodel.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# Resources: +set(introspect_resource_files + "txtdir/hello.txt" +) + +qt_add_resource(tst_qquickfolderlistmodel "introspect" + PREFIX + "/myprefix/subdir" + BASE + "data" + FILES + ${introspect_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfolderlistmodel CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfolderlistmodel CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt b/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt new file mode 100644 index 0000000000..326f8245e9 --- /dev/null +++ b/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt @@ -0,0 +1,56 @@ +# Generated from qquickfolderlistmodel.pro. + +##################################################################### +## tst_qquickfolderlistmodel 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_qquickfolderlistmodel + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickfolderlistmodel.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +# special case begin +set_source_files_properties(data/txtdir/hello.txt PROPERTIES QT_RESOURCE_ALIAS "txtdir/hello.txt") +# special case end +# Resources: +set(introspect_resource_files + "txtdir/hello.txt" +) + +qt_add_resource(tst_qquickfolderlistmodel "introspect" + PREFIX + "/myprefix/subdir" + BASE + "data" + FILES + ${introspect_resource_files} +) + + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfolderlistmodel CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfolderlistmodel CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qquickworkerscript/CMakeLists.txt b/tests/auto/qml/qquickworkerscript/CMakeLists.txt new file mode 100644 index 0000000000..de9e45d662 --- /dev/null +++ b/tests/auto/qml/qquickworkerscript/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickworkerscript.pro. + +##################################################################### +## tst_qquickworkerscript 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_qquickworkerscript + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickworkerscript.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QmlWorkerScriptPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickworkerscript CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickworkerscript CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qrcqml/CMakeLists.txt b/tests/auto/qml/qrcqml/CMakeLists.txt new file mode 100644 index 0000000000..88e910ba05 --- /dev/null +++ b/tests/auto/qml/qrcqml/CMakeLists.txt @@ -0,0 +1,90 @@ +# Generated from qrcqml.pro. + +##################################################################### +## tst_qrcqml Test: +##################################################################### + +qt_add_test(tst_qrcqml + SOURCES + tst_qrcqml.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml +) + +# Resources: +set_source_files_properties("data/SameDir2.qml" + PROPERTIES QT_RESOURCE_ALIAS "SameDir.qml" +) +set_source_files_properties("data/importtest.qml" + PROPERTIES QT_RESOURCE_ALIAS "importtest.qml" +) +set_source_files_properties("data/main2.qml" + PROPERTIES QT_RESOURCE_ALIAS "main.qml" +) +set(qrcqml_resource_files + "data/SameDir.qml" + "data/SameDir2.qml" + "data/SubDir.qml" + "data/importtest.qml" + "data/main.qml" + "data/main2.qml" +) + +qt_add_resource(tst_qrcqml "qrcqml" + PREFIX + "/" + FILES + ${qrcqml_resource_files} +) +set_source_files_properties("data/SameDir3.qml" + PROPERTIES QT_RESOURCE_ALIAS "SameDir.qml" +) +set_source_files_properties("data/main3.qml" + PROPERTIES QT_RESOURCE_ALIAS "main.qml" +) +set(qrcqml1_resource_files + "data/SameDir3.qml" + "data/main3.qml" +) + +qt_add_resource(tst_qrcqml "qrcqml1" + PREFIX + "/search" + FILES + ${qrcqml1_resource_files} +) +set_source_files_properties("data/SubDir.qml" + PROPERTIES QT_RESOURCE_ALIAS "SubDir.qml" +) +set(qrcqml2_resource_files + "data/SubDir.qml" +) + +qt_add_resource(tst_qrcqml "qrcqml2" + PREFIX + "/search/data" + FILES + ${qrcqml2_resource_files} +) +set_source_files_properties("data/imports/QrcImport/Imported.qml" + PROPERTIES QT_RESOURCE_ALIAS "QrcImport/Imported.qml" +) +set_source_files_properties("data/imports/QrcImport/qmldir" + PROPERTIES QT_RESOURCE_ALIAS "QrcImport/qmldir" +) +set(qrcqml3_resource_files + "data/imports/QrcImport/Imported.qml" + "data/imports/QrcImport/qmldir" +) + +qt_add_resource(tst_qrcqml "qrcqml3" + PREFIX + "/imports" + FILES + ${qrcqml3_resource_files} +) + + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qtqmlmodules/CMakeLists.txt b/tests/auto/qml/qtqmlmodules/CMakeLists.txt new file mode 100644 index 0000000000..b42cb964b8 --- /dev/null +++ b/tests/auto/qml/qtqmlmodules/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from qtqmlmodules.pro. + +##################################################################### +## tst_qtqmlmodules 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_qtqmlmodules + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qtqmlmodules.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qtqmlmodules CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qtqmlmodules CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qv4assembler/CMakeLists.txt b/tests/auto/qml/qv4assembler/CMakeLists.txt new file mode 100644 index 0000000000..b54dd67816 --- /dev/null +++ b/tests/auto/qml/qv4assembler/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qv4assembler.pro. + +##################################################################### +## tst_qv4assembler 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_qv4assembler + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qv4assembler.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qv4assembler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qv4assembler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qv4identifiertable/CMakeLists.txt b/tests/auto/qml/qv4identifiertable/CMakeLists.txt new file mode 100644 index 0000000000..8606bb0d3a --- /dev/null +++ b/tests/auto/qml/qv4identifiertable/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qv4identifiertable.pro. + +##################################################################### +## tst_qv4identifiertable Test: +##################################################################### + +qt_add_test(tst_qv4identifiertable + SOURCES + tst_qv4identifiertable.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qv4mm/CMakeLists.txt b/tests/auto/qml/qv4mm/CMakeLists.txt new file mode 100644 index 0000000000..b319f36792 --- /dev/null +++ b/tests/auto/qml/qv4mm/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qv4mm.pro. + +##################################################################### +## tst_qv4mm 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_qv4mm + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qv4mm.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qv4mm CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qv4mm CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/qml/qv4regexp/CMakeLists.txt b/tests/auto/qml/qv4regexp/CMakeLists.txt new file mode 100644 index 0000000000..bba8314256 --- /dev/null +++ b/tests/auto/qml/qv4regexp/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qv4regexp.pro. + +##################################################################### +## tst_qv4regexp Test: +##################################################################### + +qt_add_test(tst_qv4regexp + SOURCES + tst_qv4regexp.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/qwidgetsinqml/CMakeLists.txt b/tests/auto/qml/qwidgetsinqml/CMakeLists.txt new file mode 100644 index 0000000000..2596f05930 --- /dev/null +++ b/tests/auto/qml/qwidgetsinqml/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qwidgetsinqml.pro. + +##################################################################### +## tst_qwidgetsinqml Test: +##################################################################### + +qt_add_test(tst_qwidgetsinqml + SOURCES + tst_qwidgetsinqml.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::Widgets +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qml/v4misc/CMakeLists.txt b/tests/auto/qml/v4misc/CMakeLists.txt new file mode 100644 index 0000000000..65a2d26139 --- /dev/null +++ b/tests/auto/qml/v4misc/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from v4misc.pro. + +##################################################################### +## tst_v4misc Test: +##################################################################### + +qt_add_test(tst_v4misc + SOURCES + tst_v4misc.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/qmldevtools/CMakeLists.txt b/tests/auto/qmldevtools/CMakeLists.txt new file mode 100644 index 0000000000..0a2ec8f18d --- /dev/null +++ b/tests/auto/qmldevtools/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from qmldevtools.pro. + +if(QT_FEATURE_private_tests) + add_subdirectory(compile) +endif() diff --git a/tests/auto/qmldevtools/compile/CMakeLists.txt b/tests/auto/qmldevtools/compile/CMakeLists.txt new file mode 100644 index 0000000000..d569135990 --- /dev/null +++ b/tests/auto/qmldevtools/compile/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from compile.pro. + +##################################################################### +## tst_compile Binary: +##################################################################### + +qt_add_executable(tst_compile + GUI + SOURCES + tst_compile.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlDevToolsPrivate +) + +#### Keys ignored in scope 1:.:.:compile.pro:<TRUE>: +# _OPTION = "host_build" + +## Scopes: +##################################################################### + +qt_extend_target(tst_compile CONDITION force_bootstrap + PUBLIC_LIBRARIES + Qt::BootstrapPrivate +) + +qt_extend_target(tst_compile CONDITION NOT force_bootstrap + PUBLIC_LIBRARIES + Qt::Core +) diff --git a/tests/auto/qmltest-blacklist/shortcut/CMakeLists.txt b/tests/auto/qmltest-blacklist/shortcut/CMakeLists.txt new file mode 100644 index 0000000000..0d2623d0d6 --- /dev/null +++ b/tests/auto/qmltest-blacklist/shortcut/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from shortcut.pro. + +##################################################################### +## shortcut Test: +##################################################################### + +qt_add_test(shortcut + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt new file mode 100644 index 0000000000..184c1c1216 --- /dev/null +++ b/tests/auto/qmltest/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from qmltest.pro. + +add_subdirectory(animatedimage) +add_subdirectory(animations) +add_subdirectory(borderimage) +add_subdirectory(buttonclick) +add_subdirectory(createbenchmark) +add_subdirectory(events) +add_subdirectory(fontloader) +add_subdirectory(gradient) +add_subdirectory(image) +add_subdirectory(itemgrabber) +add_subdirectory(layout) +add_subdirectory(listmodel) +add_subdirectory(listview) +add_subdirectory(objectmodel) +add_subdirectory(pathview) +add_subdirectory(pixel) +add_subdirectory(positioners) +add_subdirectory(qqmlbinding) +add_subdirectory(qtbug46798) +add_subdirectory(rectangle) +add_subdirectory(selftests) +add_subdirectory(shadersource) +add_subdirectory(stability) +add_subdirectory(statemachine) +add_subdirectory(text) +add_subdirectory(textedit) +add_subdirectory(textinput) +add_subdirectory(window) diff --git a/tests/auto/qmltest/animatedimage/CMakeLists.txt b/tests/auto/qmltest/animatedimage/CMakeLists.txt new file mode 100644 index 0000000000..d30d87316d --- /dev/null +++ b/tests/auto/qmltest/animatedimage/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from animatedimage.pro. + +##################################################################### +## animatedimage Test: +##################################################################### + +qt_add_test(animatedimage + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/animations/CMakeLists.txt b/tests/auto/qmltest/animations/CMakeLists.txt new file mode 100644 index 0000000000..d41f46ba1d --- /dev/null +++ b/tests/auto/qmltest/animations/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from animations.pro. + +##################################################################### +## animations Test: +##################################################################### + +qt_add_test(animations + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/borderimage/CMakeLists.txt b/tests/auto/qmltest/borderimage/CMakeLists.txt new file mode 100644 index 0000000000..08e23089b1 --- /dev/null +++ b/tests/auto/qmltest/borderimage/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from borderimage.pro. + +##################################################################### +## borderimage Test: +##################################################################### + +qt_add_test(borderimage + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/buttonclick/CMakeLists.txt b/tests/auto/qmltest/buttonclick/CMakeLists.txt new file mode 100644 index 0000000000..014372220c --- /dev/null +++ b/tests/auto/qmltest/buttonclick/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from buttonclick.pro. + +##################################################################### +## buttonclick Test: +##################################################################### + +qt_add_test(buttonclick + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/createbenchmark/CMakeLists.txt b/tests/auto/qmltest/createbenchmark/CMakeLists.txt new file mode 100644 index 0000000000..429f454b62 --- /dev/null +++ b/tests/auto/qmltest/createbenchmark/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from createbenchmark.pro. + +##################################################################### +## createbenchmark Test: +##################################################################### + +qt_add_test(createbenchmark + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/events/CMakeLists.txt b/tests/auto/qmltest/events/CMakeLists.txt new file mode 100644 index 0000000000..1382529616 --- /dev/null +++ b/tests/auto/qmltest/events/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from events.pro. + +##################################################################### +## events Test: +##################################################################### + +qt_add_test(events + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/fontloader/CMakeLists.txt b/tests/auto/qmltest/fontloader/CMakeLists.txt new file mode 100644 index 0000000000..7230785db7 --- /dev/null +++ b/tests/auto/qmltest/fontloader/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from fontloader.pro. + +##################################################################### +## fontloader Test: +##################################################################### + +qt_add_test(fontloader + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/fontloader/daniel.ttf b/tests/auto/qmltest/fontloader/daniel.ttf Binary files differnew file mode 100644 index 0000000000..aae50d5035 --- /dev/null +++ b/tests/auto/qmltest/fontloader/daniel.ttf diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml index 0d1831230e..48b92e02ba 100644 --- a/tests/auto/qmltest/fontloader/tst_fontloader.qml +++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml @@ -81,10 +81,6 @@ Item { fontloader.source = "dummy.ttf"; tryCompare(fontloader, 'status', FontLoader.Error) compare(testinput.font.family, "") - fontloader.source = ""; - fontloader.name = "Courier"; - tryCompare(fontloader, 'status', FontLoader.Ready) - compare(testinput.font.family, "Courier") } function test_fontswitching() { @@ -92,10 +88,9 @@ Item { fontswitch.source = "tarzeau_ocr_a.ttf"; tryCompare(fontswitch, 'status', FontLoader.Ready) compare(fontswitch.name, "OCRA") - fontswitch.source = ""; - fontswitch.name = "Courier"; + fontswitch.source = "daniel.ttf"; tryCompare(fontswitch, 'status', FontLoader.Ready) - compare(fontswitch.name, "Courier") + compare(fontswitch.name, "Daniel") fontswitch.source = "tarzeau_ocr_a.ttf"; tryCompare(fontswitch, 'status', FontLoader.Ready) compare(fontswitch.name, "OCRA") diff --git a/tests/auto/qmltest/gradient/CMakeLists.txt b/tests/auto/qmltest/gradient/CMakeLists.txt new file mode 100644 index 0000000000..c5341f4290 --- /dev/null +++ b/tests/auto/qmltest/gradient/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from gradient.pro. + +##################################################################### +## gradient Test: +##################################################################### + +qt_add_test(gradient + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/image/CMakeLists.txt b/tests/auto/qmltest/image/CMakeLists.txt new file mode 100644 index 0000000000..5d81076031 --- /dev/null +++ b/tests/auto/qmltest/image/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from image.pro. + +##################################################################### +## image Test: +##################################################################### + +qt_add_test(image + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/itemgrabber/CMakeLists.txt b/tests/auto/qmltest/itemgrabber/CMakeLists.txt new file mode 100644 index 0000000000..5570f31f49 --- /dev/null +++ b/tests/auto/qmltest/itemgrabber/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from itemgrabber.pro. + +##################################################################### +## itemgrabber Test: +##################################################################### + +qt_add_test(itemgrabber + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/layout/CMakeLists.txt b/tests/auto/qmltest/layout/CMakeLists.txt new file mode 100644 index 0000000000..e237397be4 --- /dev/null +++ b/tests/auto/qmltest/layout/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from layout.pro. + +##################################################################### +## layout Test: +##################################################################### + +qt_add_test(layout + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/listmodel/CMakeLists.txt b/tests/auto/qmltest/listmodel/CMakeLists.txt new file mode 100644 index 0000000000..29a60be7ae --- /dev/null +++ b/tests/auto/qmltest/listmodel/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from listmodel.pro. + +##################################################################### +## listmodel Test: +##################################################################### + +qt_add_test(listmodel + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/listview/CMakeLists.txt b/tests/auto/qmltest/listview/CMakeLists.txt new file mode 100644 index 0000000000..1eed3177d8 --- /dev/null +++ b/tests/auto/qmltest/listview/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from listview.pro. + +##################################################################### +## listview Test: +##################################################################### + +qt_add_test(listview + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:listview.pro:<TRUE>: +# DISTFILES = "$$PWD/tst_listview.qml" "$$PWD/data/*.qml" diff --git a/tests/auto/qmltest/objectmodel/CMakeLists.txt b/tests/auto/qmltest/objectmodel/CMakeLists.txt new file mode 100644 index 0000000000..ece17f4ac7 --- /dev/null +++ b/tests/auto/qmltest/objectmodel/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from objectmodel.pro. + +##################################################################### +## objectmodel Test: +##################################################################### + +qt_add_test(objectmodel + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/pathview/CMakeLists.txt b/tests/auto/qmltest/pathview/CMakeLists.txt new file mode 100644 index 0000000000..6f19715ba4 --- /dev/null +++ b/tests/auto/qmltest/pathview/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from pathview.pro. + +##################################################################### +## pathview Test: +##################################################################### + +qt_add_test(pathview + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/pixel/CMakeLists.txt b/tests/auto/qmltest/pixel/CMakeLists.txt new file mode 100644 index 0000000000..64ccfc207d --- /dev/null +++ b/tests/auto/qmltest/pixel/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from pixel.pro. + +##################################################################### +## pixel Test: +##################################################################### + +qt_add_test(pixel + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/positioners/CMakeLists.txt b/tests/auto/qmltest/positioners/CMakeLists.txt new file mode 100644 index 0000000000..909558211a --- /dev/null +++ b/tests/auto/qmltest/positioners/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from positioners.pro. + +##################################################################### +## positioners Test: +##################################################################### + +qt_add_test(positioners + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/qqmlbinding/CMakeLists.txt b/tests/auto/qmltest/qqmlbinding/CMakeLists.txt new file mode 100644 index 0000000000..a0731d6142 --- /dev/null +++ b/tests/auto/qmltest/qqmlbinding/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qqmlbinding.pro. + +##################################################################### +## qqmlbinding Test: +##################################################################### + +qt_add_test(qqmlbinding + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/qtbug46798/CMakeLists.txt b/tests/auto/qmltest/qtbug46798/CMakeLists.txt new file mode 100644 index 0000000000..a7367a1d87 --- /dev/null +++ b/tests/auto/qmltest/qtbug46798/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qtbug46798.pro. + +##################################################################### +## qtbug46798 Test: +##################################################################### + +qt_add_test(qtbug46798 + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/rectangle/CMakeLists.txt b/tests/auto/qmltest/rectangle/CMakeLists.txt new file mode 100644 index 0000000000..8bab0dd585 --- /dev/null +++ b/tests/auto/qmltest/rectangle/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from rectangle.pro. + +##################################################################### +## rectangle Test: +##################################################################### + +qt_add_test(rectangle + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/selftests/CMakeLists.txt b/tests/auto/qmltest/selftests/CMakeLists.txt new file mode 100644 index 0000000000..f37053982c --- /dev/null +++ b/tests/auto/qmltest/selftests/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from selftests.pro. + +##################################################################### +## selftests Test: +##################################################################### + +qt_add_test(selftests + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/shadersource/CMakeLists.txt b/tests/auto/qmltest/shadersource/CMakeLists.txt new file mode 100644 index 0000000000..169dfd6719 --- /dev/null +++ b/tests/auto/qmltest/shadersource/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from shadersource.pro. + +##################################################################### +## shadersource Test: +##################################################################### + +qt_add_test(shadersource + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/stability/CMakeLists.txt b/tests/auto/qmltest/stability/CMakeLists.txt new file mode 100644 index 0000000000..1f0d780403 --- /dev/null +++ b/tests/auto/qmltest/stability/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from stability.pro. + +##################################################################### +## stability Test: +##################################################################### + +qt_add_test(stability + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/statemachine/CMakeLists.txt b/tests/auto/qmltest/statemachine/CMakeLists.txt new file mode 100644 index 0000000000..fafaf382d8 --- /dev/null +++ b/tests/auto/qmltest/statemachine/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from statemachine.pro. + +##################################################################### +## statemachine Test: +##################################################################### + +qt_add_test(statemachine + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/text/CMakeLists.txt b/tests/auto/qmltest/text/CMakeLists.txt new file mode 100644 index 0000000000..8c25292dbd --- /dev/null +++ b/tests/auto/qmltest/text/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from text.pro. + +##################################################################### +## text Test: +##################################################################### + +qt_add_test(text + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/textedit/CMakeLists.txt b/tests/auto/qmltest/textedit/CMakeLists.txt new file mode 100644 index 0000000000..7f257c6123 --- /dev/null +++ b/tests/auto/qmltest/textedit/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from textedit.pro. + +##################################################################### +## textedit Test: +##################################################################### + +qt_add_test(textedit + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/textinput/CMakeLists.txt b/tests/auto/qmltest/textinput/CMakeLists.txt new file mode 100644 index 0000000000..07df991c58 --- /dev/null +++ b/tests/auto/qmltest/textinput/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from textinput.pro. + +##################################################################### +## textinput Test: +##################################################################### + +qt_add_test(textinput + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/qmltest/textinput/tst_textinput.qml b/tests/auto/qmltest/textinput/tst_textinput.qml index b8f66a2e72..584b19af9d 100644 --- a/tests/auto/qmltest/textinput/tst_textinput.qml +++ b/tests/auto/qmltest/textinput/tst_textinput.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.14 import QtTest 1.1 Item { @@ -118,7 +118,7 @@ Item { text: "" height: 20 width: 50 - validator: RegExpValidator { id: rv; regExp: /[a-z]{3}/ } + validator: RegularExpressionValidator { id: rv; regularExpression: /[a-z]{3}/ } } @@ -316,7 +316,7 @@ Item { } function test_regexpvalidators(row) { - compare(txtregexpvalidator.validator.regExp, /[a-z]{3}/) + compare(txtregexpvalidator.validator.regularExpression, /[a-z]{3}/) txtregexpvalidator.text = row.testtext; compare(txtregexpvalidator.acceptableInput, row.acceptable) } diff --git a/tests/auto/qmltest/window/CMakeLists.txt b/tests/auto/qmltest/window/CMakeLists.txt new file mode 100644 index 0000000000..584b182713 --- /dev/null +++ b/tests/auto/qmltest/window/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from window.pro. + +##################################################################### +## window Test: +##################################################################### + +qt_add_test(window + GUI + QMLTEST + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/quick/.prev_CMakeLists.txt b/tests/auto/quick/.prev_CMakeLists.txt new file mode 100644 index 0000000000..488150c61c --- /dev/null +++ b/tests/auto/quick/.prev_CMakeLists.txt @@ -0,0 +1,68 @@ +# Generated from quick.pro. + +add_subdirectory(geometry) +add_subdirectory(qquickpixmapcache) +if(QT_FEATURE_private_tests) + add_subdirectory(nokeywords) + add_subdirectory(propertyrequirements) + add_subdirectory(qquickanimations) + add_subdirectory(qquickapplication) + add_subdirectory(qquickbehaviors) + add_subdirectory(qquickboundaryrule) + add_subdirectory(qquickfontloader) + add_subdirectory(qquickfontloader_static) + add_subdirectory(qquickfontmetrics) + add_subdirectory(qquickimageprovider) + add_subdirectory(qquicklayouts) + add_subdirectory(qquickpath) + add_subdirectory(qquicksmoothedanimation) + add_subdirectory(qquickspringanimation) + add_subdirectory(qquickanimationcontroller) + add_subdirectory(qquickstyledtext) + add_subdirectory(qquickstates) + add_subdirectory(qquicksystempalette) + add_subdirectory(qquicktimeline) + add_subdirectory(pointerhandlers) + add_subdirectory(qquickaccessible) + add_subdirectory(qquickanchors) + add_subdirectory(qquickanimatedimage) + add_subdirectory(qquickdynamicpropertyanimation) + add_subdirectory(qquickborderimage) + add_subdirectory(qquickwindow) + add_subdirectory(qquickdrag) + add_subdirectory(qquickdroparea) + add_subdirectory(qquickflickable) + add_subdirectory(qquickflipable) + add_subdirectory(qquickfocusscope) + add_subdirectory(qquickgraphicsinfo) + add_subdirectory(qquickgridview) + add_subdirectory(qquickimage) + add_subdirectory(qquickitem) + add_subdirectory(qquickitem2) + add_subdirectory(qquickitemlayer) + add_subdirectory(qquicklistview) + add_subdirectory(qquicktableview) + add_subdirectory(qquickloader) + add_subdirectory(qquickmousearea) + add_subdirectory(qquickmultipointtoucharea) + add_subdirectory(qquickpainteditem) + add_subdirectory(qquickshape) + add_subdirectory(qquickpathview) + add_subdirectory(qquickpincharea) + add_subdirectory(qquickpositioners) + add_subdirectory(qquickrectangle) + add_subdirectory(qquickrepeater) + add_subdirectory(qquickshortcut) + add_subdirectory(qquicktext) + add_subdirectory(qquicktextdocument) + add_subdirectory(qquicktextedit) + add_subdirectory(qquicktextinput) + add_subdirectory(qquickvisualdatamodel) + add_subdirectory(qquickview) + add_subdirectory(qquickcanvasitem) + add_subdirectory(qquickdesignersupport) + add_subdirectory(qquickscreen) + add_subdirectory(touchmouse) + add_subdirectory(scenegraph) + add_subdirectory(sharedimage) +endif() diff --git a/tests/auto/quick/CMakeLists.txt b/tests/auto/quick/CMakeLists.txt new file mode 100644 index 0000000000..6cb3c23334 --- /dev/null +++ b/tests/auto/quick/CMakeLists.txt @@ -0,0 +1,70 @@ +# Generated from quick.pro. + +add_subdirectory(geometry) +add_subdirectory(qquickpixmapcache) +if(QT_FEATURE_private_tests) + add_subdirectory(nokeywords) + add_subdirectory(propertyrequirements) + add_subdirectory(qquickanimations) + add_subdirectory(qquickapplication) + add_subdirectory(qquickbehaviors) + add_subdirectory(qquickboundaryrule) + add_subdirectory(qquickfontloader) + add_subdirectory(qquickfontloader_static) + add_subdirectory(qquickfontmetrics) + add_subdirectory(qquickimageprovider) + add_subdirectory(qquicklayouts) + add_subdirectory(qquickpath) + add_subdirectory(qquicksmoothedanimation) + add_subdirectory(qquickspringanimation) + add_subdirectory(qquickanimationcontroller) + add_subdirectory(qquickstyledtext) + add_subdirectory(qquickstates) + add_subdirectory(qquicksystempalette) + add_subdirectory(qquicktimeline) + # add_subdirectory(pointerhandlers) # skip building until fixed in dev # special case + add_subdirectory(qquickaccessible) + add_subdirectory(qquickanchors) + add_subdirectory(qquickanimatedimage) + add_subdirectory(qquickdynamicpropertyanimation) + add_subdirectory(qquickborderimage) + add_subdirectory(qquickwindow) + add_subdirectory(qquickdrag) + add_subdirectory(qquickdroparea) + add_subdirectory(qquickflickable) + add_subdirectory(qquickflipable) + add_subdirectory(qquickfocusscope) + add_subdirectory(qquickgraphicsinfo) + add_subdirectory(qquickgridview) + add_subdirectory(qquickimage) + add_subdirectory(qquickitem) + add_subdirectory(qquickitem2) + add_subdirectory(qquickitemlayer) + add_subdirectory(qquicklistview) + add_subdirectory(qquicktableview) + add_subdirectory(qquickloader) + add_subdirectory(qquickmousearea) + # add_subdirectory(qquickmultipointtoucharea) # skip building until fixed in dev # special case + add_subdirectory(qquickpainteditem) + add_subdirectory(qquickshape) + add_subdirectory(qquickpathview) + add_subdirectory(qquickpincharea) + add_subdirectory(qquickpositioners) + add_subdirectory(qquickrectangle) + add_subdirectory(qquickrepeater) + add_subdirectory(qquickshortcut) + add_subdirectory(qquicktext) + add_subdirectory(qquicktextdocument) + add_subdirectory(qquicktextedit) + add_subdirectory(qquicktextinput) + add_subdirectory(qquickvisualdatamodel) + add_subdirectory(qquickview) + add_subdirectory(qquickcanvasitem) + add_subdirectory(qquickdesignersupport) + add_subdirectory(qquickscreen) + # add_subdirectory(touchmouse) # skip building until fixed in dev # special case + add_subdirectory(scenegraph) + add_subdirectory(sharedimage) + add_subdirectory(qquickcolorgroup) + add_subdirectory(qquickpalette) +endif() diff --git a/tests/auto/quick/drawingmodes/CMakeLists.txt b/tests/auto/quick/drawingmodes/CMakeLists.txt new file mode 100644 index 0000000000..e225df5424 --- /dev/null +++ b/tests/auto/quick/drawingmodes/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from drawingmodes.pro. + +##################################################################### +## tst_drawingmodes 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_drawingmodes + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_drawingmodes.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Quick + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:drawingmodes.pro:<TRUE>: +# OTHER_FILES = "data/DrawingModes.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_drawingmodes CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_drawingmodes CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp index 5d69bf3b21..e982410f89 100644 --- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp +++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp @@ -34,7 +34,7 @@ #include <QtQuick/qsggeometry.h> #include <QtQuick/qsgflatcolormaterial.h> #include <QtGui/qscreen.h> -#include <QtGui/qopenglcontext.h> +#include <qopenglcontext.h> #include "../../shared/util.h" diff --git a/tests/auto/quick/examples/CMakeLists.txt b/tests/auto/quick/examples/CMakeLists.txt new file mode 100644 index 0000000000..74efa0ad40 --- /dev/null +++ b/tests/auto/quick/examples/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from examples.pro. + +##################################################################### +## tst_examples Test: +##################################################################### + +qt_add_test(tst_examples + SOURCES + tst_examples.cpp + DEFINES + SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +#### Keys ignored in scope 1:.:.:examples.pro:<TRUE>: +# testcase.timeout = "400" + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/geometry/CMakeLists.txt b/tests/auto/quick/geometry/CMakeLists.txt new file mode 100644 index 0000000000..5a791a8a9e --- /dev/null +++ b/tests/auto/quick/geometry/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from geometry.pro. + +##################################################################### +## tst_geometry Test: +##################################################################### + +qt_add_test(tst_geometry + SOURCES + tst_geometry.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/nodes/CMakeLists.txt b/tests/auto/quick/nodes/CMakeLists.txt new file mode 100644 index 0000000000..825442479f --- /dev/null +++ b/tests/auto/quick/nodes/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from nodes.pro. + +##################################################################### +## tst_nodestest Test: +##################################################################### + +qt_add_test(tst_nodestest + SOURCES + tst_nodestest.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/nodes/tst_nodestest.cpp b/tests/auto/quick/nodes/tst_nodestest.cpp index 249ecd5aa5..1b2b355596 100644 --- a/tests/auto/quick/nodes/tst_nodestest.cpp +++ b/tests/auto/quick/nodes/tst_nodestest.cpp @@ -30,7 +30,7 @@ #include <QtTest/QtTest> #include <QtGui/QOffscreenSurface> -#include <QtGui/QOpenGLContext> +#include <QOpenGLContext> #include <QtQuick/qsgnode.h> #include <QtQuick/private/qsgbatchrenderer_p.h> #include <QtQuick/private/qsgnodeupdater_p.h> diff --git a/tests/auto/quick/nokeywords/CMakeLists.txt b/tests/auto/quick/nokeywords/CMakeLists.txt new file mode 100644 index 0000000000..bdf29817c0 --- /dev/null +++ b/tests/auto/quick/nokeywords/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from nokeywords.pro. + +##################################################################### +## tst_nokeywords Test: +##################################################################### + +qt_add_test(tst_nokeywords + SOURCES + tst_nokeywords.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::Quick + Qt::QuickPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_nokeywords CONDITION QT_FEATURE_opengl + LIBRARIES + Qt::OpenGLPrivate +) diff --git a/tests/auto/quick/nokeywords/nokeywords.pro b/tests/auto/quick/nokeywords/nokeywords.pro index 6872dac22a..69e1abe43e 100644 --- a/tests/auto/quick/nokeywords/nokeywords.pro +++ b/tests/auto/quick/nokeywords/nokeywords.pro @@ -7,3 +7,5 @@ SOURCES += tst_nokeywords.cpp CONFIG+=parallel_test QT += quick core-private gui-private qml-private quick-private testlib +qtConfig(opengl): \ + QT_PRIVATE += opengl-private diff --git a/tests/auto/quick/pointerhandlers/CMakeLists.txt b/tests/auto/quick/pointerhandlers/CMakeLists.txt new file mode 100644 index 0000000000..f8ac22d531 --- /dev/null +++ b/tests/auto/quick/pointerhandlers/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from pointerhandlers.pro. + +if(QT_FEATURE_private_tests) + add_subdirectory(flickableinterop) + add_subdirectory(mousearea_interop) + add_subdirectory(multipointtoucharea_interop) + add_subdirectory(qquickdraghandler) + add_subdirectory(qquickhoverhandler) + add_subdirectory(qquickpinchhandler) + add_subdirectory(qquickpointerhandler) + add_subdirectory(qquickpointhandler) + add_subdirectory(qquicktaphandler) + add_subdirectory(qquickwheelhandler) +endif() diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt b/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt new file mode 100644 index 0000000000..0d6cc7b58b --- /dev/null +++ b/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from flickableinterop.pro. + +##################################################################### +## tst_flickableinterop 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_flickableinterop + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_flickableinterop.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:flickableinterop.pro:<TRUE>: +# OTHER_FILES = "data/flickableWithHandlers.qml" "data/Slider.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_flickableinterop CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_flickableinterop CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt new file mode 100644 index 0000000000..8868ccdbbc --- /dev/null +++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from multipointtoucharea_interop.pro. + +##################################################################### +## tst_multipointtoucharea_interop 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_multipointtoucharea_interop + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_multipointtoucharea_interop.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:multipointtoucharea_interop.pro:<TRUE>: +# OTHER_FILES = "data/pinchDragMPTA.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_multipointtoucharea_interop CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_multipointtoucharea_interop CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt new file mode 100644 index 0000000000..825260f53d --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickdraghandler.pro. + +##################################################################### +## tst_qquickdraghandler 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_qquickdraghandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickdraghandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickdraghandler.pro:<TRUE>: +# OTHER_FILES = "data/DragAnywhereSlider.qml" "data/FlashAnimation.qml" "data/Slider.qml" "data/draggables.qml" "data/grabberstate.qml" "data/multipleSliders.qml" "data/reparenting.qml" "data/snapMode.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickdraghandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickdraghandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/BLACKLIST b/tests/auto/quick/pointerhandlers/qquickhoverhandler/BLACKLIST new file mode 100644 index 0000000000..9bb35c4770 --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/BLACKLIST @@ -0,0 +1,3 @@ +[movingItemWithHoverHandler] +macos # Can't move cursor (QTBUG-76312) + diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt new file mode 100644 index 0000000000..7ff86c7c6e --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickhoverhandler.pro. + +##################################################################### +## tst_qquickhoverhandler 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_qquickhoverhandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickhoverhandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickhoverhandler.pro:<TRUE>: +# OTHER_FILES = "data/lesHoverables.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickhoverhandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickhoverhandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt new file mode 100644 index 0000000000..110948c4ee --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickpinchhandler.pro. + +##################################################################### +## tst_qquickpinchhandler 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_qquickpinchhandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickpinchhandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickpinchhandler.pro:<TRUE>: +# OTHER_FILES = "data/pinchproperties.qml" "data/threeFingers.qml" "data/transformedPinchArea.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpinchhandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpinchhandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt new file mode 100644 index 0000000000..7da285b4ce --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickpointerhandler.pro. + +##################################################################### +## tst_qquickpointerhandler 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_qquickpointerhandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickpointerhandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpointerhandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpointerhandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt new file mode 100644 index 0000000000..51312f1db3 --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickpointhandler.pro. + +##################################################################### +## tst_qquickpointhandler 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_qquickpointhandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickpointhandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickpointhandler.pro:<TRUE>: +# OTHER_FILES = "data/pointTracker.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpointhandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpointhandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt new file mode 100644 index 0000000000..97c8106931 --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquicktaphandler.pro. + +##################################################################### +## tst_qquicktaphandler 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_qquicktaphandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquicktaphandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktaphandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktaphandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST b/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST new file mode 100644 index 0000000000..2949d3371f --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST @@ -0,0 +1,3 @@ +# QTBUG-81993 +[singleHandler] +macos ci diff --git a/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt new file mode 100644 index 0000000000..32d7ce9398 --- /dev/null +++ b/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickwheelhandler.pro. + +##################################################################### +## tst_qquickwheelhandler 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_qquickwheelhandler + SOURCES + ../../../shared/util.cpp ../../../shared/util.h + ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h + ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h + ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h + tst_qquickwheelhandler.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickwheelhandler.pro:<TRUE>: +# OTHER_FILES = "data/rectWheel.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickwheelhandler CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickwheelhandler CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/propertyrequirements/CMakeLists.txt b/tests/auto/quick/propertyrequirements/CMakeLists.txt new file mode 100644 index 0000000000..2a37646920 --- /dev/null +++ b/tests/auto/quick/propertyrequirements/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from propertyrequirements.pro. + +##################################################################### +## tst_propertyrequirements Test: +##################################################################### + +qt_add_test(tst_propertyrequirements + SOURCES + tst_propertyrequirements.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::QmlPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickaccessible/CMakeLists.txt b/tests/auto/quick/qquickaccessible/CMakeLists.txt new file mode 100644 index 0000000000..e6a34e0d3f --- /dev/null +++ b/tests/auto/quick/qquickaccessible/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from qquickaccessible.pro. + +##################################################################### +## tst_qquickaccessible 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_qquickaccessible + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickaccessible.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickaccessible.pro:<TRUE>: +# OTHER_FILES = "data/checkbuttons.qml" "data/hittest.qml" "data/pushbutton.qml" "data/statictext.qml" "data/ignored.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickaccessible CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickaccessible CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickanchors/CMakeLists.txt b/tests/auto/quick/qquickanchors/CMakeLists.txt new file mode 100644 index 0000000000..04065b9057 --- /dev/null +++ b/tests/auto/quick/qquickanchors/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickanchors.pro. + +##################################################################### +## tst_qquickanchors 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_qquickanchors + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickanchors.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickanchors CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickanchors CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickanimatedimage/CMakeLists.txt b/tests/auto/quick/qquickanimatedimage/CMakeLists.txt new file mode 100644 index 0000000000..ea18c9b5a5 --- /dev/null +++ b/tests/auto/quick/qquickanimatedimage/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from qquickanimatedimage.pro. + +##################################################################### +## tst_qquickanimatedimage 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_qquickanimatedimage + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qquickanimatedimage.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickanimatedimage CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickanimatedimage CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt b/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt new file mode 100644 index 0000000000..3165a91673 --- /dev/null +++ b/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickanimatedsprite.pro. + +##################################################################### +## tst_qquickanimatedsprite 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_qquickanimatedsprite + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickanimatedsprite.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickanimatedsprite.pro:<TRUE>: +# OTHER_FILES = "data/*.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickanimatedsprite CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickanimatedsprite CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp index 9f616c56e2..47d6008c28 100644 --- a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp +++ b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp @@ -34,8 +34,8 @@ #include <private/qquickitem_p.h> #include <QtCore/qscopedpointer.h> #include <QtGui/qpainter.h> -#include <QtGui/qopenglcontext.h> -#include <QtGui/qopenglfunctions.h> +#include <qopenglcontext.h> +#include <qopenglfunctions.h> #include <QtGui/qoffscreensurface.h> #include <QtQml/qqmlproperty.h> diff --git a/tests/auto/quick/qquickanimationcontroller/CMakeLists.txt b/tests/auto/quick/qquickanimationcontroller/CMakeLists.txt new file mode 100644 index 0000000000..f958f9272e --- /dev/null +++ b/tests/auto/quick/qquickanimationcontroller/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from qquickanimationcontroller.pro. + +##################################################################### +## tst_qquickanimationcontroller 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_qquickanimationcontroller + GUI + QMLTEST + SOURCES + tst_qquickanimationcontroller.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickanimationcontroller.pro:<TRUE>: +# TEMPLATE = "app" diff --git a/tests/auto/quick/qquickanimations/BLACKLIST b/tests/auto/quick/qquickanimations/BLACKLIST new file mode 100644 index 0000000000..a1b8557128 --- /dev/null +++ b/tests/auto/quick/qquickanimations/BLACKLIST @@ -0,0 +1,2 @@ +[simplePath] +macos ci diff --git a/tests/auto/quick/qquickanimations/CMakeLists.txt b/tests/auto/quick/qquickanimations/CMakeLists.txt new file mode 100644 index 0000000000..e0f9d38f90 --- /dev/null +++ b/tests/auto/quick/qquickanimations/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquickanimations.pro. + +##################################################################### +## tst_qquickanimations 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_qquickanimations + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickanimations.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickanimations.pro:<TRUE>: +# OTHER_FILES = "data/animationJobSelfDestructionBug.qml" "data/attached.qml" "data/badproperty1.qml" "data/badproperty2.qml" "data/badtype1.qml" "data/badtype2.qml" "data/badtype3.qml" "data/badtype4.qml" "data/disabledTransition.qml" "data/dontAutoStart.qml" "data/dontStart.qml" "data/dontStart2.qml" "data/dotproperty.qml" "data/Double.qml" "data/doubleRegistrationBug.qml" "data/fastFlickingBug.qml" "data/looping.qml" "data/mixedtype1.qml" "data/mixedtype2.qml" "data/nonTransitionBug.qml" "data/parallelAnimationNullChildBug.qml" "data/pathAnimation.qml" "data/pathAnimation2.qml" "data/pathAnimationInOutBackCrash.qml" "data/pathAnimationNoStart.qml" "data/pathInterpolator.qml" "data/pathInterpolatorBack.qml" "data/pathInterpolatorBack2.qml" "data/pathTransition.qml" "data/pauseBindingBug.qml" "data/pauseBug.qml" "data/properties.qml" "data/properties2.qml" "data/properties3.qml" "data/properties4.qml" "data/properties5.qml" "data/propertiesTransition.qml" "data/propertiesTransition2.qml" "data/propertiesTransition3.qml" "data/propertiesTransition4.qml" "data/propertiesTransition5.qml" "data/propertiesTransition6.qml" "data/propertiesTransition7.qml" "data/reanchor.qml" "data/registrationBug.qml" "data/reparent.qml" "data/rotation.qml" "data/runningTrueBug.qml" "data/scriptActionBug.qml" "data/scriptActionCrash.qml" "data/sequentialAnimationNullChildBug.qml" "data/signals.qml" "data/transitionAssignmentBug.qml" "data/valuesource.qml" "data/valuesource2.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickanimations CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickanimations CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickanimators/CMakeLists.txt b/tests/auto/quick/qquickanimators/CMakeLists.txt new file mode 100644 index 0000000000..e0a9fa9029 --- /dev/null +++ b/tests/auto/quick/qquickanimators/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qquickanimators.pro. + +##################################################################### +## tst_qquickanimators Test: +##################################################################### + +qt_add_test(tst_qquickanimators + SOURCES + tst_qquickanimators.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickapplication/CMakeLists.txt b/tests/auto/quick/qquickapplication/CMakeLists.txt new file mode 100644 index 0000000000..b26bb64b09 --- /dev/null +++ b/tests/auto/quick/qquickapplication/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickapplication.pro. + +##################################################################### +## tst_qquickapplication 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_qquickapplication + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickapplication.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate + Qt::Quick + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickapplication.pro:<TRUE>: +# OTHER_FILES = "data/tst_displayname.qml" "data/tst_platformname.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickapplication CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickapplication CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickbehaviors/CMakeLists.txt b/tests/auto/quick/qquickbehaviors/CMakeLists.txt new file mode 100644 index 0000000000..f305fb030f --- /dev/null +++ b/tests/auto/quick/qquickbehaviors/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickbehaviors.pro. + +##################################################################### +## tst_qquickbehaviors 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_qquickbehaviors + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickbehaviors.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickbehaviors.pro:<TRUE>: +# DISTFILES = "data/*" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickbehaviors CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickbehaviors CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickborderimage/CMakeLists.txt b/tests/auto/quick/qquickborderimage/CMakeLists.txt new file mode 100644 index 0000000000..9bcb99befa --- /dev/null +++ b/tests/auto/quick/qquickborderimage/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qquickborderimage.pro. + +##################################################################### +## tst_qquickborderimage 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_qquickborderimage + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickborderimage.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickborderimage CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickborderimage CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickboundaryrule/CMakeLists.txt b/tests/auto/quick/qquickboundaryrule/CMakeLists.txt new file mode 100644 index 0000000000..5fc6d1c2f0 --- /dev/null +++ b/tests/auto/quick/qquickboundaryrule/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquickboundaryrule.pro. + +##################################################################### +## tst_qquickboundaryrule 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_qquickboundaryrule + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickboundaryrule.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickboundaryrule CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickboundaryrule CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickcanvasitem/CMakeLists.txt b/tests/auto/quick/qquickcanvasitem/CMakeLists.txt new file mode 100644 index 0000000000..0c935891b4 --- /dev/null +++ b/tests/auto/quick/qquickcanvasitem/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from qquickcanvasitem.pro. + +##################################################################### +## tst_qquickcanvasitem 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_qquickcanvasitem + GUI + QMLTEST + SOURCES + tst_qquickcanvasitem.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickcanvasitem.pro:<TRUE>: +# OTHER_FILES = "data/tst_transform.qml" "data/tst_text.qml" "data/tst_strokeStyle.qml" "data/tst_state.qml" "data/tst_shadow.qml" "data/tst_pattern.qml" "data/tst_path.qml" "data/tst_line.qml" "data/tst_fillStyle.qml" "data/tst_fillrect.qml" "data/tst_composite.qml" "data/tst_canvas.qml" "data/tst_pixel.qml" "data/tst_gradient.qml" "data/tst_arcto.qml" "data/tst_arc.qml" "data/tst_context.qml" "data/tst_imagedata.qml" "data/CanvasTestCase.qml" "data/CanvasComponent.qml" "data/tst_image.qml" "data/tst_svgpath.qml" "data/anim-gr.gif" "data/anim-gr.png" "data/anim-poster-gr.png" "data/background.png" "data/broken.png" "data/ggrr-256x256.png" "data/green-1x1.png" "data/green-2x2.png" "data/green-16x16.png" "data/green-256x256.png" "data/green.png" "data/grgr-256x256.png" "data/red-16x16.png" "data/red.png" "data/redtransparent.png" "data/rgrg-256x256.png" "data/rrgg-256x256.png" "data/transparent.png" "data/transparent50.png" "data/yellow.png" "data/yellow75.png" "data/tst_invalidContext.qml" +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickcanvasitem CONDITION EXISTS _ss_[QT_INSTALL_PLUGINS]/imageformats + DEFINES + HAS_IMAGE_FORMATS +) diff --git a/tests/auto/quick/qquickcolorgroup/CMakeLists.txt b/tests/auto/quick/qquickcolorgroup/CMakeLists.txt new file mode 100644 index 0000000000..99506fc24d --- /dev/null +++ b/tests/auto/quick/qquickcolorgroup/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_add_test(tst_qquickcolorgroup + SOURCES + tst_qquickcolorgroup.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate + Qt::QuickPrivate +) diff --git a/tests/auto/quick/qquickcolorgroup/qquickcolorgroup.pro b/tests/auto/quick/qquickcolorgroup/qquickcolorgroup.pro new file mode 100644 index 0000000000..99c330199c --- /dev/null +++ b/tests/auto/quick/qquickcolorgroup/qquickcolorgroup.pro @@ -0,0 +1,7 @@ +CONFIG += testcase +TARGET = tst_qquickcolorgroup +SOURCES += tst_qquickcolorgroup.cpp + +macos:CONFIG -= app_bundle + +QT += core-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickcolorgroup/tst_qquickcolorgroup.cpp b/tests/auto/quick/qquickcolorgroup/tst_qquickcolorgroup.cpp new file mode 100644 index 0000000000..04cc81683c --- /dev/null +++ b/tests/auto/quick/qquickcolorgroup/tst_qquickcolorgroup.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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:LGPL$ +** 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. +** +** 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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/qtest.h> +#include <QtTest/QSignalSpy> + +#include <QtGui/QPalette> + +#include <QtQuick/private/qquickcolorgroup_p.h> + +class tst_QQuickColorGroup : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void checkColorProperty(); + void checkColorProperty_data(); + + void colorGroupChangedWhenColorChanged(); +}; + +void tst_QQuickColorGroup::checkColorProperty() +{ + QFETCH(int, propertyIndex); + + auto property = QQuickColorGroup::staticMetaObject.property(propertyIndex); + + QVERIFY(property.isReadable()); + QVERIFY(property.isWritable()); + QVERIFY(property.isResettable()); + QVERIFY(property.hasNotifySignal()); + + const QQuickColorGroup defaultGroup; + QQuickColorGroup group; + + auto notifierSignature = QString::number(QSIGNAL_CODE) + property.notifySignal().methodSignature(); + QSignalSpy sp(&group, notifierSignature.toUtf8()); + + QVERIFY(property.write(&group, QColor(Qt::red))); + + QCOMPARE(qvariant_cast<QColor>(property.read(&group)), QColor(Qt::red)); + + QVERIFY(property.reset(&group)); + + QCOMPARE(qvariant_cast<QColor>(property.read(&group)), + qvariant_cast<QColor>(property.read(&defaultGroup))); + + constexpr int expectedNotificationsCount = 2; // One from write + one from reset + QCOMPARE(sp.count(), expectedNotificationsCount); +} + +void tst_QQuickColorGroup::checkColorProperty_data() +{ + QTest::addColumn<int>("propertyIndex"); + + auto mo = QQuickColorGroup::staticMetaObject; + for (int i = mo.propertyOffset(); i < mo.propertyCount(); ++i) { + auto property = mo.property(i); + if (property.type() == QVariant::Color) { + QTest::addRow("%s", property.name()) << i; + } + } +} + +void tst_QQuickColorGroup::colorGroupChangedWhenColorChanged() +{ + QQuickColorGroup group; + group.setGroupTag(QPalette::Active); + + QSignalSpy sp(&group, &QQuickColorGroup::changed); + + QVERIFY(group.mid() != Qt::blue); + + group.setMid(Qt::blue); + + QCOMPARE(sp.count(), 1); +} + +QTEST_MAIN(tst_QQuickColorGroup) + +#include "tst_qquickcolorgroup.moc" diff --git a/tests/auto/quick/qquickdesignersupport/CMakeLists.txt b/tests/auto/quick/qquickdesignersupport/CMakeLists.txt new file mode 100644 index 0000000000..4ce3896d23 --- /dev/null +++ b/tests/auto/quick/qquickdesignersupport/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickdesignersupport.pro. + +##################################################################### +## tst_qquickdesignersupport 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_qquickdesignersupport + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickdesignersupport.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickdesignersupport.pro:<TRUE>: +# DISTFILES = "data/TestComponent.qml" "data/test.qml" "data/componentTest.qml" "data/Component01.qml" "data/Component02.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickdesignersupport CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickdesignersupport CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp index b44977bd5a..a4ef25be92 100644 --- a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp +++ b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp @@ -76,7 +76,10 @@ void tst_qquickdesignersupport::customData() QVERIFY(rootItem); - QScopedPointer<QObject> newItemScopedPointer(QQuickDesignerSupportItems::createPrimitive(QLatin1String("QtQuick/Item"), 2, 6, view->rootContext())); + QScopedPointer<QObject> newItemScopedPointer(QQuickDesignerSupportItems::createPrimitive( + QLatin1String("QtQuick/Item"), + QTypeRevision::fromVersion(2, 6), + view->rootContext())); QObject *newItem = newItemScopedPointer.data(); QVERIFY(newItem); @@ -458,9 +461,14 @@ void tst_qquickdesignersupport::testNotifyPropertyChangeCallBack() QCOMPARE(s_propertyName, QQuickDesignerSupport::PropertyName("gradient")); } +// We have to use this ugly approach, because the signature of +// registerFixResourcePathsForObjectCallBack doesn't accept +// a proper lambda with a capture list +static QVector<QObject*> s_allSubObjects; + static void fixResourcePathsForObjectCallBackFunction(QObject *object) { - s_object = object; + s_allSubObjects << object; } static void (*fixResourcePathsForObjectCallBackPointer)(QObject *) = &fixResourcePathsForObjectCallBackFunction; @@ -477,7 +485,7 @@ void tst_qquickdesignersupport::testFixResourcePathsForObjectCallBack() QVERIFY(rootItem); - s_object = nullptr; + s_allSubObjects.clear(); QQuickDesignerSupportItems::registerFixResourcePathsForObjectCallBack(fixResourcePathsForObjectCallBackPointer); @@ -487,8 +495,12 @@ void tst_qquickdesignersupport::testFixResourcePathsForObjectCallBack() QQuickDesignerSupportItems::tweakObjects(simpleItem); - //Check that the fixResourcePathsForObjectCallBack was called on simpleItem - QCOMPARE(simpleItem , s_object); + // Check that the fixResourcePathsForObjectCallBack was called on simpleItem + // NOTE: more objects are collected now. There is also at least a palette + // that created on demand. + QVERIFY(s_allSubObjects.contains(simpleItem)); + + s_allSubObjects.clear(); } void doComponentCompleteRecursive(QObject *object) diff --git a/tests/auto/quick/qquickdrag/CMakeLists.txt b/tests/auto/quick/qquickdrag/CMakeLists.txt new file mode 100644 index 0000000000..046072e769 --- /dev/null +++ b/tests/auto/quick/qquickdrag/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qquickdrag.pro. + +##################################################################### +## tst_qquickdrag Test: +##################################################################### + +qt_add_test(tst_qquickdrag + SOURCES + tst_qquickdrag.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickdroparea/CMakeLists.txt b/tests/auto/quick/qquickdroparea/CMakeLists.txt new file mode 100644 index 0000000000..2e64905df5 --- /dev/null +++ b/tests/auto/quick/qquickdroparea/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from qquickdroparea.pro. + +##################################################################### +## tst_qquickdroparea 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_qquickdroparea + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickdroparea.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickdroparea.pro:<TRUE>: +# OTHER_FILES = "data/*.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickdroparea CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickdroparea CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt b/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt new file mode 100644 index 0000000000..e843088036 --- /dev/null +++ b/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from qquickdynamicpropertyanimation.pro. + +##################################################################### +## tst_qquickdynamicpropertyanimation 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_qquickdynamicpropertyanimation + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickdynamicpropertyanimation.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Quick + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickdynamicpropertyanimation CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickdynamicpropertyanimation CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickflickable/CMakeLists.txt b/tests/auto/quick/qquickflickable/CMakeLists.txt new file mode 100644 index 0000000000..579f5bcfd7 --- /dev/null +++ b/tests/auto/quick/qquickflickable/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickflickable.pro. + +##################################################################### +## tst_qquickflickable 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_qquickflickable + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickflickable.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickflickable CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickflickable CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickflipable/CMakeLists.txt b/tests/auto/quick/qquickflipable/CMakeLists.txt new file mode 100644 index 0000000000..e30d57a4ba --- /dev/null +++ b/tests/auto/quick/qquickflipable/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickflipable.pro. + +##################################################################### +## tst_qquickflipable 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_qquickflipable + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickflipable.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickflipable CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickflipable CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickfocusscope/CMakeLists.txt b/tests/auto/quick/qquickfocusscope/CMakeLists.txt new file mode 100644 index 0000000000..f106e8bde2 --- /dev/null +++ b/tests/auto/quick/qquickfocusscope/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickfocusscope.pro. + +##################################################################### +## tst_qquickfocusscope 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_qquickfocusscope + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickfocusscope.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfocusscope CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfocusscope CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickfontloader/CMakeLists.txt b/tests/auto/quick/qquickfontloader/CMakeLists.txt new file mode 100644 index 0000000000..d244c0a2e7 --- /dev/null +++ b/tests/auto/quick/qquickfontloader/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from qquickfontloader.pro. + +##################################################################### +## tst_qquickfontloader 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_qquickfontloader + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qquickfontloader.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfontloader CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfontloader CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickfontloader/data/qtbug-20268.qml b/tests/auto/quick/qquickfontloader/data/qtbug-20268.qml index 0eafdfa17b..e9282bf2c7 100644 --- a/tests/auto/quick/qquickfontloader/data/qtbug-20268.qml +++ b/tests/auto/quick/qquickfontloader/data/qtbug-20268.qml @@ -4,7 +4,7 @@ Rectangle { id: test property variant fontloader: fontloaderelement height: 100; width: 100 - property bool usename: false + property bool useotherfont: false property int statenum: 1 property alias name: fontloaderelement.name property alias source: fontloaderelement.source @@ -15,11 +15,11 @@ Rectangle { } states: [ - State { name: "start"; when: !usename + State { name: "start"; when: !useotherfont PropertyChanges { target: fontloaderelement; source: "tarzeau_ocr_a.ttf" } }, - State { name: "changefont"; when: usename - PropertyChanges { target: fontloaderelement; name: "Tahoma" } + State { name: "changefont"; when: useotherfont + PropertyChanges { target: fontloaderelement; source: "daniel.ttf" } } ] diff --git a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp index 87a5bd469a..8f6910bee4 100644 --- a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp +++ b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp @@ -45,7 +45,6 @@ public: private slots: void initTestCase(); void noFont(); - void namedFont(); void localFont(); void failLocalFont(); void webFont(); @@ -85,19 +84,6 @@ void tst_qquickfontloader::noFont() delete fontObject; } -void tst_qquickfontloader::namedFont() -{ - QString componentStr = "import QtQuick 2.0\nFontLoader { name: \"Helvetica\" }"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QQuickFontLoader *fontObject = qobject_cast<QQuickFontLoader*>(component.create()); - - QVERIFY(fontObject != nullptr); - QCOMPARE(fontObject->source(), QUrl("")); - QCOMPARE(fontObject->name(), QString("Helvetica")); - QTRY_COMPARE(fontObject->status(), QQuickFontLoader::Ready); -} - void tst_qquickfontloader::localFont() { QString componentStr = "import QtQuick 2.0\nFontLoader { source: \"" + testFileUrl("tarzeau_ocr_a.ttf").toString() + "\" }"; @@ -223,16 +209,10 @@ void tst_qquickfontloader::changeFontSourceViaState() QVERIFY(fontObject->source() != QUrl("")); QTRY_COMPARE(fontObject->name(), QString("OCRA")); - window.rootObject()->setProperty("usename", true); - - // This warning should probably not be printed once QTBUG-20268 is fixed - QString warning = QString(testFileUrl("qtbug-20268.qml").toString()) + - QLatin1String(":13:5: QML FontLoader: Cannot load font: \"\""); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); + window.rootObject()->setProperty("useotherfont", true); - QEXPECT_FAIL("", "QTBUG-20268", Abort); QTRY_COMPARE(fontObject->status(), QQuickFontLoader::Ready); - QCOMPARE(window.rootObject()->property("name").toString(), QString("Tahoma")); + QCOMPARE(window.rootObject()->property("name").toString(), QString("Daniel")); } QTEST_MAIN(tst_qquickfontloader) diff --git a/tests/auto/quick/qquickfontloader_static/CMakeLists.txt b/tests/auto/quick/qquickfontloader_static/CMakeLists.txt new file mode 100644 index 0000000000..ce25511fca --- /dev/null +++ b/tests/auto/quick/qquickfontloader_static/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickfontloader_static.pro. + +##################################################################### +## tst_qquickfontloader_static 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_qquickfontloader_static + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickfontloader_static.cpp + DEFINES + QT_DISABLE_DEPRECATED_BEFORE=0 + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickfontloader_static CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickfontloader_static CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickfontmetrics/CMakeLists.txt b/tests/auto/quick/qquickfontmetrics/CMakeLists.txt new file mode 100644 index 0000000000..7509c6dd86 --- /dev/null +++ b/tests/auto/quick/qquickfontmetrics/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qquickfontmetrics.pro. + +##################################################################### +## tst_quickfontmetrics Test: +##################################################################### + +qt_add_test(tst_quickfontmetrics + SOURCES + tst_quickfontmetrics.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickframebufferobject/CMakeLists.txt b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt new file mode 100644 index 0000000000..ba720e1d26 --- /dev/null +++ b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickframebufferobject.pro. + +##################################################################### +## tst_qquickframebufferobject 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_qquickframebufferobject + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickframebufferobject.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickframebufferobject.pro:<TRUE>: +# OTHER_FILES = "data/testStuff.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickframebufferobject CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickframebufferobject CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp index 6aff66d61e..2327270b0f 100644 --- a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp +++ b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp @@ -30,9 +30,9 @@ #include <QtQuick/qquickitem.h> #include <QtQuick/qquickview.h> -#include <QtGui/qopenglcontext.h> -#include <QtGui/qopenglframebufferobject.h> -#include <QtGui/qopenglfunctions.h> +#include <qopenglcontext.h> +#include <qopenglframebufferobject.h> +#include <qopenglfunctions.h> #include <QtQuick/QQuickFramebufferObject> diff --git a/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt b/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt new file mode 100644 index 0000000000..a85a526ca4 --- /dev/null +++ b/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickgraphicsinfo.pro. + +##################################################################### +## tst_qquickgraphicsinfo 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_qquickgraphicsinfo + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickgraphicsinfo.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickgraphicsinfo.pro:<TRUE>: +# OTHER_FILES = "data/basic.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickgraphicsinfo CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickgraphicsinfo CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp index 4da6da6043..aff081c4a8 100644 --- a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp +++ b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp @@ -36,7 +36,7 @@ #include "../../shared/util.h" #if QT_CONFIG(opengl) -#include <QtGui/qopenglcontext.h> +#include <qopenglcontext.h> #include <QtGui/qsurfaceformat.h> #endif diff --git a/tests/auto/quick/qquickgridview/CMakeLists.txt b/tests/auto/quick/qquickgridview/CMakeLists.txt new file mode 100644 index 0000000000..de7cfe581c --- /dev/null +++ b/tests/auto/quick/qquickgridview/CMakeLists.txt @@ -0,0 +1,49 @@ +# Generated from qquickgridview.pro. + +##################################################################### +## tst_qquickgridview 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_qquickgridview + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickgridview.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickgridview.pro:<TRUE>: +# testcase.timeout = "1100" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickgridview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickgridview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickimage/CMakeLists.txt b/tests/auto/quick/qquickimage/CMakeLists.txt new file mode 100644 index 0000000000..4aeed8b2f2 --- /dev/null +++ b/tests/auto/quick/qquickimage/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qquickimage.pro. + +##################################################################### +## tst_qquickimage 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_qquickimage + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickimage.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickimage CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickimage CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index cf54208d8c..a9defe7b70 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -1193,7 +1193,7 @@ void tst_qquickimage::urlInterceptor() { QQmlEngine engine; MyInterceptor interceptor {testFileUrl("colors.png")}; - engine.setUrlInterceptor(&interceptor); + engine.addUrlInterceptor(&interceptor); QQmlComponent c(&engine); diff --git a/tests/auto/quick/qquickimageprovider/CMakeLists.txt b/tests/auto/quick/qquickimageprovider/CMakeLists.txt new file mode 100644 index 0000000000..7771df4237 --- /dev/null +++ b/tests/auto/quick/qquickimageprovider/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qquickimageprovider.pro. + +##################################################################### +## tst_qquickimageprovider Test: +##################################################################### + +qt_add_test(tst_qquickimageprovider + SOURCES + tst_qquickimageprovider.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickitem/CMakeLists.txt b/tests/auto/quick/qquickitem/CMakeLists.txt new file mode 100644 index 0000000000..00882afa3a --- /dev/null +++ b/tests/auto/quick/qquickitem/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from qquickitem.pro. + +##################################################################### +## tst_qquickitem 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_qquickitem + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickitem.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickitem CONDITION TARGET Qt::Widgets + DEFINES + TEST_QTBUG_60123 + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qquickitem CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickitem CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index b5e001a2b7..137162099f 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -34,6 +34,9 @@ #include "private/qquickfocusscope_p.h" #include "private/qquickitem_p.h" #include <qpa/qwindowsysteminterface.h> +#ifdef Q_OS_WIN +#include <QOpenGLContext> +#endif #include <QDebug> #include <QTimer> #include <QQmlEngine> diff --git a/tests/auto/quick/qquickitem2/CMakeLists.txt b/tests/auto/quick/qquickitem2/CMakeLists.txt new file mode 100644 index 0000000000..5d8bb99dee --- /dev/null +++ b/tests/auto/quick/qquickitem2/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickitem2.pro. + +##################################################################### +## tst_qquickitem2 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_qquickitem2 + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickitem.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickitem2 CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickitem2 CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickitemlayer/CMakeLists.txt b/tests/auto/quick/qquickitemlayer/CMakeLists.txt new file mode 100644 index 0000000000..d81ae9ecc2 --- /dev/null +++ b/tests/auto/quick/qquickitemlayer/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickitemlayer.pro. + +##################################################################### +## tst_qquickitemlayer 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_qquickitemlayer + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickitemlayer.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickitemlayer.pro:<TRUE>: +# OTHER_FILES = "data/Smooth.qml" "data/Enabled.qml" "data/Mipmap.qml" "data/Effect.qml" "data/SourceRect.qml" "data/TextureProvider.qml" "data/Visible.qml" "data/ZOrder.qml" "data/ZOrderChange.qml" "data/ToggleLayerAndEffect.qml" "data/DisableLayer.qml" "data/SamplerNameChange.qml" "data/ItemEffect.qml" "data/RectangleEffect.qml" "data/TextureMirroring.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickitemlayer CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickitemlayer CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 824db1b080..c5d05585e0 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -31,8 +31,8 @@ #include <QtQuick/qquickitem.h> #include <QtQuick/qquickview.h> #include <QtQuick/qsgrendererinterface.h> -#include <QtGui/qopenglcontext.h> -#include <QtGui/qopenglfunctions.h> +#include <qopenglcontext.h> +#include <qopenglfunctions.h> #include "../../shared/util.h" diff --git a/tests/auto/quick/qquicklayouts/CMakeLists.txt b/tests/auto/quick/qquicklayouts/CMakeLists.txt new file mode 100644 index 0000000000..f750a4f1c5 --- /dev/null +++ b/tests/auto/quick/qquicklayouts/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from qquicklayouts.pro. + +##################################################################### +## tst_qquicklayouts 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_qquicklayouts + GUI + QMLTEST + SOURCES + tst_qquicklayouts.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquicklayouts.pro:<TRUE>: +# OTHER_FILES = "data/tst_rowlayout.qml" "data/tst_gridlayout.qml" "data/tst_stacklayout.qml" +# TEMPLATE = "app" diff --git a/tests/auto/quick/qquicklistview/CMakeLists.txt b/tests/auto/quick/qquicklistview/CMakeLists.txt new file mode 100644 index 0000000000..9244fb6cee --- /dev/null +++ b/tests/auto/quick/qquicklistview/CMakeLists.txt @@ -0,0 +1,54 @@ +# Generated from qquicklistview.pro. + +##################################################################### +## tst_qquicklistview 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_qquicklistview + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + incrementalmodel.cpp incrementalmodel.h + proxytestinnermodel.cpp proxytestinnermodel.h + randomsortmodel.cpp randomsortmodel.h + reusemodel.h + tst_qquicklistview.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquicklistview.pro:<TRUE>: +# DISTFILES = "data/*" +# testcase.timeout = "900" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicklistview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicklistview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickloader/CMakeLists.txt b/tests/auto/quick/qquickloader/CMakeLists.txt new file mode 100644 index 0000000000..114598bd3f --- /dev/null +++ b/tests/auto/quick/qquickloader/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qquickloader.pro. + +##################################################################### +## tst_qquickloader 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_qquickloader + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickloader.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickloader CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickloader CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickmousearea/BLACKLIST b/tests/auto/quick/qquickmousearea/BLACKLIST index 6e0665271c..089bb3a873 100644 --- a/tests/auto/quick/qquickmousearea/BLACKLIST +++ b/tests/auto/quick/qquickmousearea/BLACKLIST @@ -1,3 +1,6 @@ +[pressAndHold] +macos ci + # QTBUG-78153 [nestedStopAtBounds] opensuse-leap @@ -5,4 +8,3 @@ opensuse-leap # QTBUG-82282 [pressOneAndTapAnother] opensuse-leap - diff --git a/tests/auto/quick/qquickmousearea/CMakeLists.txt b/tests/auto/quick/qquickmousearea/CMakeLists.txt new file mode 100644 index 0000000000..969bb745f3 --- /dev/null +++ b/tests/auto/quick/qquickmousearea/CMakeLists.txt @@ -0,0 +1,49 @@ +# Generated from qquickmousearea.pro. + +##################################################################### +## tst_qquickmousearea 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_qquickmousearea + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickmousearea.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickmousearea.pro:<TRUE>: +# OTHER_FILES = "data/*.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickmousearea CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickmousearea CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt b/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt new file mode 100644 index 0000000000..dff7c77ceb --- /dev/null +++ b/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickmultipointtoucharea.pro. + +##################################################################### +## tst_qquickmultipointtoucharea 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_qquickmultipointtoucharea + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickmultipointtoucharea.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickmultipointtoucharea CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickmultipointtoucharea CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickopenglinfo/CMakeLists.txt b/tests/auto/quick/qquickopenglinfo/CMakeLists.txt new file mode 100644 index 0000000000..ba483df856 --- /dev/null +++ b/tests/auto/quick/qquickopenglinfo/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickopenglinfo.pro. + +##################################################################### +## tst_qquickopenglinfo 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_qquickopenglinfo + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickopenglinfo.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickopenglinfo.pro:<TRUE>: +# OTHER_FILES = "data/basic.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickopenglinfo CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickopenglinfo CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickopenglinfo/tst_qquickopenglinfo.cpp b/tests/auto/quick/qquickopenglinfo/tst_qquickopenglinfo.cpp index 3bf61e8f17..a4cbaa453d 100644 --- a/tests/auto/quick/qquickopenglinfo/tst_qquickopenglinfo.cpp +++ b/tests/auto/quick/qquickopenglinfo/tst_qquickopenglinfo.cpp @@ -32,7 +32,7 @@ #include <QtQuick/qquickitem.h> #include <QtQuick/qquickview.h> -#include <QtGui/qopenglcontext.h> +#include <qopenglcontext.h> #include <QtGui/qsurfaceformat.h> #include "../../shared/util.h" diff --git a/tests/auto/quick/qquickpainteditem/CMakeLists.txt b/tests/auto/quick/qquickpainteditem/CMakeLists.txt new file mode 100644 index 0000000000..c07fff8ef1 --- /dev/null +++ b/tests/auto/quick/qquickpainteditem/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qquickpainteditem.pro. + +##################################################################### +## tst_qquickpainteditem Test: +##################################################################### + +qt_add_test(tst_qquickpainteditem + SOURCES + tst_qquickpainteditem.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickpalette/CMakeLists.txt b/tests/auto/quick/qquickpalette/CMakeLists.txt new file mode 100644 index 0000000000..20a8081c48 --- /dev/null +++ b/tests/auto/quick/qquickpalette/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_add_test(tst_qquickpalette + SOURCES + tst_qquickpalette.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate + Qt::QuickPrivate +) diff --git a/tests/auto/quick/qquickpalette/qquickpalette.pro b/tests/auto/quick/qquickpalette/qquickpalette.pro new file mode 100644 index 0000000000..96c508d82a --- /dev/null +++ b/tests/auto/quick/qquickpalette/qquickpalette.pro @@ -0,0 +1,7 @@ +CONFIG += testcase +TARGET = tst_qquickpalette +SOURCES += tst_qquickpalette.cpp + +macos:CONFIG -= app_bundle + +QT += core-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp b/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp new file mode 100644 index 0000000000..e211a034ee --- /dev/null +++ b/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp @@ -0,0 +1,304 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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:LGPL$ +** 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. +** +** 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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/qtest.h> +#include <QtTest/QSignalSpy> + +#include <QtQuick/private/qquickpalette_p.h> +#include <QtQuick/private/qquickabstractpaletteprovider_p.h> +#include <QtQuick/private/qquickpalettecolorprovider_p.h> + +class tst_QQuickPalette : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void resolvingColor(); + void resolvingColor_data(); + + void newColorSubgroup(); + void newColorSubgroup_data(); + + void onlyRespectiveColorSubgroupChangedAfterAssigment(); + + void paletteChangedWhenColorGroupChanged(); + + void createDefault(); + + void changeCurrentColorGroup(); + + void inheritColor(); + + void inheritCurrentColor(); + + void overrideColor(); + + void resolveColor(); + + void createFromQtPalette(); + void convertToQtPalette(); +}; + +using GroupGetter = QQuickColorGroup* (QQuickPalette::* )() const; +Q_DECLARE_METATYPE(GroupGetter); + +void tst_QQuickPalette::resolvingColor() +{ + QFETCH(QPalette::ColorGroup, colorGroup); + QFETCH(GroupGetter, getter); + + QQuickPalette p; + p.setWindowText(Qt::red); + + auto g = (p.*getter)(); + + QVERIFY(g); + + g->setWindowText(Qt::green); + p.setCurrentGroup(colorGroup); + + QCOMPARE(p.windowText(), Qt::green); +} + +void tst_QQuickPalette::resolvingColor_data() +{ + QTest::addColumn<QPalette::ColorGroup>("colorGroup"); + QTest::addColumn<GroupGetter>("getter"); + + QTest::addRow("Inactive") << QPalette::Inactive << &QQuickPalette::inactive; + QTest::addRow("Disabled") << QPalette::Disabled << &QQuickPalette::disabled; +} + +using GroupSetter = void (QQuickPalette::* )(QQuickColorGroup *); +Q_DECLARE_METATYPE(GroupSetter); + +using GroupNotifier = void (QQuickPalette::* )(); +Q_DECLARE_METATYPE(GroupNotifier); + +void tst_QQuickPalette::newColorSubgroup() +{ + QFETCH(GroupGetter, getter); + QFETCH(GroupSetter, setter); + QFETCH(GroupNotifier, notifier); + + { + QQuickPalette p; + p.fromQPalette(Qt::blue); + + auto defaultGroup = (p.*getter)(); + QVERIFY(defaultGroup); + + QSignalSpy subgroupChanged(&p, notifier); + QSignalSpy paletteChanged(&p, &QQuickPalette::changed); + + QQuickPalette anotherPalette; + anotherPalette.fromQPalette(Qt::red); + (p.*setter)((anotherPalette.*getter)()); + + QCOMPARE(subgroupChanged.count(), 1); + QCOMPARE(paletteChanged.count(), 1); + } +} + +void tst_QQuickPalette::newColorSubgroup_data() +{ + QTest::addColumn<GroupGetter>("getter"); + QTest::addColumn<GroupSetter>("setter"); + QTest::addColumn<GroupNotifier>("notifier"); + + QTest::addRow("Active") << &QQuickPalette::active << &QQuickPalette::setActive + << &QQuickPalette::activeChanged; + QTest::addRow("Inactive") << &QQuickPalette::inactive << &QQuickPalette::setInactive + << &QQuickPalette::inactiveChanged; + QTest::addRow("Disabled") << &QQuickPalette::disabled << &QQuickPalette::setDisabled + << &QQuickPalette::disabledChanged; +} + +void tst_QQuickPalette::onlyRespectiveColorSubgroupChangedAfterAssigment() +{ + QQuickPalette palette; + palette.setWindow(Qt::red); + + QQuickPalette anotherPalette; + anotherPalette.active()->setWindow(Qt::green); + + // Only active subgroup should be copied + palette.setActive(anotherPalette.active()); + + QCOMPARE(palette.active()->window(), Qt::green); + QCOMPARE(palette.disabled()->window(), Qt::red); + QCOMPARE(palette.inactive()->window(), Qt::red); +} + +void tst_QQuickPalette::paletteChangedWhenColorGroupChanged() +{ + QQuickPalette p; + QSignalSpy sp(&p, &QQuickPalette::changed); + + p.active()->setMid(Qt::red); + p.inactive()->setMid(Qt::green); + p.disabled()->setMid(Qt::blue); + + QCOMPARE(sp.count(), 3); +} + +void tst_QQuickPalette::createDefault() +{ + QQuickPalette palette; + + QCOMPARE(palette.currentColorGroup(), QPalette::Active); + QCOMPARE(palette.active()->groupTag(), QPalette::Active); + QCOMPARE(palette.inactive()->groupTag(), QPalette::Inactive); + QCOMPARE(palette.disabled()->groupTag(), QPalette::Disabled); +} + +void tst_QQuickPalette::changeCurrentColorGroup() +{ + QQuickPalette palette; + + QSignalSpy ss(&palette, &QQuickPalette::changed); + palette.setCurrentGroup(QPalette::Disabled); + + QCOMPARE(palette.currentColorGroup(), QPalette::Disabled); + QCOMPARE(ss.count(), 1); +} + +void tst_QQuickPalette::inheritColor() +{ + QQuickPalette parentPalette; + parentPalette.setWindowText(Qt::red); + + QQuickPalette quickPalette; + quickPalette.inheritPalette(parentPalette.toQPalette()); + + QCOMPARE(quickPalette.windowText(), Qt::red); + + QQuickPalette childQuickPalette; + childQuickPalette.inheritPalette(quickPalette.toQPalette()); + + QCOMPARE(childQuickPalette.windowText(), Qt::red); +} + +void tst_QQuickPalette::inheritCurrentColor() +{ + QQuickPalette parentPalette; + parentPalette.setWindowText(Qt::green); + parentPalette.disabled()->setWindowText(Qt::red); + + + QQuickPalette quickPalette; + quickPalette.inheritPalette(parentPalette.toQPalette()); + quickPalette.setCurrentGroup(QPalette::Disabled); + + QCOMPARE(quickPalette.windowText(), Qt::red); +} + +void tst_QQuickPalette::overrideColor() +{ + QQuickPalette rootPalette; + rootPalette.setWindowText(Qt::red); + + QQuickPalette palette; + palette.inheritPalette(rootPalette.toQPalette()); + palette.setWindowText(Qt::yellow); + + QCOMPARE(palette.windowText(), Qt::yellow); + + QQuickPalette childPalette; + childPalette.inheritPalette(palette.toQPalette()); + childPalette.disabled()->setWindowText(Qt::green); + + // Color is not set for the current group. Use parent color + QCOMPARE(childPalette.windowText(), Qt::yellow); + + // Change current group to use color, specified for this particular group + childPalette.setCurrentGroup(QPalette::Disabled); + + QCOMPARE(childPalette.windowText(), Qt::green); +} + +void tst_QQuickPalette::resolveColor() +{ + QQuickPalette palette; + palette.setWindowText(Qt::red); + + // Disabled color should be red, because disabled palette is not specified + palette.setCurrentGroup(QPalette::Disabled); + QCOMPARE(palette.windowText(), Qt::red); + + // Color is changed for disabled palette, because current color group is QPalette::Disabled + palette.disabled()->setWindowText(Qt::yellow); + QCOMPARE(palette.windowText(), Qt::yellow); + QCOMPARE(palette.disabled()->windowText(), Qt::yellow); + + // Change color group back to active + palette.setCurrentGroup(QPalette::Active); + QCOMPARE(palette.windowText(), Qt::red); +} + +void tst_QQuickPalette::createFromQtPalette() +{ + QQuickPalette palette; + QPalette somePalette(Qt::red); + + QSignalSpy sp(&palette, &QQuickColorGroup::changed); + + palette.fromQPalette(QPalette()); + QCOMPARE(sp.count(), 0); + + palette.fromQPalette(somePalette); + QCOMPARE(sp.count(), 1); +} + +void tst_QQuickPalette::convertToQtPalette() +{ + QQuickPalette palette; + + QPalette somePalette(Qt::red); + palette.fromQPalette(somePalette); + + auto pp = palette.paletteProvider(); + QVERIFY(pp); + + QCOMPARE(palette.toQPalette(), somePalette.resolve(pp->defaultPalette())); +} + +QTEST_MAIN(tst_QQuickPalette) + +#include "tst_qquickpalette.moc" diff --git a/tests/auto/quick/qquickpath/CMakeLists.txt b/tests/auto/quick/qquickpath/CMakeLists.txt new file mode 100644 index 0000000000..fa41ef74e1 --- /dev/null +++ b/tests/auto/quick/qquickpath/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickpath.pro. + +##################################################################### +## tst_qquickpath 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_qquickpath + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickpath.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickpath.pro:<TRUE>: +# DISTFILES = "data/*" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpath CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpath CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickpathview/CMakeLists.txt b/tests/auto/quick/qquickpathview/CMakeLists.txt new file mode 100644 index 0000000000..c3df8ff6a6 --- /dev/null +++ b/tests/auto/quick/qquickpathview/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from qquickpathview.pro. + +##################################################################### +## tst_qquickpathview 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_qquickpathview + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickpathview.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpathview CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qquickpathview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpathview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickpincharea/CMakeLists.txt b/tests/auto/quick/qquickpincharea/CMakeLists.txt new file mode 100644 index 0000000000..d9394bad9e --- /dev/null +++ b/tests/auto/quick/qquickpincharea/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickpincharea.pro. + +##################################################################### +## tst_qquickpincharea 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_qquickpincharea + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickpincharea.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpincharea CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpincharea CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickpixmapcache/CMakeLists.txt b/tests/auto/quick/qquickpixmapcache/CMakeLists.txt new file mode 100644 index 0000000000..cb2debfe6d --- /dev/null +++ b/tests/auto/quick/qquickpixmapcache/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickpixmapcache.pro. + +##################################################################### +## tst_qquickpixmapcache 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_qquickpixmapcache + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qquickpixmapcache.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Concurrent + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpixmapcache CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpixmapcache CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickpositioners/CMakeLists.txt b/tests/auto/quick/qquickpositioners/CMakeLists.txt new file mode 100644 index 0000000000..040f045598 --- /dev/null +++ b/tests/auto/quick/qquickpositioners/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquickpositioners.pro. + +##################################################################### +## tst_qquickpositioners 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_qquickpositioners + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickpositioners.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickpositioners CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickpositioners CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickrectangle/CMakeLists.txt b/tests/auto/quick/qquickrectangle/CMakeLists.txt new file mode 100644 index 0000000000..4a563432b6 --- /dev/null +++ b/tests/auto/quick/qquickrectangle/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickrectangle.pro. + +##################################################################### +## tst_qquickrectangle 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_qquickrectangle + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickrectangle.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickrectangle CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickrectangle CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickrepeater/CMakeLists.txt b/tests/auto/quick/qquickrepeater/CMakeLists.txt new file mode 100644 index 0000000000..950608e0b7 --- /dev/null +++ b/tests/auto/quick/qquickrepeater/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquickrepeater.pro. + +##################################################################### +## tst_qquickrepeater 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_qquickrepeater + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickrepeater.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickrepeater CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickrepeater CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickscreen/CMakeLists.txt b/tests/auto/quick/qquickscreen/CMakeLists.txt new file mode 100644 index 0000000000..4838fd8321 --- /dev/null +++ b/tests/auto/quick/qquickscreen/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from qquickscreen.pro. + +##################################################################### +## tst_qquickscreen Test: +##################################################################### + +qt_add_test(tst_qquickscreen + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickscreen.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickscreen CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickscreen CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickshadereffect/CMakeLists.txt b/tests/auto/quick/qquickshadereffect/CMakeLists.txt new file mode 100644 index 0000000000..dbdf2610d2 --- /dev/null +++ b/tests/auto/quick/qquickshadereffect/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from qquickshadereffect.pro. + +##################################################################### +## tst_qquickshadereffect Test: +##################################################################### + +qt_add_test(tst_qquickshadereffect + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickshadereffect.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickshadereffect CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickshadereffect CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickshape/CMakeLists.txt b/tests/auto/quick/qquickshape/CMakeLists.txt new file mode 100644 index 0000000000..96e48c29e5 --- /dev/null +++ b/tests/auto/quick/qquickshape/CMakeLists.txt @@ -0,0 +1,53 @@ +# Generated from qquickshape.pro. + +##################################################################### +## tst_qquickshape 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_qquickshape + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickshape.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickShapesPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickshape.pro:<TRUE>: +# DISTFILES = "data/*" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickshape CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qquickshape CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickshape CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickshortcut/CMakeLists.txt b/tests/auto/quick/qquickshortcut/CMakeLists.txt new file mode 100644 index 0000000000..c3986d263d --- /dev/null +++ b/tests/auto/quick/qquickshortcut/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquickshortcut.pro. + +##################################################################### +## tst_qquickshortcut 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_qquickshortcut + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickshortcut.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::Quick + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickshortcut CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::QuickWidgets +) + +qt_extend_target(tst_qquickshortcut CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickshortcut CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt b/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt new file mode 100644 index 0000000000..31841f2740 --- /dev/null +++ b/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquicksmoothedanimation.pro. + +##################################################################### +## tst_qquicksmoothedanimation 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_qquicksmoothedanimation + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquicksmoothedanimation.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicksmoothedanimation CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicksmoothedanimation CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickspringanimation/CMakeLists.txt b/tests/auto/quick/qquickspringanimation/CMakeLists.txt new file mode 100644 index 0000000000..4831c67c10 --- /dev/null +++ b/tests/auto/quick/qquickspringanimation/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickspringanimation.pro. + +##################################################################### +## tst_qquickspringanimation 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_qquickspringanimation + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickspringanimation.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickspringanimation CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickspringanimation CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickspritesequence/CMakeLists.txt b/tests/auto/quick/qquickspritesequence/CMakeLists.txt new file mode 100644 index 0000000000..6887b1ee79 --- /dev/null +++ b/tests/auto/quick/qquickspritesequence/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from qquickspritesequence.pro. + +##################################################################### +## tst_qquickspritesequence 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_qquickspritesequence + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickspritesequence.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickspritesequence CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickspritesequence CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickstates/CMakeLists.txt b/tests/auto/quick/qquickstates/CMakeLists.txt new file mode 100644 index 0000000000..78a68c0f15 --- /dev/null +++ b/tests/auto/quick/qquickstates/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquickstates.pro. + +##################################################################### +## tst_qquickstates 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_qquickstates + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickstates.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickstates CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickstates CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickstyledtext/CMakeLists.txt b/tests/auto/quick/qquickstyledtext/CMakeLists.txt new file mode 100644 index 0000000000..bc73e9178c --- /dev/null +++ b/tests/auto/quick/qquickstyledtext/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qquickstyledtext.pro. + +##################################################################### +## tst_qquickstyledtext Test: +##################################################################### + +qt_add_test(tst_qquickstyledtext + SOURCES + tst_qquickstyledtext.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquicksystempalette/CMakeLists.txt b/tests/auto/quick/qquicksystempalette/CMakeLists.txt new file mode 100644 index 0000000000..57efc14e65 --- /dev/null +++ b/tests/auto/quick/qquicksystempalette/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from qquicksystempalette.pro. + +##################################################################### +## tst_qquicksystempalette Test: +##################################################################### + +qt_add_test(tst_qquicksystempalette + SOURCES + tst_qquicksystempalette.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicksystempalette CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) diff --git a/tests/auto/quick/qquicktableview/CMakeLists.txt b/tests/auto/quick/qquicktableview/CMakeLists.txt new file mode 100644 index 0000000000..70456af1d6 --- /dev/null +++ b/tests/auto/quick/qquicktableview/CMakeLists.txt @@ -0,0 +1,50 @@ +# Generated from qquicktableview.pro. + +##################################################################### +## tst_qquicktableview 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_qquicktableview + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + testmodel.h + tst_qquicktableview.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquicktableview.pro:<TRUE>: +# DISTFILES = <EMPTY> + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktableview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktableview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 08a5249e2e..b551575e9d 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -4,3 +4,5 @@ qemu macos [fontSizeMode] opensuse-42.1 +[contentSize] +windows gcc diff --git a/tests/auto/quick/qquicktext/CMakeLists.txt b/tests/auto/quick/qquicktext/CMakeLists.txt new file mode 100644 index 0000000000..7b1edd910f --- /dev/null +++ b/tests/auto/quick/qquicktext/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qquicktext.pro. + +##################################################################### +## tst_qquicktext 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_qquicktext + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qquicktext.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Network + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTest + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktext CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktext CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 42fdbea58d..1f132ee266 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -1506,7 +1506,7 @@ void tst_qquicktext::weight() delete textObject; } { - QString componentStr = "import QtQuick 2.0\nText { font.weight: \"Bold\"; text: \"Hello world!\" }"; + QString componentStr = "import QtQuick 2.0\nText { font.weight: Font.Bold; text: \"Hello world!\" }"; QQmlComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); diff --git a/tests/auto/quick/qquicktextdocument/CMakeLists.txt b/tests/auto/quick/qquicktextdocument/CMakeLists.txt new file mode 100644 index 0000000000..7d2f750549 --- /dev/null +++ b/tests/auto/quick/qquicktextdocument/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qquicktextdocument.pro. + +##################################################################### +## tst_qquicktextdocument 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_qquicktextdocument + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquicktextdocument.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktextdocument CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktextdocument CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicktextedit/BLACKLIST b/tests/auto/quick/qquicktextedit/BLACKLIST index 36c7f0042f..b8147a0ef9 100644 --- a/tests/auto/quick/qquicktextedit/BLACKLIST +++ b/tests/auto/quick/qquicktextedit/BLACKLIST @@ -4,3 +4,7 @@ opensuse-leap # QTBUG-78846 [mouseSelectionMode] opensuse-leap + +# QTBUG-82052 +[linkHover] +macos ci diff --git a/tests/auto/quick/qquicktextedit/CMakeLists.txt b/tests/auto/quick/qquicktextedit/CMakeLists.txt new file mode 100644 index 0000000000..4a4cc3811e --- /dev/null +++ b/tests/auto/quick/qquicktextedit/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from qquicktextedit.pro. + +##################################################################### +## tst_qquicktextedit 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_qquicktextedit + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquicktextedit.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::NetworkPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktextedit CONDITION MACOS + PUBLIC_LIBRARIES + ${FWAppKit} +) + +qt_extend_target(tst_qquicktextedit CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktextedit CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicktextinput/BLACKLIST b/tests/auto/quick/qquicktextinput/BLACKLIST index ada7c57c75..6cd24de9a9 100644 --- a/tests/auto/quick/qquicktextinput/BLACKLIST +++ b/tests/auto/quick/qquicktextinput/BLACKLIST @@ -1,3 +1,7 @@ # QTBUG-78162 [mouseSelectionMode] opensuse-leap + +# QTBUG-82058 +[setInputMask] +macos ci diff --git a/tests/auto/quick/qquicktextinput/CMakeLists.txt b/tests/auto/quick/qquicktextinput/CMakeLists.txt new file mode 100644 index 0000000000..dff1a6f555 --- /dev/null +++ b/tests/auto/quick/qquicktextinput/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquicktextinput.pro. + +##################################################################### +## tst_qquicktextinput 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_qquicktextinput + SOURCES + ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h + ../../shared/util.cpp ../../shared/util.h + tst_qquicktextinput.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquicktextinput CONDITION MACOS + PUBLIC_LIBRARIES + ${FWAppKit} +) + +qt_extend_target(tst_qquicktextinput CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquicktextinput CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquicktextinput/data/qtbug-19956regexp.qml b/tests/auto/quick/qquicktextinput/data/qtbug-19956regexp.qml index b5af13cc4c..c0317f3583 100644 --- a/tests/auto/quick/qquicktextinput/data/qtbug-19956regexp.qml +++ b/tests/auto/quick/qquicktextinput/data/qtbug-19956regexp.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.14 TextInput { id: textinput @@ -6,8 +6,8 @@ TextInput { height: 50 width: 200 text: "abc" - validator: RegExpValidator { + validator: RegularExpressionValidator { id: regexpvalidator - regExp: regexvalue + regularExpression: regexvalue } } diff --git a/tests/auto/quick/qquicktextinput/data/signal_accepted.qml b/tests/auto/quick/qquicktextinput/data/signal_accepted.qml index 94c113dd9f..4de4ace542 100644 --- a/tests/auto/quick/qquicktextinput/data/signal_accepted.qml +++ b/tests/auto/quick/qquicktextinput/data/signal_accepted.qml @@ -1,4 +1,4 @@ -import QtQuick 2.2 +import QtQuick 2.14 Item { property QtObject input: input @@ -8,7 +8,7 @@ Item { Column{ TextInput { id: input; property bool acceptable: acceptableInput - validator: RegExpValidator { regExp: /[a-zA-z]{2,4}/ } + validator: RegularExpressionValidator { regularExpression: /[a-zA-z]{2,4}/ } } } } diff --git a/tests/auto/quick/qquicktextinput/data/signal_editingfinished.qml b/tests/auto/quick/qquicktextinput/data/signal_editingfinished.qml index dba186e765..7784417569 100644 --- a/tests/auto/quick/qquicktextinput/data/signal_editingfinished.qml +++ b/tests/auto/quick/qquicktextinput/data/signal_editingfinished.qml @@ -1,4 +1,4 @@ -import QtQuick 2.2 +import QtQuick 2.14 Item { property QtObject input1: input1 @@ -9,11 +9,11 @@ Item { Column{ TextInput { id: input1; property bool acceptable: acceptableInput - validator: RegExpValidator { regExp: /[a-zA-z]{2,4}/ } + validator: RegularExpressionValidator { regularExpression: /[a-zA-z]{2,4}/ } } TextInput { id: input2; property bool acceptable: acceptableInput - validator: RegExpValidator { regExp: /[a-zA-z]{2,4}/ } + validator: RegularExpressionValidator { regularExpression: /[a-zA-z]{2,4}/ } } } } diff --git a/tests/auto/quick/qquicktextinput/data/validators.qml b/tests/auto/quick/qquicktextinput/data/validators.qml index b923f69801..b1eb5bf9ea 100644 --- a/tests/auto/quick/qquicktextinput/data/validators.qml +++ b/tests/auto/quick/qquicktextinput/data/validators.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.14 Item { property variant intInput: intInput @@ -19,7 +19,7 @@ Item { } TextInput { id: strInput; property bool acceptable: acceptableInput - validator: RegExpValidator { regExp: /[a-zA-z]{2,4}/ } + validator: RegularExpressionValidator { regularExpression: /[a-zA-z]{2,4}/ } } TextInput { id: unvalidatedInput property bool acceptable: acceptableInput diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 2e64c80b85..18b7903eeb 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -6008,7 +6008,7 @@ void tst_qquicktextinput::QTBUG_19956_regexp() { QUrl url = testFileUrl("qtbug-19956regexp.qml"); - QString warning = url.toString() + ":11:9: Unable to assign [undefined] to QRegExp"; + QString warning = url.toString() + ":11:9: Unable to assign [undefined] to QRegularExpression"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); QQuickView window(url); @@ -6187,9 +6187,9 @@ void tst_qquicktextinput::keypress_inputMask_withValidator() QFETCH(QString, expectedText); QFETCH(QString, expectedDisplayText); - QString componentStr = "import QtQuick 2.0\nTextInput { focus: true; inputMask: \"" + mask + "\"\n"; + QString componentStr = "import QtQuick 2.14\nTextInput { focus: true; inputMask: \"" + mask + "\"\n"; if (!validatorRegExp.isEmpty()) - componentStr += "validator: RegExpValidator { regExp: " + validatorRegExp + " }\n}"; + componentStr += "validator: RegularExpressionValidator { regularExpression: " + validatorRegExp + " }\n}"; else if (decimals > 0) componentStr += QString("validator: DoubleValidator { bottom: %1; decimals: %2; top: %3 }\n}"). arg(validatorMinimum).arg(decimals).arg(validatorMaximum); diff --git a/tests/auto/quick/qquicktextmetrics/CMakeLists.txt b/tests/auto/quick/qquicktextmetrics/CMakeLists.txt new file mode 100644 index 0000000000..74e5c2bf7e --- /dev/null +++ b/tests/auto/quick/qquicktextmetrics/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qquicktextmetrics.pro. + +##################################################################### +## tst_qquicktextmetrics Test: +##################################################################### + +qt_add_test(tst_qquicktextmetrics + SOURCES + tst_qquicktextmetrics.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::Qml + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquicktimeline/CMakeLists.txt b/tests/auto/quick/qquicktimeline/CMakeLists.txt new file mode 100644 index 0000000000..1d31d0b4b9 --- /dev/null +++ b/tests/auto/quick/qquicktimeline/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from qquicktimeline.pro. + +##################################################################### +## tst_qquicktimeline Test: +##################################################################### + +qt_add_test(tst_qquicktimeline + SOURCES + tst_qquicktimeline.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::Qml + Qt::QmlPrivate + Qt::Quick + Qt::QuickPrivate +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quick/qquickview/CMakeLists.txt b/tests/auto/quick/qquickview/CMakeLists.txt new file mode 100644 index 0000000000..ce0f0fad68 --- /dev/null +++ b/tests/auto/quick/qquickview/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from qquickview.pro. + +##################################################################### +## tst_qquickview 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_qquickview + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickview.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickview CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickview CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt b/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt new file mode 100644 index 0000000000..81e9fe3601 --- /dev/null +++ b/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt @@ -0,0 +1,50 @@ +# Generated from qquickvisualdatamodel.pro. + +##################################################################### +## tst_qquickvisualdatamodel 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_qquickvisualdatamodel + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickvisualdatamodel.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlModelsPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickvisualdatamodel CONDITION TARGET Qt::Widgets + PUBLIC_LIBRARIES + Qt::Widgets +) + +qt_extend_target(tst_qquickvisualdatamodel CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickvisualdatamodel CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickwindow/CMakeLists.txt b/tests/auto/quick/qquickwindow/CMakeLists.txt new file mode 100644 index 0000000000..5d9f91280e --- /dev/null +++ b/tests/auto/quick/qquickwindow/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qquickwindow.pro. + +##################################################################### +## tst_qquickwindow 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_qquickwindow + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_qquickwindow.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickwindow.pro:<TRUE>: +# OTHER_FILES = "data/active.qml" "data/AnimationsWhileHidden.qml" "data/Headless.qml" "data/showHideAnimate.qml" "data/windoworder.qml" "data/grabContentItemToImage.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickwindow CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickwindow CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 22b04eabd8..604ac0e12e 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -2117,15 +2117,9 @@ void tst_qquickwindow::testWindowVisibilityOrder() QWindowList windows = QGuiApplication::topLevelWindows(); QTRY_COMPARE(windows.size(), 5); - if (qgetenv("XDG_CURRENT_DESKTOP") == "Unity" && QGuiApplication::focusWindow() != window3) { - qDebug() << "Unity (flaky QTBUG-62604): expected window3 to have focus; actual focusWindow:" - << QGuiApplication::focusWindow(); - } else { - QCOMPARE(window3, QGuiApplication::focusWindow()); - QVERIFY(window1->isActive()); - QVERIFY(window2->isActive()); - QVERIFY(window3->isActive()); - } + QVERIFY(window1->isActive()); + QVERIFY(window2->isActive()); + QVERIFY(window3->isActive()); //Test if window4 is shown 2 seconds after the application startup //with window4 visible window5 (transient child) should also become visible diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 9ab7119903..71b5794e81 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -42,6 +42,8 @@ PRIVATETESTS += \ qquickstyledtext \ qquickstates \ qquicksystempalette \ + qquickcolorgroup \ + qquickpalette \ qquicktimeline QUICKTESTS += \ diff --git a/tests/auto/quick/rendernode/CMakeLists.txt b/tests/auto/quick/rendernode/CMakeLists.txt new file mode 100644 index 0000000000..970934b3fb --- /dev/null +++ b/tests/auto/quick/rendernode/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from rendernode.pro. + +##################################################################### +## tst_rendernode 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_rendernode + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_rendernode.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:rendernode.pro:<TRUE>: +# OTHER_FILES = "data/RenderOrder.qml" "data/MessUpState.qml" "data/matrix.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_rendernode CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_rendernode CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp index ec248e8210..87d710ee47 100644 --- a/tests/auto/quick/rendernode/tst_rendernode.cpp +++ b/tests/auto/quick/rendernode/tst_rendernode.cpp @@ -30,8 +30,8 @@ #include <QtQuick/qquickitem.h> #include <QtQuick/qquickview.h> -#include <QtGui/qopenglcontext.h> -#include <QtGui/qopenglfunctions.h> +#include <qopenglcontext.h> +#include <qopenglfunctions.h> #include <QtGui/qscreen.h> #include <private/qsgrendernode_p.h> @@ -194,7 +194,7 @@ static bool fuzzyCompareColor(QRgb x, QRgb y, QByteArray *errorMessage) enum { fuzz = 4 }; if (qAbs(qRed(x) - qRed(y)) >= fuzz || qAbs(qGreen(x) - qGreen(y)) >= fuzz || qAbs(qBlue(x) - qBlue(y)) >= fuzz) { QString s; - QDebug(&s).nospace() << hex << "Color mismatch 0x" << x << " 0x" << y << dec << " (fuzz=" << fuzz << ")."; + QDebug(&s).nospace() << Qt::hex << "Color mismatch 0x" << x << " 0x" << y << Qt::dec << " (fuzz=" << fuzz << ")."; *errorMessage = s.toLocal8Bit(); return false; } diff --git a/tests/auto/quick/scenegraph/CMakeLists.txt b/tests/auto/quick/scenegraph/CMakeLists.txt new file mode 100644 index 0000000000..3e7fa6fe88 --- /dev/null +++ b/tests/auto/quick/scenegraph/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from scenegraph.pro. + +##################################################################### +## tst_scenegraph Test: +##################################################################### + +qt_add_test(tst_scenegraph + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_scenegraph.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate +) + +#### Keys ignored in scope 1:.:.:scenegraph.pro:<TRUE>: +# OTHER_FILES = "data/render_OutOfFloatRange.qml" "data/simple.qml" "data/render_ImageFiltering.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_scenegraph CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_scenegraph CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quick/shared/visualtestutil.cpp b/tests/auto/quick/shared/visualtestutil.cpp index de2cf2bd5b..06f7386902 100644 --- a/tests/auto/quick/shared/visualtestutil.cpp +++ b/tests/auto/quick/shared/visualtestutil.cpp @@ -95,7 +95,7 @@ bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib, QSt || qAbs(qRed(a) - qRed(b)) > tolerance || qAbs(qRed(a) - qRed(b)) > tolerance) { QDebug(errorMessage) << "Mismatch at:" << x << y << ':' - << hex << showbase << a << b; + << Qt::hex << Qt::showbase << a << b; return false; } } diff --git a/tests/auto/quick/sharedimage/CMakeLists.txt b/tests/auto/quick/sharedimage/CMakeLists.txt new file mode 100644 index 0000000000..17d2bec634 --- /dev/null +++ b/tests/auto/quick/sharedimage/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from sharedimage.pro. + +##################################################################### +## tst_sharedimage 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_sharedimage + SOURCES + tst_sharedimage.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::QuickPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:sharedimage.pro:<TRUE>: +# OTHER_FILES = "data/yellow.png" diff --git a/tests/auto/quick/touchmouse/CMakeLists.txt b/tests/auto/quick/touchmouse/CMakeLists.txt new file mode 100644 index 0000000000..a07596018e --- /dev/null +++ b/tests/auto/quick/touchmouse/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from touchmouse.pro. + +##################################################################### +## tst_touchmouse 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_touchmouse + SOURCES + ../../shared/util.cpp ../../shared/util.h + ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h + ../shared/viewtestutil.cpp ../shared/viewtestutil.h + ../shared/visualtestutil.cpp ../shared/visualtestutil.h + tst_touchmouse.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_touchmouse CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_touchmouse CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quicktest/CMakeLists.txt b/tests/auto/quicktest/CMakeLists.txt new file mode 100644 index 0000000000..3686db8417 --- /dev/null +++ b/tests/auto/quicktest/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from quicktest.pro. + +add_subdirectory(polish) +add_subdirectory(signalspy) +add_subdirectory(quicktestmainwithsetup) +add_subdirectory(testfiltering) diff --git a/tests/auto/quicktest/polish-qml/CMakeLists.txt b/tests/auto/quicktest/polish-qml/CMakeLists.txt new file mode 100644 index 0000000000..56038660d9 --- /dev/null +++ b/tests/auto/quicktest/polish-qml/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from polish-qml.pro. + +##################################################################### +## tst_polish-qml Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.qml) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_polish-qml + QMLTEST + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_polish-qml.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_polish-qml CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_polish-qml CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quicktest/polish/CMakeLists.txt b/tests/auto/quicktest/polish/CMakeLists.txt new file mode 100644 index 0000000000..9c5104400c --- /dev/null +++ b/tests/auto/quicktest/polish/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from polish.pro. + +##################################################################### +## tst_polish Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.qml) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_polish + QMLTEST + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_polish.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + Qt::QuickPrivate + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_polish CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_polish CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt b/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt new file mode 100644 index 0000000000..252c1011af --- /dev/null +++ b/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from quicktestmainwithsetup.pro. + +##################################################################### +## tst_quicktestmainwithsetup Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.qml) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_quicktestmainwithsetup + QMLTEST + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_quicktestmainwithsetup.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_quicktestmainwithsetup CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_quicktestmainwithsetup CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quicktest/signalspy/CMakeLists.txt b/tests/auto/quicktest/signalspy/CMakeLists.txt new file mode 100644 index 0000000000..8d9d864ec1 --- /dev/null +++ b/tests/auto/quicktest/signalspy/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from signalspy.pro. + +##################################################################### +## tst_signalspy Test: +##################################################################### + +qt_add_test(tst_signalspy + SOURCES + ../../shared/util.cpp ../../shared/util.h + mypropertymap.cpp mypropertymap.h + tst_signalspy.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::Gui + Qt::Quick +) + +## Scopes: +##################################################################### + +qt_extend_target(tst_signalspy CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_signalspy CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/quicktest/testfiltering/CMakeLists.txt b/tests/auto/quicktest/testfiltering/CMakeLists.txt new file mode 100644 index 0000000000..77ece791dd --- /dev/null +++ b/tests/auto/quicktest/testfiltering/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from testfiltering.pro. + +add_subdirectory(test) +add_subdirectory(quicktestmain) diff --git a/tests/auto/quicktest/testfiltering/quicktestmain/CMakeLists.txt b/tests/auto/quicktest/testfiltering/quicktestmain/CMakeLists.txt new file mode 100644 index 0000000000..9baedbab97 --- /dev/null +++ b/tests/auto/quicktest/testfiltering/quicktestmain/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from quicktestmain.pro. + +##################################################################### +## quicktestmain Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.qml) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(quicktestmain + GUI + QMLTEST + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + quicktestmain.cpp + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" + PUBLIC_LIBRARIES + Qt::Gui + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### diff --git a/tests/auto/quicktest/testfiltering/test/.prev_CMakeLists.txt b/tests/auto/quicktest/testfiltering/test/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f00249bfc4 --- /dev/null +++ b/tests/auto/quicktest/testfiltering/test/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from test.pro. + +##################################################################### +## tst_testfiltering Test: +##################################################################### + +qt_add_test(tst_testfiltering + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" + SOURCES + ../tst_testfiltering.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/quicktest/testfiltering/test/CMakeLists.txt b/tests/auto/quicktest/testfiltering/test/CMakeLists.txt new file mode 100644 index 0000000000..b53bfec73b --- /dev/null +++ b/tests/auto/quicktest/testfiltering/test/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from test.pro. + +##################################################################### +## tst_testfiltering Test: +##################################################################### + +qt_add_test(tst_testfiltering + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" # special case + SOURCES + ../tst_testfiltering.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/quickwidgets/CMakeLists.txt b/tests/auto/quickwidgets/CMakeLists.txt new file mode 100644 index 0000000000..938dbd05c0 --- /dev/null +++ b/tests/auto/quickwidgets/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from quickwidgets.pro. + +add_subdirectory(qquickwidget) diff --git a/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt b/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt new file mode 100644 index 0000000000..f8908592e6 --- /dev/null +++ b/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from qquickwidget.pro. + +##################################################################### +## tst_qquickwidget 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_qquickwidget + SOURCES + ../../shared/util.cpp ../../shared/util.h + tst_qquickwidget.cpp + INCLUDE_DIRECTORIES + ../../shared + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickWidgets + Qt::QuickWidgetsPrivate + Qt::WidgetsPrivate + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:qquickwidget.pro:<TRUE>: +# OTHER_FILES = "animating.qml" "error1.qml" "rectangle.qml" "resizemodeitem.qml" + +## Scopes: +##################################################################### + +qt_extend_target(tst_qquickwidget CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=\\\":/data\\\" +) + +qt_extend_target(tst_qquickwidget CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" +) diff --git a/tests/auto/shared/qqmljsastdumper.cpp b/tests/auto/shared/qqmljsastdumper.cpp index 5da6be6bd0..1292be8d5b 100644 --- a/tests/auto/shared/qqmljsastdumper.cpp +++ b/tests/auto/shared/qqmljsastdumper.cpp @@ -347,7 +347,9 @@ bool AstDumper::visit(AST::UiEnumMemberList *el) { bool AstDumper::visit(AST::UiVersionSpecifier *el) { start(QLatin1String("UiVersionSpecifier majorVersion=%1 minorVersion=%2 majorToken=%3 minorToken=%4") - .arg(qs(QString::number(el->majorVersion)), qs(QString::number(el->minorVersion)), loc(el->majorToken), loc(el->minorToken))); + .arg(qs(QString::number(el->version.majorVersion())), + qs(QString::number(el->version.minorVersion())), + loc(el->majorToken), loc(el->minorToken))); return true; } diff --git a/tests/auto/toolsupport/CMakeLists.txt b/tests/auto/toolsupport/CMakeLists.txt new file mode 100644 index 0000000000..65eff5e92e --- /dev/null +++ b/tests/auto/toolsupport/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from toolsupport.pro. + +##################################################################### +## tst_toolsupport Test: +##################################################################### + +qt_add_test(tst_toolsupport + SOURCES + tst_toolsupport.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlPrivate +) diff --git a/tests/auto/toolsupport/tst_toolsupport.cpp b/tests/auto/toolsupport/tst_toolsupport.cpp index f743a6f5c6..0c87d1a00c 100644 --- a/tests/auto/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/toolsupport/tst_toolsupport.cpp @@ -87,7 +87,7 @@ void tst_toolsupport::offsets_data() { QTestData &data = QTest::newRow("sizeof(QObjectData)") << sizeof(QObjectData); - data << 28 << 48; // vptr + 3 ptr + 2 int + ptr + data << 36 << 64; // vptr + 4 ptr + 3 int + (padding) + ptr } { @@ -115,8 +115,8 @@ void tst_toolsupport::offsets_data() { QTestData &data - = QTest::newRow("Heap::String::text") - << pmm_to_offsetof(&QV4::Heap::String::text); + = QTest::newRow("Heap::String::textStorage") + << pmm_to_offsetof(&QV4::Heap::String::textStorage); data << 4 << 8; } |