portage
portage copied to clipboard
ebuild: do not drop FEATURES=test when USE=-test
By convention the "test" USE flag is used to control dependencies required for execution of the src_test function.
The "test" USE flag has no special meaning in PMS.
The Gentoo Policy Guide [1] advises that ebuilds must make use of RESTRICT to disable tests based on USE flags.
Current versions of Portage will not run tests when RESTRICT=test is set, regardless of the FEATURES setting.
This code in Portage predates the Gentoo policy. It is unneeded since the policy was created and ebuilds have been updated with the necessary RESTRICT values.
[1] https://projects.gentoo.org/qa/policy-guide/other-metadata.html#pg0703
The interaction between EBUILD_FORCE_TEST and use.mask has implication for the export USE="${USE} test"
code here that we should probably also review:
https://github.com/gentoo/portage/blob/master/bin/ebuild.sh#L763
Hmm. I would would say that EBUILD_FORCE_TEST should only cause the test phase to be executed, possibly even overriding RESTRICT.
I don't see any reason to modify USE based on EBUILD_FORCE_TEST, especially since it is only meant for developers.