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 48AAE138334 for ; Fri, 24 Aug 2018 18:24:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A99FAE0965; Fri, 24 Aug 2018 18:24:13 +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 5D4FDE0961 for ; Fri, 24 Aug 2018 18:24:13 +0000 (UTC) Received: from naomi.gilbertsystems.net (unknown [24.192.26.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id E04DE335C7D; Fri, 24 Aug 2018 18:24:10 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Cc: devmanual@gentoo.org Subject: [gentoo-dev] [PATCH] Add section about defining "Test Dependencies" Date: Fri, 24 Aug 2018 14:24:06 -0400 Message-Id: <20180824182406.17134-1-floppym@gentoo.org> X-Mailer: git-send-email 2.18.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: a3b90389-7483-4d4e-9fc6-bc52d3f51351 X-Archives-Hash: ee3974a8beb9af6a31a1501f58a949b5 --- 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. +
+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" + +# Disable test phase when test USE flag is disabled +RESTRICT="!test? ( test )" + +# Running tests requires 'foo' to be installed +DEPEND="test? ( dev-util/foo )" + +# Require debug support when tests are enabled +REQUIRED_USE="test? ( debug )" + + + +
+ -- 2.18.0