Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 541938

Summary: QA: add RESTRICT="!test? ( test )" to packages using USE=test
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Gentoo Quality Assurance Team <qa>
Status: RESOLVED FIXED    
Severity: normal CC: floppym, flow, pacho, pms, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-03-02 19:31:40 UTC
Well, long story short, we rely on USE=test being magical while it has no reason whatsoever to really be magical. I think we could at least sanitize this a bit by doing:

  RESTRICT="!test? ( test )"

which would mean that tests can't be run if USE=test is disabled (and therefore the dependencies aren't satisfied.
Comment 1 Mike Gilbert gentoo-dev 2015-03-03 03:43:53 UTC
I'm not sure to whom you meant to assign this bug.
Comment 2 Ulrich Müller gentoo-dev 2015-03-03 07:40:34 UTC
*shrug* This is just another workaround which doesn't address the real issue. There shouldn't be a test USE flag, in the first place. Also the flag won't get less magical, unless Portage is changed not to enable it depending on FEATURES.

What we really need is a TDEPEND variable (or a generalised DEPENDENCIES variable) for expressing src_test dependencies.
Comment 3 Zac Medico gentoo-dev 2015-03-03 18:43:35 UTC
(In reply to Ulrich Müller from comment #2)
> *shrug* This is just another workaround which doesn't address the real
> issue. There shouldn't be a test USE flag, in the first place. Also the flag
> won't get less magical, unless Portage is changed not to enable it depending
> on FEATURES.

If we grep the tree for ebuilds containing 'use test', then we find some ebuilds using this conditional inside src_compile. So, we should do a comprehensive analysis of the utility of 'use test' in src_compile before we decide to do away with the flag. Maybe it could be replaced with a tests_enabled function, or something like that.

> What we really need is a TDEPEND variable (or a generalised DEPENDENCIES
> variable) for expressing src_test dependencies.

That would be nice for a new EAPI, but the RESTRICT="!test? ( test )" thing seems quite reasonable for existing EAPIs.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-04-14 09:05:33 UTC
So anyone strongly against it before I push this further?