cmake: add tests in corelib/serialization
The DEFINES -= QT_NO_LINKED_LIST is no longer needed, so just remove it from .pro and CMakeLists.txt. Handle $$[QT_INSTALL_TESTS] and $$TARGET in target.path. When we have DESTDIR set, do not use target.path for OUTPUT_DIRECTORY. Fixes: QTBUG-78219 Change-Id: I5161a955b25ff2f3b35428dc4b935a7c9d2d425b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
This commit is contained in:
parent
9e5e98047e
commit
7bca6edc16
@ -1,5 +1,17 @@
|
|||||||
add_subdirectory(qcborvalue_json)
|
# Generated from serialization.pro.
|
||||||
|
|
||||||
|
add_subdirectory(json)
|
||||||
add_subdirectory(qcborstreamreader)
|
add_subdirectory(qcborstreamreader)
|
||||||
add_subdirectory(qcborstreamwriter)
|
add_subdirectory(qcborstreamwriter)
|
||||||
add_subdirectory(qcborvalue)
|
add_subdirectory(qcborvalue)
|
||||||
|
add_subdirectory(qcborvalue_json)
|
||||||
|
add_subdirectory(qdatastream_core_pixmap)
|
||||||
|
if(TARGET Qt::Gui)
|
||||||
|
add_subdirectory(qdatastream)
|
||||||
|
endif()
|
||||||
|
if(TARGET Qt::Network)
|
||||||
|
add_subdirectory(qtextstream)
|
||||||
|
endif()
|
||||||
|
if(TARGET Qt::Network AND TARGET Qt::Xml)
|
||||||
|
add_subdirectory(qxmlstream)
|
||||||
|
endif()
|
||||||
|
35
tests/auto/corelib/serialization/json/CMakeLists.txt
Normal file
35
tests/auto/corelib/serialization/json/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Generated from json.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_json Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_json
|
||||||
|
SOURCES
|
||||||
|
tst_qtjson.cpp
|
||||||
|
LIBRARIES
|
||||||
|
Qt::CorePrivate
|
||||||
|
)
|
||||||
|
|
||||||
|
## Scopes:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
#### Keys ignored in scope 2:.:.:json.pro:NOT ANDROID:
|
||||||
|
# TESTDATA = "bom.json" "test.json" "test.bjson" "test3.json" "test2.json"
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(json_resource_files
|
||||||
|
"bom.json"
|
||||||
|
"test.bjson"
|
||||||
|
"test.json"
|
||||||
|
"test2.json"
|
||||||
|
"test3.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_qt_resource(tst_json "json"
|
||||||
|
PREFIX
|
||||||
|
"/"
|
||||||
|
FILES
|
||||||
|
${json_resource_files}
|
||||||
|
)
|
||||||
|
|
@ -1,5 +1,14 @@
|
|||||||
add_qt_test(tst_qcborstreamreader SOURCES
|
# Generated from qcborstreamreader.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qcborstreamreader Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_qcborstreamreader
|
||||||
|
SOURCES
|
||||||
tst_qcborstreamreader.cpp
|
tst_qcborstreamreader.cpp
|
||||||
|
DEFINES
|
||||||
|
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
../../../../../src/3rdparty/tinycbor/src
|
../../../../../src/3rdparty/tinycbor/src
|
||||||
../../../../../src/3rdparty/tinycbor/tests/parser
|
../../../../../src/3rdparty/tinycbor/tests/parser
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
add_qt_test(tst_qcborstreamwriter SOURCES
|
# Generated from qcborstreamwriter.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qcborstreamwriter Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_qcborstreamwriter
|
||||||
|
SOURCES
|
||||||
tst_qcborstreamwriter.cpp
|
tst_qcborstreamwriter.cpp
|
||||||
|
DEFINES
|
||||||
|
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
../../../../../src/3rdparty/tinycbor/tests/encoder
|
../../../../../src/3rdparty/tinycbor/tests/encoder
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
add_qt_test(tst_qcborvalue SOURCES
|
# Generated from qcborvalue.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qcborvalue Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_qcborvalue
|
||||||
|
SOURCES
|
||||||
tst_qcborvalue.cpp
|
tst_qcborvalue.cpp
|
||||||
|
DEFINES
|
||||||
|
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
../../../../../src/3rdparty/tinycbor/src
|
../../../../../src/3rdparty/tinycbor/src
|
||||||
../../../../../src/3rdparty/tinycbor/tests/parser
|
../../../../../src/3rdparty/tinycbor/tests/parser
|
||||||
|
@ -1 +1,12 @@
|
|||||||
add_qt_test(tst_qcborvalue_json SOURCES tst_qcborvalue_json.cpp)
|
# Generated from qcborvalue_json.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qcborvalue_json Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_qcborvalue_json
|
||||||
|
SOURCES
|
||||||
|
tst_qcborvalue_json.cpp
|
||||||
|
DEFINES
|
||||||
|
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
|
||||||
|
)
|
||||||
|
32
tests/auto/corelib/serialization/qdatastream/CMakeLists.txt
Normal file
32
tests/auto/corelib/serialization/qdatastream/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Generated from qdatastream.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qdatastream Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
# Collect test data
|
||||||
|
list(APPEND test_data "datastream.q42")
|
||||||
|
|
||||||
|
add_qt_test(tst_qdatastream
|
||||||
|
SOURCES
|
||||||
|
tst_qdatastream.cpp
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Gui
|
||||||
|
TESTDATA ${test_data}
|
||||||
|
)
|
||||||
|
|
||||||
|
## Scopes:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(testdata_resource_files
|
||||||
|
"datastream.q42"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_qt_resource(tst_qdatastream "testdata"
|
||||||
|
PREFIX
|
||||||
|
"/"
|
||||||
|
FILES
|
||||||
|
${testdata_resource_files}
|
||||||
|
)
|
||||||
|
|
@ -3,8 +3,6 @@ TARGET = tst_qdatastream
|
|||||||
QT += testlib
|
QT += testlib
|
||||||
SOURCES = tst_qdatastream.cpp
|
SOURCES = tst_qdatastream.cpp
|
||||||
|
|
||||||
DEFINES -= QT_NO_LINKED_LIST
|
|
||||||
|
|
||||||
TESTDATA += datastream.q42
|
TESTDATA += datastream.q42
|
||||||
|
|
||||||
android:!android-embedded {
|
android:!android-embedded {
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
# Generated from qdatastream_core_pixmap.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qdatastream_core_pixmap Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_test(tst_qdatastream_core_pixmap
|
||||||
|
SOURCES
|
||||||
|
tst_qdatastream_core_pixmap.cpp
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Gui
|
||||||
|
)
|
@ -0,0 +1,6 @@
|
|||||||
|
# Generated from qtextstream.pro.
|
||||||
|
|
||||||
|
add_subdirectory(test)
|
||||||
|
add_subdirectory(stdinProcess)
|
||||||
|
add_subdirectory(readAllStdinProcess)
|
||||||
|
add_subdirectory(readLineStdinProcess)
|
@ -0,0 +1,12 @@
|
|||||||
|
# Generated from readAllStdinProcess.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## readAllStdinProcess Binary:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_executable(readAllStdinProcess
|
||||||
|
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qtextstream/readAllStdinProcess"
|
||||||
|
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/./"
|
||||||
|
SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
@ -0,0 +1,12 @@
|
|||||||
|
# Generated from readLineStdinProcess.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## readLineStdinProcess Binary:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_executable(readLineStdinProcess
|
||||||
|
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qtextstream/readLineStdinProcess"
|
||||||
|
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/./"
|
||||||
|
SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
@ -0,0 +1,12 @@
|
|||||||
|
# Generated from stdinProcess.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## stdinProcess Binary:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_executable(stdinProcess
|
||||||
|
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qtextstream/stdinProcess"
|
||||||
|
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/./"
|
||||||
|
SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
@ -0,0 +1,55 @@
|
|||||||
|
# Generated from test.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qtextstream Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
# Collect test data
|
||||||
|
list(APPEND test_data "../rfc3261.txt")
|
||||||
|
list(APPEND test_data "../shift-jis.txt")
|
||||||
|
list(APPEND test_data "../task113817.txt")
|
||||||
|
list(APPEND test_data "../qtextstream.qrc")
|
||||||
|
list(APPEND test_data "../tst_qtextstream.cpp")
|
||||||
|
list(APPEND test_data "../resources")
|
||||||
|
list(APPEND test_data "../BLACKLIST")
|
||||||
|
|
||||||
|
add_qt_test(tst_qtextstream
|
||||||
|
SOURCES
|
||||||
|
../../../../../shared/emulationdetector.h
|
||||||
|
../tst_qtextstream.cpp
|
||||||
|
INCLUDE_DIRECTORIES
|
||||||
|
../../../../../shared
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Network
|
||||||
|
TESTDATA ${test_data}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set_source_files_properties("../resources/big_endian/"
|
||||||
|
PROPERTIES QT_RESOURCE_ALIAS "resources/big_endian/"
|
||||||
|
)
|
||||||
|
set_source_files_properties("../resources/little_endian/"
|
||||||
|
PROPERTIES QT_RESOURCE_ALIAS "resources/little_endian/"
|
||||||
|
)
|
||||||
|
set(qtextstream_resource_files
|
||||||
|
"resources/big_endian/"
|
||||||
|
"resources/little_endian/"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_qt_resource(tst_qtextstream "qtextstream"
|
||||||
|
PREFIX
|
||||||
|
"/tst_textstream/"
|
||||||
|
BASE
|
||||||
|
".."
|
||||||
|
FILES
|
||||||
|
${qtextstream_resource_files}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
## Scopes:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
extend_target(tst_qtextstream CONDITION builtin_testdata
|
||||||
|
DEFINES
|
||||||
|
BUILTIN_TESTDATA
|
||||||
|
)
|
18
tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt
Normal file
18
tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated from qxmlstream.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## tst_qxmlstream Test:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
# Collect test data
|
||||||
|
list(APPEND test_data "data")
|
||||||
|
list(APPEND test_data "XML-Test-Suite")
|
||||||
|
|
||||||
|
add_qt_test(tst_qxmlstream
|
||||||
|
SOURCES
|
||||||
|
tst_qxmlstream.cpp
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Network
|
||||||
|
Qt::Xml
|
||||||
|
TESTDATA ${test_data}
|
||||||
|
)
|
@ -2796,6 +2796,9 @@ def write_binary(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int
|
|||||||
target_path = scope.get_string("target.path")
|
target_path = scope.get_string("target.path")
|
||||||
if target_path:
|
if target_path:
|
||||||
target_path = target_path.replace("$$[QT_INSTALL_EXAMPLES]", "${INSTALL_EXAMPLESDIR}")
|
target_path = target_path.replace("$$[QT_INSTALL_EXAMPLES]", "${INSTALL_EXAMPLESDIR}")
|
||||||
|
target_path = target_path.replace("$$[QT_INSTALL_TESTS]", "${INSTALL_TESTSDIR}")
|
||||||
|
target_path = target_path.replace("$$TARGET", scope.TARGET)
|
||||||
|
if not scope.get("DESTDIR"):
|
||||||
extra.append(f'OUTPUT_DIRECTORY "{target_path}"')
|
extra.append(f'OUTPUT_DIRECTORY "{target_path}"')
|
||||||
if "target" in scope.get("INSTALLS"):
|
if "target" in scope.get("INSTALLS"):
|
||||||
extra.append(f'INSTALL_DIRECTORY "{target_path}"')
|
extra.append(f'INSTALL_DIRECTORY "{target_path}"')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user