From 5722f9e889efaa21378ea0d561f44ebca917aae7 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 1 Feb 2021 16:27:59 +0100 Subject: Enable tests of manually registered types Enable tests of 'qt_manual_moc' and manually registered types for cmake build Fixes: QTBUG-84906 Change-Id: I98b8902d4a2b70d4e1e218d8bfdedce25be1abc1 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmltyperegistrar/CMakeLists.txt | 8 +++++--- tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/auto/qml/qmltyperegistrar/CMakeLists.txt b/tests/auto/qml/qmltyperegistrar/CMakeLists.txt index 0839f56c4f..674dc08056 100644 --- a/tests/auto/qml/qmltyperegistrar/CMakeLists.txt +++ b/tests/auto/qml/qmltyperegistrar/CMakeLists.txt @@ -4,13 +4,16 @@ ## tst_qmltyperegistrar Test: ##################################################################### -qt_manual_moc(moc_files OUTPUT_MOC_JSON_FILES json_list noextheader) # special case +qt_manual_moc(moc_files OUTPUT_MOC_JSON_FILES json_list noextheader + INCLUDE_DIRECTORY_TARGETS Qt::Qml) + qt_internal_add_test(tst_qmltyperegistrar SOURCES hppheader.hpp # noextheader special case tst_qmltyperegistrar.cpp tst_qmltyperegistrar.h foo.cpp foo.h + ${moc_files} INCLUDE_DIRECTORIES foreign PUBLIC_LIBRARIES @@ -18,7 +21,6 @@ qt_internal_add_test(tst_qmltyperegistrar Qt::Qml foreign ) -target_compile_definitions(tst_qmltyperegistrar PRIVATE BUILD_WITH_CMAKE) # special case #### Keys ignored in scope 2:.:.:tst_qmltyperegistrar.pro:: # QMLTYPES_FILENAME = "tst_qmltyperegistrar.qmltypes" @@ -38,5 +40,5 @@ set_target_properties(tst_qmltyperegistrar PROPERTIES QT_QMLTYPES_FILENAME tst_qmltyperegistrar.qmltypes ) -qt6_qml_type_registration(tst_qmltyperegistrar ${json_list}) # special case +qt6_qml_type_registration(tst_qmltyperegistrar MANUAL_MOC_JSON_FILES ${json_list}) # special case add_subdirectory(foreign) diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp index 34d8007ede..9f49387a8f 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp @@ -51,9 +51,6 @@ void tst_qmltyperegistrar::qmltypesHasForeign() void tst_qmltyperegistrar::qmltypesHasHppClassAndNoext() { QVERIFY(qmltypesData.contains("HppClass")); -#ifdef BUILD_WITH_CMAKE - QEXPECT_FAIL("", "Type registration does not work manually moced files", Continue); -#endif QVERIFY(qmltypesData.contains("Noext")); } @@ -66,9 +63,6 @@ void tst_qmltyperegistrar::qmltypesHasReadAndWrite() void tst_qmltyperegistrar::qmltypesHasFileNames() { QVERIFY(qmltypesData.contains("file: \"hppheader.hpp\"")); -#ifdef BUILD_WITH_CMAKE - QEXPECT_FAIL("", "Type registration does not work manually moced files", Continue); -#endif QVERIFY(qmltypesData.contains("file: \"noextheader\"")); QVERIFY(qmltypesData.contains("file: \"tst_qmltyperegistrar.h\"")); } -- cgit v1.2.3