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". > +# Running tests requires 'foo' to be installed > +DEPEND="test? ( dev-util/foo )" > + > +# Require debug support when tests are enabled > +REQUIRED_USE="test? ( debug )" > +</codesample> > + > +</body> > +</section> > + > </body> > </chapter> > </guide> Best regards, Andrew Savchenko
pgpQJ7D4TfKlS.pgp
Description: PGP signature