Closed KazNX closed 4 years ago
Thanks for the report.
It should be fairly easy to update the function which currently extracts the build type from the CMake cache to check the passed CTest args before if a build type was passed explicitly.
Would you like to contribute a pull request to support this use case?
@KazNX Friendly ping.
Correction: I've just worked out that the current behaviour is sort of correct. The existing behaviour will generate command lines like the following:
ctest -C Debug -C Release
Note the presence of multiple -C
(or the --build-config
alias) arguments. When I reported the issue, I had incorrectly configured my mixin to pass -C=Release
, which CTest interprets as a distinct and unknown argument.
While this reduces lowers the significance of this bug report and the PR above, the fix should stand as the duplication of ctest arguments is technically incorrect. The PR removes the -C
duplication.
Resolved by #65.
Colcon does not respect using
--ctest-args --build-type <config>
(where--build-type
is equivalent to-C
). Instead it reads the CMakeCache and extracts the last value forCMAKE_BUILD_TYPE
. This does not work well with multi-configuration generators as you can only test the last build run.Colcon's test functionality should prefer an explicityl
--build-type
specification on the command line over the current behaviour.