[meson] Fixes for test and install + meson_test & meson_install - #6574
Conversation
- Fixed inability to run execute `test` and `install` separately, that is without `build` step. - Added `meson_test` method, which executes `meson test` (compared to `ninja test` in test). `meson test` have multiple options for tests configuration (https://mesonbuild.com/Unit-tests.html).
|
Ideally (implementations of) |
jgsogo
left a comment
There was a problem hiding this comment.
Thanks a lot for your work on this PR, specially for taking care not breaking the existing behavior and writing the docs. Thanks!
The behavior will change: now the barrier self._conanfile.should_build is not taken into account for install and test functions, but it matches current behavior in other build-helpers like CMake and it totally makes sense. I hope noone complains 🤞
About functions meson_test and meson_install, your suggestion should be taken into account for Conan v2, let's open an issue with that.
Thanks again 🎉 !!
|
I want to add meson version checking to this PR before merging (in case user has an older version, where new methods are not available). |
Yes, I think that we can assume that a |
| def meson_install(self, args=None, build_dir=None): | ||
| if not self._conanfile.should_install: | ||
| return | ||
| self._run_meson_command(subcommand='install', args=args, build_dir=build_dir) |
There was a problem hiding this comment.
These commands might not be supported by all meson versions, so @TheQwertiest is suggesting to add a version check to decide behavior. I am fine with that.
|
Tomorrow I will merge this. I think it can be merged even if the version check is not there, after all, they are new methods, very low risk. Version check could be added later, or maybe even not necessary. Do you think that it is very important? |
|
it's not very important, just a better diagnostics message. |
Cool, I am going to merge this now. If you manage to do it, please open a new PR, thanks! |
[meson] Docs for conan-io/conan#3936 and conan-io/conan#6574
Changelog: Feature: Fixed inability to run execute
testandinstallseparately, that is, withoutbuildstep. Addedmeson_test()method, which executesmeson test(compared toninja testintest()). Addedmeson_install()method, which executesmeson install(compared toninja installininstall()).Docs: conan-io/docs#1568
Fixed inability to run execute
testandinstallseparately, that is, withoutbuildstep. Addedmeson_test()method, which executesmeson test(compared toninja testintest()).meson testhave multiple options for additional test configuration (https://mesonbuild.com/Unit-tests.html#testing-tool). Addedmeson_install()method, which executesmeson install(compared toninja installininstall()).meson installhave multiple options for additional installation configuration (https://mesonbuild.com/Installing.html#custom-install-behaviour).developbranch, documenting this one.