diff options
authorMichał Górny <>2020-01-19 22:14:07 +0100
committerMichał Górny <>2020-01-22 04:05:44 +0100
commitc674d07888a8b95b2f39a8bcdc7755e0b1560451 (patch)
parentother-metadata: meaningful homepage policy (diff)
other-metadata: RESTRICT="!test? ( test )"
Closes: Closes: Signed-off-by: Michał Górny <>
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.
+ 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: