From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3A661138334 for ; Mon, 10 Sep 2018 15:20:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 117A3E0960; Mon, 10 Sep 2018 15:20:17 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D97CEE0960 for ; Mon, 10 Sep 2018 15:20:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 82067335C4F for ; Mon, 10 Sep 2018 15:20:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5F80D3AA for ; Mon, 10 Sep 2018 15:20:00 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1536592685.c53568d93df9e2c94d0334e1e42e8a6de1a6797a.floppym@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/dependencies/ X-VCS-Repository: proj/devmanual X-VCS-Files: general-concepts/dependencies/text.xml X-VCS-Directories: general-concepts/dependencies/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: c53568d93df9e2c94d0334e1e42e8a6de1a6797a X-VCS-Branch: master Date: Mon, 10 Sep 2018 15:20:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a3686269-961c-43fe-936e-4a827a3af199 X-Archives-Hash: e4ab6e8fdb53ad277d905fd384872f2d commit: c53568d93df9e2c94d0334e1e42e8a6de1a6797a Author: Mike Gilbert gentoo org> AuthorDate: Fri Aug 24 18:21:10 2018 +0000 Commit: Mike Gilbert gentoo 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 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. +
+Test Dependencies + + +

+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. +

+ +

+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. +

+ +

+If other optional features must be enabled/disabled when testing, REQUIRED_USE +may be set to express this. +

+ + +# 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 )" + + + +
+