From fdf5d11ff6f3f5034d7d7f7664f4cc76deb26ef5 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 9 Feb 2022 16:24:24 +0100 Subject: CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test Multiple tests use qt_internal_add_resource that copies the functionality that is already implemented inside the qt_internal_add_test function. Simplify these test by replacing the qt_internal_add_resource call with the new BUILTIN_TESTDATA option. Change-Id: I18475b817d6f87264f0de53817d6c26c5ccab4e2 Reviewed-by: Alexandru Croitor --- tests/auto/gui/text/qfont/CMakeLists.txt | 22 ++++++++-------------- tests/auto/gui/text/qglyphrun/CMakeLists.txt | 19 +++++++------------ tests/auto/gui/text/qrawfont/CMakeLists.txt | 23 +++++++++-------------- 3 files changed, 24 insertions(+), 40 deletions(-) (limited to 'tests/auto/gui/text') diff --git a/tests/auto/gui/text/qfont/CMakeLists.txt b/tests/auto/gui/text/qfont/CMakeLists.txt index 6e0583bc30..048416495b 100644 --- a/tests/auto/gui/text/qfont/CMakeLists.txt +++ b/tests/auto/gui/text/qfont/CMakeLists.txt @@ -4,6 +4,12 @@ ## tst_qfont Test: ##################################################################### +# Resources: +set(testfont_resource_files + "datastream.515" + "weirdfont.otf" +) + qt_internal_add_test(tst_qfont SOURCES tst_qfont.cpp @@ -12,22 +18,10 @@ qt_internal_add_test(tst_qfont Qt::Gui Qt::GuiPrivate Qt::TestPrivate + TESTDATA ${testfont_resource_files} + BUILTIN_TESTDATA ) -# Resources: -set(testfont_resource_files - "datastream.515" - "weirdfont.otf" -) - -qt_internal_add_resource(tst_qfont "testfont" - PREFIX - "/" - FILES - ${testfont_resource_files} -) - - ## Scopes: ##################################################################### diff --git a/tests/auto/gui/text/qglyphrun/CMakeLists.txt b/tests/auto/gui/text/qglyphrun/CMakeLists.txt index b0585af16f..4c5a7c44c0 100644 --- a/tests/auto/gui/text/qglyphrun/CMakeLists.txt +++ b/tests/auto/gui/text/qglyphrun/CMakeLists.txt @@ -4,13 +4,6 @@ ## tst_qglyphrun Test: ##################################################################### -qt_internal_add_test(tst_qglyphrun - SOURCES - tst_qglyphrun.cpp - PUBLIC_LIBRARIES - Qt::Gui -) - # Resources: set_source_files_properties("../../../shared/resources/test.ttf" PROPERTIES QT_RESOURCE_ALIAS "test.ttf" @@ -19,10 +12,12 @@ set(testdata_resource_files "../../../shared/resources/test.ttf" ) -qt_internal_add_resource(tst_qglyphrun "testdata" - PREFIX - "/" - FILES - ${testdata_resource_files} +qt_internal_add_test(tst_qglyphrun + SOURCES + tst_qglyphrun.cpp + PUBLIC_LIBRARIES + Qt::Gui + TESTDATA ${testdata_resource_files} + BUILTIN_TESTDATA ) diff --git a/tests/auto/gui/text/qrawfont/CMakeLists.txt b/tests/auto/gui/text/qrawfont/CMakeLists.txt index 04db8d8760..c7a883d9ce 100644 --- a/tests/auto/gui/text/qrawfont/CMakeLists.txt +++ b/tests/auto/gui/text/qrawfont/CMakeLists.txt @@ -4,15 +4,6 @@ ## tst_qrawfont Test: ##################################################################### -qt_internal_add_test(tst_qrawfont - SOURCES - tst_qrawfont.cpp - PUBLIC_LIBRARIES - Qt::CorePrivate - Qt::Gui - Qt::GuiPrivate -) - # Resources: set_source_files_properties("../../../shared/resources/testfont.ttf" PROPERTIES QT_RESOURCE_ALIAS "testfont.ttf" @@ -23,10 +14,14 @@ set(testdata_resource_files "testfont_os2_v1.ttf" ) -qt_internal_add_resource(tst_qrawfont "testdata" - PREFIX - "/" - FILES - ${testdata_resource_files} +qt_internal_add_test(tst_qrawfont + SOURCES + tst_qrawfont.cpp + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + TESTDATA ${testdata_resource_files} + BUILTIN_TESTDATA ) -- cgit v1.2.3