public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-dev@lists.gentoo.org, Andrew Savchenko <bircoph@gentoo.org>
Subject: Re: [gentoo-dev] [PATCH] Add section about defining "Test Dependencies"
Date: Sun, 26 Aug 2018 00:28:16 -0700	[thread overview]
Message-ID: <653bd4ec-102a-04fa-fdf5-e67c62756cfa@gentoo.org> (raw)
In-Reply-To: <20180826051140.431f4e28b45a8e857029e2c5@gentoo.org>


[-- Attachment #1.1: Type: text/plain, Size: 2517 bytes --]

On 08/25/2018 07:11 PM, Andrew Savchenko wrote:
> On Sat, 25 Aug 2018 14:24:02 -0400 Mike Gilbert wrote:
>> On Sat, Aug 25, 2018 at 1:41 AM Andrew Savchenko <bircoph@gentoo.org> wrote:
>>>
>>> On Fri, 24 Aug 2018 14:24:06 -0400 Mike Gilbert wrote:
>>>> ---
>>>>  general-concepts/dependencies/text.xml | 38 ++++++++++++++++++++++++++
>>>>  1 file changed, 38 insertions(+)
>>>>
>>>> diff --git a/general-concepts/dependencies/text.xml b/general-concepts/dependencies/text.xml
>>>> index 2f10380..64be9dc 100644
>>>> --- a/general-concepts/dependencies/text.xml
>>>> +++ b/general-concepts/dependencies/text.xml
>>>> @@ -578,6 +578,44 @@ valid.
>>>>  </body>
>>>>  </section>
>>>>
>>>> +<section>
>>>> +<title>Test Dependencies</title>
>>>> +<body>
>>>> +
>>>> +<p>
>>>> +Packages often have optional dependencies that are needed only when running
>>>> +tests. These should be specified in DEPEND behind a USE flag. Often, the
>>>> +'test' USE flag is used for this purpose.
>>>> +</p>
>>>> +
>>>> +<p>
>>>> +Since testing will likely fail when test dependencies are not installed, the
>>>> +test phase should be disabled in this case. This may be accomplished via USE
>>>> +conditionals in the RESTRICT variable.
>>>> +</p>
>>>> +
>>>> +<p>
>>>> +If other optional features must be enabled/disabled when testing, REQUIRED_USE
>>>> +may be set to express this.
>>>> +</p>
>>>> +
>>>> +<codesample lang="ebuild">
>>>> +# Define some USE flags
>>>> +IUSE="debug test"
>>>> +
>>>> +# Disable test phase when test USE flag is disabled
>>>> +RESTRICT="!test? ( test )"
>>>
>>> I do not understand why we need this useless code. If test USE flag
>>> is disabled, tests must be disabled as well. It is PM's job and
>>> there is no need to put this obvious stuff into each ebuild with
>>> tests and extra deps. I see no reason to support running src_test()
>>> with USE="-test".
>>
>> PMS does not specify that behavior (skipping src_test with USE=-test).
>> It is better to define the requrement explicitly rather than relying
>> on a Portage-specific behavior.
> 
> Then PMS should be fixed. Putting useless code in thousands
> of ebuilds due to bureaucratic reasons is ridiculous. Having strict
> conformance to the PMS is good, but common sense should still be
> considered.

Since PMS doesn't specify the behavior of FEATURES, I suppose we could
make FEATURES=test imply RESTRICT="!test? ( test )". Would there be any
drawbacks to that?
-- 
Thanks,
Zac


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

  reply	other threads:[~2018-08-26  7:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 18:24 [gentoo-dev] [PATCH] Add section about defining "Test Dependencies" Mike Gilbert
2018-08-25  5:41 ` Andrew Savchenko
2018-08-25 18:24   ` Mike Gilbert
2018-08-26  2:11     ` Andrew Savchenko
2018-08-26  7:28       ` Zac Medico [this message]
2018-08-26  7:39         ` Michał Górny
2018-08-26  7:58           ` Zac Medico
2018-08-26  8:08             ` Michał Górny
2018-08-26  8:43               ` Zac Medico
2018-08-26  8:54                 ` Michał Górny
2018-08-26 11:25         ` Andrew Savchenko
2018-08-26 14:10         ` Mike Gilbert
2018-08-26 13:43       ` Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=653bd4ec-102a-04fa-fdf5-e67c62756cfa@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=bircoph@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox