Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 760051 - devmanual: src_test section misinforms on IUSE=test
Summary: devmanual: src_test section misinforms on IUSE=test
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-15 08:16 UTC by Michał Górny
Modified: 2021-01-03 13:57 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed change (src_test.diff,1.19 KB, patch)
2020-12-15 09:04 UTC, Ulrich Müller
Details | Diff
proposed change v2 (0001-ebuild-writing-functions-src_test-IUSE-test-is-not-r.patch,1.81 KB, patch)
2020-12-15 10:28 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-15 08:16:14 UTC
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.
Comment 1 Ulrich Müller gentoo-dev 2020-12-15 08:30:39 UTC
Looks like I missed this when merging the patch from bug 735570.
Comment 2 Ulrich Müller gentoo-dev 2020-12-15 09:04:26 UTC
Created attachment 678370 [details, diff]
proposed change

How about this change?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-15 09:50:11 UTC
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.
Comment 4 Florian Schmaus gentoo-dev 2020-12-15 10:08:55 UTC
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?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-15 10:13:47 UTC
(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.
Comment 6 Ulrich Müller gentoo-dev 2020-12-15 10:21:24 UTC
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.
Comment 7 Ulrich Müller gentoo-dev 2020-12-15 10:28:58 UTC
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.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-15 10:57:59 UTC
v2 LGTM.
Comment 9 Larry the Git Cow gentoo-dev 2021-01-03 13:57:55 UTC
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(-)