summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-02-01 16:27:59 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-02-10 16:50:49 +0100
commit5722f9e889efaa21378ea0d561f44ebca917aae7 (patch)
treeb17f74352b845704b7ed2f694b28b9fb38725481
parent1c35c8f71eb6863498548c6724f82be01d872b33 (diff)
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 <fabian.kosmale@qt.io>
-rw-r--r--tests/auto/qml/qmltyperegistrar/CMakeLists.txt8
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp6
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:<TRUE>:
# 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\""));
}