diff options
author | David Skoland <david.skoland@qt.io> | 2022-05-13 20:28:03 +0200 |
---|---|---|
committer | David Skoland <david.skoland@qt.io> | 2022-05-27 14:50:17 +0200 |
commit | 1a0eb4fa0191aa01b6b4cfa59370f31cbd7e3934 (patch) | |
tree | e688ee2067920cf2c6591b186382c34cd1a35f88 /cmake | |
parent | e3757df526c02394f6f5546c882acf5cb16515dc (diff) |
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>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBaseGlobalTargets.cmake | 8 | ||||
-rw-r--r-- | cmake/QtTestHelpers.cmake | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index c20066204d..facc800d18 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -387,6 +387,12 @@ elseif(IOS) cmake/ios/LaunchScreen.storyboard 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() # 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}") qt_copy_or_install(PROGRAMS "util/testrunner/qt-testrunner.py" DESTINATION "${__qt_libexec_install_dir}") -qt_copy_or_install(PROGRAMS "util/wasm/wasmtestrunner/qt-wasmtestrunner.py" - DESTINATION "${__qt_libexec_install_dir}") diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index c5b86bab6c..7fde6f1eb4 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -332,8 +332,17 @@ function(qt_internal_add_test name) set(test_working_dir "") set(test_executable "${name}") elseif(WASM) - set(test_executable "${__qt_libexec_dir_absolute}/qt-wasmtestrunner.py") - list(APPEND extra_test_args "${name}.html") + # Test script expects html file + 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() if(arg_QMLTEST AND NOT arg_SOURCES) set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}") |