public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/dependencies/
Date: Mon, 10 Sep 2018 15:20:00 +0000 (UTC)	[thread overview]
Message-ID: <1536592685.c53568d93df9e2c94d0334e1e42e8a6de1a6797a.floppym@gentoo> (raw)

commit:     c53568d93df9e2c94d0334e1e42e8a6de1a6797a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 24 18:21:10 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 15:18:05 2018 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=c53568d9

Add section about defining "Test Dependencies"

Reviewed-by: Ulrich Müller <ulm <AT> gentoo.org>

 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..6b0ce38 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"
+
+# Require debug support when tests are enabled
+REQUIRED_USE="test? ( debug )"
+
+# Disable test phase when test USE flag is disabled
+RESTRICT="!test? ( test )"
+
+# Running tests requires 'foo' to be installed
+DEPEND="test? ( dev-util/foo )"
+</codesample>
+
+</body>
+</section>
+
 </body>
 </chapter>
 </guide>


             reply	other threads:[~2018-09-10 15:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 15:20 Mike Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-28 19:36 [gentoo-commits] proj/devmanual:master commit in: general-concepts/dependencies/ Ulrich Müller
2023-09-27  8:30 Ulrich Müller
2022-06-24  9:14 Ulrich Müller
2022-05-27  9:00 Ulrich Müller
2022-05-22  6:37 Joonas Niilola
2022-05-22  6:37 Joonas Niilola
2022-02-21  5:22 Sam James
2022-02-21  5:22 Sam James
2021-10-19  9:27 Mike Frysinger
2021-10-13 13:42 Ulrich Müller
2021-03-29 20:44 Ulrich Müller
2021-03-29 20:44 Ulrich Müller
2021-03-29 20:44 Ulrich Müller
2021-03-11 12:44 Ulrich Müller
2021-03-11 12:44 Ulrich Müller
2021-03-11 12:44 Ulrich Müller
2020-05-25 15:43 Ulrich Müller
2020-05-25 15:43 Ulrich Müller
2020-01-29  7:59 Ulrich Müller
2020-01-29  7:59 Ulrich Müller
2020-01-29  7:59 Ulrich Müller
2020-01-23  7:47 Ulrich Müller
2019-12-21  5:19 Ulrich Müller
2019-10-16 18:49 Göktürk Yüksek
2017-09-25  4:31 Göktürk Yüksek
2017-09-25  4:31 Göktürk Yüksek
2017-09-25  4:31 Göktürk Yüksek
2014-10-18 17:40 Markos Chandras
2013-07-29 21:53 Julian Ospald
2013-07-29 21:53 Julian Ospald
2011-02-17 21:08 Jeremy Olexa

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=1536592685.c53568d93df9e2c94d0334e1e42e8a6de1a6797a.floppym@gentoo \
    --to=floppym@gentoo.org \
    --cc=gentoo-commits@lists.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