summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-01-19 22:14:07 +0100
committerMichał Górny <mgorny@gentoo.org>2020-01-22 04:05:44 +0100
commitc674d07888a8b95b2f39a8bcdc7755e0b1560451 (patch)
tree8d01efe5c5ae3abed457f5e3aa7e993abce6c2d0
parentother-metadata: meaningful homepage policy (diff)
downloadpolicy-guide-c674d07888a8b95b2f39a8bcdc7755e0b1560451.tar.gz
policy-guide-c674d07888a8b95b2f39a8bcdc7755e0b1560451.tar.bz2
policy-guide-c674d07888a8b95b2f39a8bcdc7755e0b1560451.zip
other-metadata: RESTRICT="!test? ( test )"
Closes: https://bugs.gentoo.org/705892 Closes: https://github.com/gentoo/policy-guide/pull/9 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--other-metadata.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/other-metadata.rst b/other-metadata.rst
index 61749cb..f05014b 100644
--- a/other-metadata.rst
+++ b/other-metadata.rst
@@ -63,4 +63,35 @@ those cases, using the explicit No_homepage marker at least makes it
easy to identify such packages.
+.. index::
+ single: restrict; test; USE=-test
+ single: USE flags; test; restrict
+
+RESTRICT=test for USE=-test
+---------------------------
+:Source: QA
+:Reported: by pkgcheck
+
+Whenever the package uses ``test`` flag to control test prerequisites
+(or another flag with a similar purpose), it must explicitly restrict
+tests when the flag is unset.
+
+*Example*::
+
+ IUSE="test"
+ RESTRICT="!test? ( test )"
+
+*Rationale*: contrary to common assumption, ``test`` flag is not special
+and the package manager can execute tests when the flag is disabled.
+The explicit restriction guarantees that tests will be skipped under
+this circumstance, and they will not fail for users.
+
+.. Note::
+ Technically there are packages that do not strictly require this
+ restriction since they handle missing test prerequisites gracefully
+ (e.g. by skipping the tests). However, we enforce the rule for all
+ packages since omitting the restriction by mistake is much more
+ common, and there is little harm in overspecifying it.
+
+
.. _metadata invariance: https://projects.gentoo.org/pms/7/pms.html#x1-600007.1