New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CMake.test() target for Ninja Multi-Config #11594
Fix CMake.test() target for Ninja Multi-Config #11594
Conversation
I used the test_run_tests test case from conans/test/unittests/client/build/cmake_test.py as basis for this new test. Unfortunately there seem to be not that many tests for the new CMake tool. Please advise if something is off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this fix.
write_cmake_presets(conanfile, "toolchain", generator, {}) | ||
cmake = CMake(conanfile) | ||
cmake.test() | ||
assert "'--target' '%s'" % target in conanfile.command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert "'--target' '%s'" % target in conanfile.command | |
if platform.system() == "Windows": | |
assert "--target %s" % target in conanfile.command | |
else: | |
assert "'--target' '%s'" % target in conanfile.command |
There is a small difference atm in the command in Windows, the args are not quoted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the suggestion. I added the platform
import and made the search pattern conditional on the platform.
Merged, this will be released in 1.51. |
Changelog: Bugfix: Use correct build target in
CMake.test()
for the Ninja Multi-Config generator.Docs: omit
Fixes #11405