summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorDavid Skoland <david.skoland@qt.io>2022-10-08 09:48:09 +0200
committerDavid Skoland <david.skoland@qt.io>2022-10-15 19:50:41 +0200
commit306f1af145ada1dc2f6a366e331d208295f4e2b2 (patch)
treed01d15ced2cca1fbd7be675a3af2010bd428c79f /src/testlib
parente60e8c4ef6638fa00151307e34493f4e1dcb7df2 (diff)
wasm: change logic for copying batchedtestrunner files to build dir
The previous config did not work for prefix builds (files were not copied over). To fix this, we simply copy over the files in case of a prefix build. Additionally removed batch_test_feature from the condition, as this is now the de facto wasm test runner, which supports batched and unbatched tests. Change-Id: Ib232c7898de0a0d750e4ca5ebf1da8cbcc7da3e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/CMakeLists.txt43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt
index 37f0188006..d4ce25ba0d 100644
--- a/src/testlib/CMakeLists.txt
+++ b/src/testlib/CMakeLists.txt
@@ -165,26 +165,25 @@ if(QT_FEATURE_private_tests)
add_subdirectory(doc/snippets/code)
endif()
-if(QT_FEATURE_batch_test_support AND WASM)
- set(wasm_support_libexec_files)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/batchedtestrunner.html)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/batchedtestrunner.js)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/emrunadapter.js)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qwasmjsruntime.js)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qwasmtestmain.js)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qtestoutputreporter.js)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qtestoutputreporter.css)
- list(APPEND wasm_support_libexec_files
- ${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/util.js)
-
- qt_path_join(libexec_dir ${QT_INSTALL_DIR} ${INSTALL_LIBEXECDIR})
- qt_copy_or_install(FILES ${wasm_support_libexec_files}
- DESTINATION "${libexec_dir}")
+if(WASM)
+ set(testrunner_files
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/batchedtestrunner.html"
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/batchedtestrunner.js"
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/emrunadapter.js"
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qwasmjsruntime.js"
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/qwasmtestmain.js"
+ "${QtBase_SOURCE_DIR}/util/wasm/batchedtestrunner/util.js")
+
+ qt_path_join(install_dir_libexec "${QT_INSTALL_DIR}" "${INSTALL_LIBEXECDIR}")
+ qt_copy_or_install(FILES ${testrunner_files}
+ DESTINATION "${install_dir_libexec}")
+
+ # In a prefix build, the above copy_or_install won't put the files
+ # in the build dir, but they are required there for tests at configure time
+ if(QT_WILL_INSTALL)
+ qt_path_join(build_dir_libexec "${QT_BUILD_DIR}" "${INSTALL_LIBEXECDIR}")
+ foreach(testrunner_file ${testrunner_files})
+ file(COPY "${testrunner_file}" DESTINATION "${build_dir_libexec}")
+ endforeach()
+ endif()
endif()