conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.95k stars 951 forks source link

[bug] cmake.ctest arguments are not treated properly #16503

Closed markspacehub closed 1 week ago

markspacehub commented 1 week ago

Describe the bug

OS Ubuntu 24.04 Conan Profile: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu17 compiler.libcxx=libstdc++11 compiler.version=13 os=Linux

Conan version = 2.4.1 CMake version = 3.28.3

When using cmake.ctest(cli_args="foobar") the output on the console is incorrect. The arguments have a space between each letter inserted, which prevents them from doing anything. Examples shown below:

in conanfile.py: image

output on the command line: image

The two cmake.ctest commands output their cli_args with spaces in the words and no tests are found (they should be in ./tests). below that an ls command is issued which shows that there is a tests folder. Finally I have manually run the ctest command on line 69. The console shows the desired output and the start of the tests.

The cmake.ctest command is doing something funky and is unusable for me!

How to reproduce it

No response

AbrilRBS commented 1 week ago

Hi @markspacehub, thanks for taking the time to report your issue

As with every cli_args argument in the CMake integrations, this argument expects a list of strings to pass to cmake, not a string with all the arguments already joined. It is true that the documentation for the method could be improved a tad to clear this confussion up, will update it when possible!

Let me know if this helps :)

markspacehub commented 1 week ago

Ahhh yes I see further up other cli_args have more detail or "same as above" written. Converting to: image meant the correct command was called and the tests executed.

Thanks!