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 <alexandru.croitor@qt.io>
This commit is contained in:
parent
52492ff720
commit
fdf5d11ff6
@ -181,12 +181,39 @@ endfunction()
|
|||||||
# You may avoid test wrapping by either passing NO_WRAPPER option or switching QT_NO_TEST_WRAPPERS
|
# You may avoid test wrapping by either passing NO_WRAPPER option or switching QT_NO_TEST_WRAPPERS
|
||||||
# to ON. This is helpful if you want to use internal CMake tools within tests, like memory or
|
# to ON. This is helpful if you want to use internal CMake tools within tests, like memory or
|
||||||
# sanitizer checks. See https://cmake.org/cmake/help/v3.19/manual/ctest.1.html#ctest-memcheck-step
|
# sanitizer checks. See https://cmake.org/cmake/help/v3.19/manual/ctest.1.html#ctest-memcheck-step
|
||||||
|
# Arguments:
|
||||||
|
# BUILTIN_TESTDATA the option forces adding the provded TESTDATA to resources.
|
||||||
function(qt_internal_add_test name)
|
function(qt_internal_add_test name)
|
||||||
# EXCEPTIONS is a noop as they are enabled by default.
|
# EXCEPTIONS is a noop as they are enabled by default.
|
||||||
|
set(optional_args
|
||||||
|
RUN_SERIAL
|
||||||
|
EXCEPTIONS
|
||||||
|
NO_EXCEPTIONS
|
||||||
|
GUI
|
||||||
|
QMLTEST
|
||||||
|
CATCH
|
||||||
|
LOWDPI
|
||||||
|
NO_WRAPPER
|
||||||
|
BUILTIN_TESTDATA
|
||||||
|
)
|
||||||
|
set(single_value_args
|
||||||
|
OUTPUT_DIRECTORY
|
||||||
|
WORKING_DIRECTORY
|
||||||
|
TIMEOUT
|
||||||
|
VERSION
|
||||||
|
)
|
||||||
|
set(multi_value_args
|
||||||
|
QML_IMPORTPATH
|
||||||
|
TESTDATA
|
||||||
|
QT_TEST_SERVER_LIST
|
||||||
|
${__default_private_args}
|
||||||
|
${__default_public_args}
|
||||||
|
)
|
||||||
qt_parse_all_arguments(arg "qt_add_test"
|
qt_parse_all_arguments(arg "qt_add_test"
|
||||||
"RUN_SERIAL;EXCEPTIONS;NO_EXCEPTIONS;GUI;QMLTEST;CATCH;LOWDPI;NO_WRAPPER"
|
"${optional_args}"
|
||||||
"OUTPUT_DIRECTORY;WORKING_DIRECTORY;TIMEOUT;VERSION"
|
"${single_value_args}"
|
||||||
"QML_IMPORTPATH;TESTDATA;QT_TEST_SERVER_LIST;${__default_private_args};${__default_public_args}" ${ARGN}
|
"${multi_value_args}"
|
||||||
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT arg_OUTPUT_DIRECTORY)
|
if (NOT arg_OUTPUT_DIRECTORY)
|
||||||
@ -364,7 +391,7 @@ function(qt_internal_add_test name)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID OR IOS OR INTEGRITY)
|
if(ANDROID OR IOS OR INTEGRITY OR arg_BUILTIN_TESTDATA)
|
||||||
set(builtin_testdata TRUE)
|
set(builtin_testdata TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -4,13 +4,6 @@
|
|||||||
## tst_qfileselectors Test:
|
## tst_qfileselectors Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qfileselectors
|
|
||||||
SOURCES
|
|
||||||
tst_qfileselector.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::CorePrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set(qfileselector_resource_files
|
set(qfileselector_resource_files
|
||||||
"extras/+custom1/test"
|
"extras/+custom1/test"
|
||||||
@ -62,10 +55,12 @@ set(qfileselector_resource_files
|
|||||||
"platforms/test5"
|
"platforms/test5"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qfileselectors "qfileselector"
|
qt_internal_add_test(tst_qfileselectors
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qfileselector.cpp
|
||||||
FILES
|
PUBLIC_LIBRARIES
|
||||||
${qfileselector_resource_files}
|
Qt::CorePrivate
|
||||||
|
TESTDATA ${qfileselector_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,19 +4,7 @@
|
|||||||
## tst_qsettings Test:
|
## tst_qsettings Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qsettings
|
# Test:
|
||||||
SOURCES
|
|
||||||
tst_qsettings.cpp
|
|
||||||
DEFINES
|
|
||||||
QT_DISABLE_DEPRECATED_BEFORE=0
|
|
||||||
INCLUDE_DIRECTORIES
|
|
||||||
../../kernel/qmetatype
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::CorePrivate
|
|
||||||
Qt::Gui
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qsettings_resource_files
|
set(qsettings_resource_files
|
||||||
"bom.ini"
|
"bom.ini"
|
||||||
"resourcefile.ini"
|
"resourcefile.ini"
|
||||||
@ -29,11 +17,18 @@ set(qsettings_resource_files
|
|||||||
"float.ini"
|
"float.ini"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qsettings "qsettings"
|
qt_internal_add_test(tst_qsettings
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qsettings.cpp
|
||||||
FILES
|
DEFINES
|
||||||
${qsettings_resource_files}
|
QT_DISABLE_DEPRECATED_BEFORE=0
|
||||||
|
INCLUDE_DIRECTORIES
|
||||||
|
../../kernel/qmetatype
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::CorePrivate
|
||||||
|
Qt::Gui
|
||||||
|
TESTDATA ${qsettings_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
## tst_qvariant Test:
|
## tst_qvariant Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(qvariant_resource_files
|
||||||
|
"stream/qt4.9/"
|
||||||
|
"stream/qt5.0/"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qvariant
|
qt_internal_add_test(tst_qvariant
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qvariant.cpp
|
tst_qvariant.cpp
|
||||||
@ -14,22 +20,10 @@ qt_internal_add_test(tst_qvariant
|
|||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::CorePrivate
|
Qt::CorePrivate
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
|
TESTDATA ${qvariant_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qvariant_resource_files
|
|
||||||
"stream/qt4.9/"
|
|
||||||
"stream/qt5.0/"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qvariant "qvariant"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qvariant_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
## Scopes:
|
## Scopes:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
@ -22,7 +22,9 @@ add_subdirectory(qpalette)
|
|||||||
add_subdirectory(qscreen)
|
add_subdirectory(qscreen)
|
||||||
add_subdirectory(qsurfaceformat)
|
add_subdirectory(qsurfaceformat)
|
||||||
add_subdirectory(qwindow)
|
add_subdirectory(qwindow)
|
||||||
|
if(QT_FEATURE_private_tests)
|
||||||
add_subdirectory(qguiapplication)
|
add_subdirectory(qguiapplication)
|
||||||
|
endif()
|
||||||
add_subdirectory(qpixelformat)
|
add_subdirectory(qpixelformat)
|
||||||
add_subdirectory(qrasterwindow)
|
add_subdirectory(qrasterwindow)
|
||||||
add_subdirectory(qaddpostroutine)
|
add_subdirectory(qaddpostroutine)
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
# Generated from qguiapplication.pro.
|
# Generated from qguiapplication.pro.
|
||||||
|
|
||||||
if(NOT QT_FEATURE_private_tests)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
## tst_qguiapplication Test:
|
## tst_qguiapplication Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
@ -16,6 +12,12 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
# special case end
|
# special case end
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(tst_qguiapplication_resource_files
|
||||||
|
"icons/appicon.png"
|
||||||
|
"icons/usericon.png"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qguiapplication
|
qt_internal_add_test(tst_qguiapplication
|
||||||
VERSION ${target_version} # special case
|
VERSION ${target_version} # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
@ -28,19 +30,8 @@ qt_internal_add_test(tst_qguiapplication
|
|||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::CorePrivate
|
Qt::CorePrivate
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
)
|
TESTDATA ${tst_qguiapplication_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
# Resources:
|
|
||||||
set(tst_qguiapplication_resource_files
|
|
||||||
"icons/appicon.png"
|
|
||||||
"icons/usericon.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qguiapplication "tst_qguiapplication"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${tst_qguiapplication_resource_files}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# special case begin
|
# special case begin
|
||||||
@ -49,12 +40,3 @@ if (APPLE)
|
|||||||
set_property(TARGET tst_qguiapplication PROPERTY PROPERTY MACOSX_BUNDLE TRUE)
|
set_property(TARGET tst_qguiapplication PROPERTY PROPERTY MACOSX_BUNDLE TRUE)
|
||||||
endif()
|
endif()
|
||||||
# special case end
|
# special case end
|
||||||
|
|
||||||
## Scopes:
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
#### Keys ignored in scope 3:.:../../../corelib/kernel/qcoreapplication:../../../corelib/kernel/qcoreapplication/qcoreapplication.pro:WIN32:
|
|
||||||
# VERSION = "1.2.3.4"
|
|
||||||
|
|
||||||
#### Keys ignored in scope 4:.:../../../corelib/kernel/qcoreapplication:../../../corelib/kernel/qcoreapplication/qcoreapplication.pro:else:
|
|
||||||
# VERSION = "1.2.3"
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
## tst_qguivariant Test:
|
## tst_qguivariant Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
file(GLOB_RECURSE qguivariant_resource_files
|
||||||
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"data/*"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qguivariant
|
qt_internal_add_test(tst_qguivariant
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qguivariant.cpp
|
tst_qguivariant.cpp
|
||||||
@ -11,17 +17,6 @@ qt_internal_add_test(tst_qguivariant
|
|||||||
../../../../other/qvariant_common
|
../../../../other/qvariant_common
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
|
TESTDATA ${qguivariant_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qguivariant_resource_files
|
|
||||||
"data"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qguivariant "qguivariant"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qguivariant_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
## tst_qkeysequence Test:
|
## tst_qkeysequence Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(qkeysequence_resource_files
|
||||||
|
"keys_de.qm"
|
||||||
|
"qt_de.qm"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qkeysequence
|
qt_internal_add_test(tst_qkeysequence
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qkeysequence.cpp
|
tst_qkeysequence.cpp
|
||||||
@ -11,18 +17,6 @@ qt_internal_add_test(tst_qkeysequence
|
|||||||
Qt::CorePrivate
|
Qt::CorePrivate
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
|
TESTDATA ${qkeysequence_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qkeysequence_resource_files
|
|
||||||
"keys_de.qm"
|
|
||||||
"qt_de.qm"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qkeysequence "qkeysequence"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qkeysequence_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -5,10 +5,14 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# Collect test data
|
# Collect test data
|
||||||
file(GLOB_RECURSE test_data_glob
|
file(GLOB_RECURSE test_data
|
||||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
resources/*)
|
resources/*
|
||||||
list(APPEND test_data ${test_data_glob})
|
)
|
||||||
|
|
||||||
|
foreach(file IN LISTS test_data)
|
||||||
|
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
qt_internal_add_test(tst_qcolorspace
|
qt_internal_add_test(tst_qcolorspace
|
||||||
SOURCES
|
SOURCES
|
||||||
@ -18,22 +22,5 @@ qt_internal_add_test(tst_qcolorspace
|
|||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
TESTDATA ${test_data}
|
TESTDATA ${test_data}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "resources/*")
|
|
||||||
foreach(file IN LISTS resource_glob_0)
|
|
||||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qmake_immediate_resource_files
|
|
||||||
${resource_glob_0}
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qcolorspace "qmake_immediate"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qmake_immediate_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -4,23 +4,18 @@
|
|||||||
## tst_qrhi Test:
|
## tst_qrhi Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
file(GLOB_RECURSE qrhi_resource_files
|
||||||
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
data/*
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qrhi
|
qt_internal_add_test(tst_qrhi
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qrhi.cpp
|
tst_qrhi.cpp
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
|
TESTDATA ${qrhi_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qrhi_resource_files
|
|
||||||
"data"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qrhi "qrhi"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qrhi_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -4,23 +4,18 @@
|
|||||||
## tst_qshader Test:
|
## tst_qshader Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
file(GLOB_RECURSE qshader_resource_files
|
||||||
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"data/*"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qshader
|
qt_internal_add_test(tst_qshader
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qshader.cpp
|
tst_qshader.cpp
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
|
TESTDATA ${qshader_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qshader_resource_files
|
|
||||||
"data"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qshader "qshader"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qshader_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
## tst_qfont Test:
|
## tst_qfont Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(testfont_resource_files
|
||||||
|
"datastream.515"
|
||||||
|
"weirdfont.otf"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qfont
|
qt_internal_add_test(tst_qfont
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qfont.cpp
|
tst_qfont.cpp
|
||||||
@ -12,22 +18,10 @@ qt_internal_add_test(tst_qfont
|
|||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
Qt::TestPrivate
|
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:
|
## Scopes:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
@ -4,13 +4,6 @@
|
|||||||
## tst_qglyphrun Test:
|
## tst_qglyphrun Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qglyphrun
|
|
||||||
SOURCES
|
|
||||||
tst_qglyphrun.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::Gui
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set_source_files_properties("../../../shared/resources/test.ttf"
|
set_source_files_properties("../../../shared/resources/test.ttf"
|
||||||
PROPERTIES QT_RESOURCE_ALIAS "test.ttf"
|
PROPERTIES QT_RESOURCE_ALIAS "test.ttf"
|
||||||
@ -19,10 +12,12 @@ set(testdata_resource_files
|
|||||||
"../../../shared/resources/test.ttf"
|
"../../../shared/resources/test.ttf"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qglyphrun "testdata"
|
qt_internal_add_test(tst_qglyphrun
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qglyphrun.cpp
|
||||||
FILES
|
PUBLIC_LIBRARIES
|
||||||
${testdata_resource_files}
|
Qt::Gui
|
||||||
|
TESTDATA ${testdata_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,15 +4,6 @@
|
|||||||
## tst_qrawfont Test:
|
## tst_qrawfont Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qrawfont
|
|
||||||
SOURCES
|
|
||||||
tst_qrawfont.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::CorePrivate
|
|
||||||
Qt::Gui
|
|
||||||
Qt::GuiPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set_source_files_properties("../../../shared/resources/testfont.ttf"
|
set_source_files_properties("../../../shared/resources/testfont.ttf"
|
||||||
PROPERTIES QT_RESOURCE_ALIAS "testfont.ttf"
|
PROPERTIES QT_RESOURCE_ALIAS "testfont.ttf"
|
||||||
@ -23,10 +14,14 @@ set(testdata_resource_files
|
|||||||
"testfont_os2_v1.ttf"
|
"testfont_os2_v1.ttf"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qrawfont "testdata"
|
qt_internal_add_test(tst_qrawfont
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qrawfont.cpp
|
||||||
FILES
|
PUBLIC_LIBRARIES
|
||||||
${testdata_resource_files}
|
Qt::CorePrivate
|
||||||
|
Qt::Gui
|
||||||
|
Qt::GuiPrivate
|
||||||
|
TESTDATA ${testdata_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,14 +4,6 @@
|
|||||||
## tst_qtexturefilereader Test:
|
## tst_qtexturefilereader Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qtexturefilereader
|
|
||||||
SOURCES
|
|
||||||
tst_qtexturefilereader.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::Gui
|
|
||||||
Qt::GuiPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set(qtexturefilereader_resource_files
|
set(qtexturefilereader_resource_files
|
||||||
"texturefiles/car.ktx"
|
"texturefiles/car.ktx"
|
||||||
@ -23,10 +15,13 @@ set(qtexturefilereader_resource_files
|
|||||||
"texturefiles/pattern.pkm"
|
"texturefiles/pattern.pkm"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qtexturefilereader "qtexturefilereader"
|
qt_internal_add_test(tst_qtexturefilereader
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qtexturefilereader.cpp
|
||||||
FILES
|
PUBLIC_LIBRARIES
|
||||||
${qtexturefilereader_resource_files}
|
Qt::Gui
|
||||||
|
Qt::GuiPrivate
|
||||||
|
TESTDATA ${qtexturefilereader_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,6 +4,13 @@ include(../../../../src/testlib/selfcover.cmake)
|
|||||||
|
|
||||||
# ------------- Test runner -------------
|
# ------------- Test runner -------------
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
|
||||||
|
file(GLOB qmake_expected_files_resource_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*")
|
||||||
|
foreach(file IN LISTS qmake_expected_files_resource_files)
|
||||||
|
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
qt_internal_add_test(tst_selftests
|
qt_internal_add_test(tst_selftests
|
||||||
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
|
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||||
EXCEPTIONS
|
EXCEPTIONS
|
||||||
@ -13,6 +20,8 @@ qt_internal_add_test(tst_selftests
|
|||||||
catch.cpp
|
catch.cpp
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
Qt::TestPrivate
|
Qt::TestPrivate
|
||||||
|
TESTDATA ${qmake_expected_files_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
# These lines need to be commented out as they need to be enabled
|
# These lines need to be commented out as they need to be enabled
|
||||||
# COMPILE_OPTIONS
|
# COMPILE_OPTIONS
|
||||||
# conditionally
|
# conditionally
|
||||||
@ -24,25 +33,6 @@ qt_internal_add_test(tst_selftests
|
|||||||
# "$$COVERAGE_OPTIONS"
|
# "$$COVERAGE_OPTIONS"
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*")
|
|
||||||
foreach(file IN LISTS resource_glob_0)
|
|
||||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qmake_expected_files_resource_files
|
|
||||||
${resource_glob_0}
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_selftests "qmake_expected_files"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
BASE
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
FILES
|
|
||||||
${qmake_expected_files_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_apply_testlib_coverage_options(tst_selftests)
|
qt_internal_apply_testlib_coverage_options(tst_selftests)
|
||||||
|
|
||||||
# ------------- Sub tests -------------
|
# ------------- Sub tests -------------
|
||||||
|
@ -4,17 +4,6 @@
|
|||||||
## tst_qfontdialog Test:
|
## tst_qfontdialog Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qfontdialog
|
|
||||||
SOURCES
|
|
||||||
tst_qfontdialog.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::CorePrivate
|
|
||||||
Qt::Gui
|
|
||||||
Qt::GuiPrivate
|
|
||||||
Qt::Widgets
|
|
||||||
Qt::WidgetsPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set_source_files_properties("../../../shared/resources/test.ttf"
|
set_source_files_properties("../../../shared/resources/test.ttf"
|
||||||
PROPERTIES QT_RESOURCE_ALIAS "test.ttf"
|
PROPERTIES QT_RESOURCE_ALIAS "test.ttf"
|
||||||
@ -27,13 +16,18 @@ set(testfonts_resource_files
|
|||||||
"../../../shared/resources/testfont.ttf"
|
"../../../shared/resources/testfont.ttf"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qfontdialog "testfonts"
|
qt_internal_add_test(tst_qfontdialog
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qfontdialog.cpp
|
||||||
FILES
|
PUBLIC_LIBRARIES
|
||||||
${testfonts_resource_files}
|
Qt::CorePrivate
|
||||||
|
Qt::Gui
|
||||||
|
Qt::GuiPrivate
|
||||||
|
Qt::Widgets
|
||||||
|
Qt::WidgetsPrivate
|
||||||
|
TESTDATA ${testfonts_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
## Scopes:
|
## Scopes:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@ -4,15 +4,6 @@
|
|||||||
## tst_qwizard Test:
|
## tst_qwizard Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qwizard
|
|
||||||
SOURCES
|
|
||||||
tst_qwizard.cpp
|
|
||||||
tst_qwizard_2.cpp
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::Gui
|
|
||||||
Qt::Widgets
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set(qwizard_resource_files
|
set(qwizard_resource_files
|
||||||
"images/background.png"
|
"images/background.png"
|
||||||
@ -21,10 +12,14 @@ set(qwizard_resource_files
|
|||||||
"images/watermark.png"
|
"images/watermark.png"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qwizard "qwizard"
|
qt_internal_add_test(tst_qwizard
|
||||||
PREFIX
|
SOURCES
|
||||||
"/"
|
tst_qwizard.cpp
|
||||||
FILES
|
tst_qwizard_2.cpp
|
||||||
${qwizard_resource_files}
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Gui
|
||||||
|
Qt::Widgets
|
||||||
|
TESTDATA ${qwizard_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,32 +4,10 @@
|
|||||||
## tst_qgraphicsscene Test:
|
## tst_qgraphicsscene Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_internal_add_test(tst_qgraphicsscene
|
|
||||||
LOWDPI # special case
|
|
||||||
SOURCES
|
|
||||||
tst_qgraphicsscene.cpp
|
|
||||||
DEFINES
|
|
||||||
QT_NO_CAST_TO_ASCII
|
|
||||||
PUBLIC_LIBRARIES
|
|
||||||
Qt::CorePrivate
|
|
||||||
Qt::Gui
|
|
||||||
Qt::GuiPrivate
|
|
||||||
Qt::Widgets
|
|
||||||
Qt::WidgetsPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
# Resources:
|
||||||
set(images_resource_files
|
|
||||||
"Ash_European.jpg"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qgraphicsscene "images"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${images_resource_files}
|
|
||||||
)
|
|
||||||
set(testdata_resource_files
|
set(testdata_resource_files
|
||||||
|
"Ash_European.jpg"
|
||||||
"testData/render/all-all-45-deg-left.png"
|
"testData/render/all-all-45-deg-left.png"
|
||||||
"testData/render/all-all-45-deg-right.png"
|
"testData/render/all-all-45-deg-right.png"
|
||||||
"testData/render/all-all-scale-2x.png"
|
"testData/render/all-all-scale-2x.png"
|
||||||
@ -60,14 +38,22 @@ set(testdata_resource_files
|
|||||||
"testData/render/topright-topleft-untransformed.png"
|
"testData/render/topright-topleft-untransformed.png"
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qgraphicsscene "testdata"
|
qt_internal_add_test(tst_qgraphicsscene
|
||||||
PREFIX
|
LOWDPI # special case
|
||||||
"/"
|
SOURCES
|
||||||
FILES
|
tst_qgraphicsscene.cpp
|
||||||
${testdata_resource_files}
|
DEFINES
|
||||||
|
QT_NO_CAST_TO_ASCII
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::CorePrivate
|
||||||
|
Qt::Gui
|
||||||
|
Qt::GuiPrivate
|
||||||
|
Qt::Widgets
|
||||||
|
Qt::WidgetsPrivate
|
||||||
|
TESTDATA ${testdata_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
## Scopes:
|
## Scopes:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
@ -4,6 +4,14 @@
|
|||||||
## tst_qwidget Test:
|
## tst_qwidget Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(qwidget_resource_files
|
||||||
|
"geometry-fullscreen.dat"
|
||||||
|
"geometry-maximized.dat"
|
||||||
|
"geometry.dat"
|
||||||
|
"hellotr_la.qm"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qwidget
|
qt_internal_add_test(tst_qwidget
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qwidget.cpp
|
tst_qwidget.cpp
|
||||||
@ -14,24 +22,10 @@ qt_internal_add_test(tst_qwidget
|
|||||||
Qt::TestPrivate
|
Qt::TestPrivate
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
Qt::WidgetsPrivate
|
Qt::WidgetsPrivate
|
||||||
|
TESTDATA ${qwidget_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(qwidget_resource_files
|
|
||||||
"geometry-fullscreen.dat"
|
|
||||||
"geometry-maximized.dat"
|
|
||||||
"geometry.dat"
|
|
||||||
"hellotr_la.qm"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qwidget "qwidget"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${qwidget_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#### Keys ignored in scope 1:.:.:qwidget.pro:<TRUE>:
|
#### Keys ignored in scope 1:.:.:qwidget.pro:<TRUE>:
|
||||||
# testcase.timeout = "600"
|
# testcase.timeout = "600"
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
add_subdirectory(qmacstyle)
|
add_subdirectory(qmacstyle)
|
||||||
endif()
|
endif()
|
||||||
|
if(QT_FEATURE_private_tests)
|
||||||
add_subdirectory(qstyle)
|
add_subdirectory(qstyle)
|
||||||
|
endif()
|
||||||
add_subdirectory(qstyleoption)
|
add_subdirectory(qstyleoption)
|
||||||
if(QT_FEATURE_private_tests AND NOT ANDROID AND NOT QNX AND NOT UIKIT)
|
if(QT_FEATURE_private_tests AND NOT ANDROID AND NOT QNX AND NOT UIKIT)
|
||||||
add_subdirectory(qstylesheetstyle)
|
add_subdirectory(qstylesheetstyle)
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
# Generated from qstylesheetstyle.pro.
|
# Generated from qstylesheetstyle.pro.
|
||||||
|
|
||||||
if(NOT QT_FEATURE_private_tests)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
## tst_qstylesheetstyle Test:
|
## tst_qstylesheetstyle Test:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(resources_resource_files
|
||||||
|
"images/testimage.png"
|
||||||
|
"images/testimage@2x.png"
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_add_test(tst_qstylesheetstyle
|
qt_internal_add_test(tst_qstylesheetstyle
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qstylesheetstyle.cpp
|
tst_qstylesheetstyle.cpp
|
||||||
@ -17,21 +19,9 @@ qt_internal_add_test(tst_qstylesheetstyle
|
|||||||
Qt::TestPrivate
|
Qt::TestPrivate
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
Qt::WidgetsPrivate
|
Qt::WidgetsPrivate
|
||||||
|
TESTDATA ${resources_resource_files}
|
||||||
|
BUILTIN_TESTDATA
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(resources_resource_files
|
|
||||||
"images/testimage.png"
|
|
||||||
"images/testimage@2x.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_add_resource(tst_qstylesheetstyle "resources"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
FILES
|
|
||||||
${resources_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#### Keys ignored in scope 1:.:.:qstylesheetstyle.pro:<TRUE>:
|
#### Keys ignored in scope 1:.:.:qstylesheetstyle.pro:<TRUE>:
|
||||||
# _REQUIREMENTS = "qtConfig(private_tests)"
|
# _REQUIREMENTS = "qtConfig(private_tests)"
|
||||||
|
Loading…
Reference in New Issue
Block a user