Commit Graph

6 Commits

Author SHA1 Message Date
Alexey Edelev ba09bec5ec Rework the argument escaping and wrapping in _qt_internal_create_command_script
Use the quote-based argument wrapping when generating the command line
scripts for the tests. Apply the wrapping and escaping of the arguments
right before writing the script with the following advanced rules:
- if argument is already wrapped using quotes, skip wrapping
- if argument is a CMake variable, skip wrapping
- wrap the argument with qoutes otherwise

The above should cover the most common usecases in centralized place
when we generate the test wrapper scripts.

Remove other ways we wrap arguments in other places, like square bracket
wrapping in qt_internal_create_test_script.

Change-Id: If287dd75d6fb36260b5cf8a687215bda9c9fc1c0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-10-03 12:37:34 +02:00
Even Oscar Andersen 5c05f5cd7f wasm: Make sure emrun.bat is used when running autotests on windows
The test system tried to run emrun (No .bat). This failed with a
file-not-found error on windows.

Also there was a test for (WIN32) when deciding to use cmd /c.
This test has been updated to (CMAKE_HOST_WIN32)

Also the aforementioned cmd /c was not present in the test run
output. It has been added.

Fixes: QTBUG-121996
Change-Id: Ib3c053949865038ad43abd479402f5e8e3c015ac
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-13 20:53:33 +00:00
Mikolaj Boc b134300bc4 Make qt_internal_test_batch_target_name publicly available
The batch test target name is a useful thing to obtain in various
target-generating scripts.

Change-Id: I9605cf860fe1485e48108eba7e93f9064209d8fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-25 18:04:19 +02:00
Lucie Gérard 32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Alexandru Croitor 459f714662 CMake: Add COMMAND_ECHO option to _qt_internal_create_command_script
Pick-to: 6.4
Change-Id: I7884855b7934c1f65d8699759408f5c89632ba11
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-17 21:21:57 +02:00
Alexandru Croitor edb88a3b29 CMake: Move _qt_internal_create_command_script to a public file
It's needed for creating qmake build tests.

CMake / CTest has a limitation of not allowing to create single-config
tests when using a multi-config generator using the add_test(NAME)
signature.

Using add_test(NAME) forcefully creates per-config tests, which means
that it's not possible to just run ctest to execute tests, without
specifying a -C parameter, which we do in the CI.

qmake tests need to use the add_test(NAME) signature
to specify the WORKING_DIRECTORY option.

Because of the above limitation, a work around is to not use the
add_test(NAME) signature, but instead delegate the working directory
assignment to a generated cmake script, which
_qt_internal_create_command_script can already do.

Pick-to: 6.4
Task-number: QTBUG-96058
Change-Id: I6f439165994671724157f0edb7a71e351271e329
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-08-17 21:21:57 +02:00