Adjust installing and running wasm-testrunner
Added a small helper function that also installs the script to prefix builds. Additionally, leveraging the cmake option CROSSCOMPILING_EMULATOR for the testrunner fits neatly in the rest of our cmake code. Change-Id: I75288e97c81b250ac3997f2e7a22bc7bd82b7b69 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
e3757df526
commit
1a0eb4fa01
@ -387,6 +387,12 @@ elseif(IOS)
|
|||||||
cmake/ios/LaunchScreen.storyboard
|
cmake/ios/LaunchScreen.storyboard
|
||||||
DESTINATION "${__GlobalConfig_install_dir}/ios"
|
DESTINATION "${__GlobalConfig_install_dir}/ios"
|
||||||
)
|
)
|
||||||
|
elseif(WASM)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/util/wasm/wasmtestrunner/qt-wasmtestrunner.py"
|
||||||
|
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py" @ONLY)
|
||||||
|
|
||||||
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py"
|
||||||
|
DESTINATION "${INSTALL_LIBEXECDIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Install CI support files to libexec.
|
# Install CI support files to libexec.
|
||||||
@ -395,5 +401,3 @@ qt_copy_or_install(FILES coin/instructions/qmake/ensure_pro_file.cmake
|
|||||||
DESTINATION "${__qt_libexec_install_dir}")
|
DESTINATION "${__qt_libexec_install_dir}")
|
||||||
qt_copy_or_install(PROGRAMS "util/testrunner/qt-testrunner.py"
|
qt_copy_or_install(PROGRAMS "util/testrunner/qt-testrunner.py"
|
||||||
DESTINATION "${__qt_libexec_install_dir}")
|
DESTINATION "${__qt_libexec_install_dir}")
|
||||||
qt_copy_or_install(PROGRAMS "util/wasm/wasmtestrunner/qt-wasmtestrunner.py"
|
|
||||||
DESTINATION "${__qt_libexec_install_dir}")
|
|
||||||
|
@ -332,8 +332,17 @@ function(qt_internal_add_test name)
|
|||||||
set(test_working_dir "")
|
set(test_working_dir "")
|
||||||
set(test_executable "${name}")
|
set(test_executable "${name}")
|
||||||
elseif(WASM)
|
elseif(WASM)
|
||||||
set(test_executable "${__qt_libexec_dir_absolute}/qt-wasmtestrunner.py")
|
# Test script expects html file
|
||||||
list(APPEND extra_test_args "${name}.html")
|
set(test_executable "${name}.html")
|
||||||
|
|
||||||
|
if(QT6_INSTALL_PREFIX)
|
||||||
|
set(QT_WASM_TESTRUNNER "${QT6_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py")
|
||||||
|
elseif(QT_BUILD_DIR)
|
||||||
|
set(QT_WASM_TESTRUNNER "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py")
|
||||||
|
endif()
|
||||||
|
# This tells cmake to run the tests with this script, since wasm files can't be
|
||||||
|
# executed directly
|
||||||
|
set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "${QT_WASM_TESTRUNNER}")
|
||||||
else()
|
else()
|
||||||
if(arg_QMLTEST AND NOT arg_SOURCES)
|
if(arg_QMLTEST AND NOT arg_SOURCES)
|
||||||
set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}")
|
set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user