https://devmanual.gentoo.org/ebuild-writing/functions/src_test/ > If the packaged software is equipped with a test suite, it is sensible to make the package aware of it. This allows the package manager to run the software's unit tests. Packages with a test suite must announce the "test" USE flag.
Looks like I missed this when merging the patch from bug 735570.
Created attachment 678370 [details, diff] proposed change How about this change?
Comment on attachment 678370 [details, diff] proposed change >diff --git a/ebuild-writing/functions/src_test/text.xml b/ebuild-writing/functions/src_test/text.xml >index d214b15..1a2fe04 100644 >--- a/ebuild-writing/functions/src_test/text.xml >+++ b/ebuild-writing/functions/src_test/text.xml >@@ -68,20 +68,10 @@ src_test() { > > <p> > If the packaged software is equipped with a test suite, it is sensible >-to make the package aware of it. This allows the package manager to >-run the software's unit tests. Packages with a test suite must >-announce the "test" USE flag. >-</p> >- >-<codesample lang="ebuild"> >-IUSE="test" >-</codesample> >- >-<p> >-The next important aspect to consider are test-only dependencies, i.e. >-dependencies that are only required to run the test suite. Test-only >-dependencies should be specified in a DEPEND behind a USE flag. >-Please refer to the section on >+to run it. Sometimes the package will need additional dependencies for this, >+i.e., dependencies that are only required to run the test suite. Such test-only >+dependencies should be specified in a DEPEND behind a USE flag; often, the ...or BDEPEND. >+<c>test</c> USE flag will be used for this. Please refer to the section on > <uri link="::general-concepts/dependencies/#Test Dependencies"/> > for more information. > </p> I wonder if it makes sense to mention configure switches too.
So IUSE="test" is not required? Given that it is probably a common mistake, as I see it a lot in gentoo-tree ebuilds, wouldn't it be sensible to also explicitly hint towards IUSE="test" not being necessary? Or am I missing something?
(In reply to Florian Schmaus from comment #4) > So IUSE="test" is not required? Given that it is probably a common mistake, > as I see it a lot in gentoo-tree ebuilds, wouldn't it be sensible to also > explicitly hint towards IUSE="test" not being necessary? Or am I missing > something? Correct - IUSE="test" (or in theory, any other USE flag, but please don't do that) is only needed for test dependencies or as a hack to conditionally build tests. I agree.
AFAICS simply the general rule applies that there shouldn't be any flags in IUSE which aren't actually used. That is, if the "test" flag is neither used in metadata (like USE-conditional dependencies) nor in phase functions then it must not appear in IUSE.
Created attachment 678376 [details, diff] proposed change v2 (In reply to Michał Górny from comment #3) > >+dependencies should be specified in a DEPEND behind a USE flag; often, the > > ...or BDEPEND. Right. Updated patch is attached. > I wonder if it makes sense to mention configure switches too. That's a separate problem.
v2 LGTM.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=7d12a219103e5951c0c5c25cf12abdc306d29868 commit 7d12a219103e5951c0c5c25cf12abdc306d29868 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2020-12-15 10:24:48 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2021-01-03 13:57:24 +0000 ebuild-writing/functions/src_test: IUSE=test is not required. Closes: https://bugs.gentoo.org/760051 Signed-off-by: Ulrich Müller <ulm@gentoo.org> ebuild-writing/functions/src_test/text.xml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)