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 2DF51138359 for ; Wed, 19 Aug 2020 17:32:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 52BCEE09D6; Wed, 19 Aug 2020 17:32:49 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 2F08BE09D6 for ; Wed, 19 Aug 2020 17:32:49 +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 A313234F2E0 for ; Wed, 19 Aug 2020 17:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 24374310 for ; Wed, 19 Aug 2020 17:32:46 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1597858182.b2ad7639d04e296312820025c9b8f77d22272028.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_test/ X-VCS-Repository: proj/devmanual X-VCS-Files: ebuild-writing/functions/src_test/text.xml X-VCS-Directories: ebuild-writing/functions/src_test/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: b2ad7639d04e296312820025c9b8f77d22272028 X-VCS-Branch: master Date: Wed, 19 Aug 2020 17:32:46 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f4e8f5b6-6218-4373-b8aa-f45a5b9e60e2 X-Archives-Hash: e018ffe0c9cbe9bd46dded5a4bc83282 commit: b2ad7639d04e296312820025c9b8f77d22272028 Author: Florian Schmaus geekplace eu> AuthorDate: Sun Aug 2 17:17:15 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Aug 19 17:29:42 2020 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=b2ad7639 ebuild-writing/functions/src_test: re-organize, merge sections Merge "Common src_test Tasks" and "Skipping Tests" sections into a new section right after "Sample src_test". Also forward the reader to the related paragraph on test-only dependencies in this new section. Before that, the src_test documentation page was silent about that, rather important, topic. This also includes the RESTRICT="!test? ( test )" idiom. Signed-off-by: Florian Schmaus geekplace.eu> Closes: https://bugs.gentoo.org/735570 [Whitespace changes] Signed-off-by: Ulrich Müller gentoo.org> ebuild-writing/functions/src_test/text.xml | 108 ++++++++++++++++------------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/ebuild-writing/functions/src_test/text.xml b/ebuild-writing/functions/src_test/text.xml index c278aa0..fbd0751 100644 --- a/ebuild-writing/functions/src_test/text.xml +++ b/ebuild-writing/functions/src_test/text.xml @@ -62,6 +62,66 @@ src_test() { +
+Supporting test suites in packages + + +

+If the packaged software is equipped with a test suite, it is sensible +to make the package aware of it. This allows the package manager to +run the software's unit tests. Packages with a test suite must +announce the "test" USE flag. +

+ + +IUSE="test" + + +

+The next important aspect to consider are test-only dependencies, i.e. +dependencies that are only required to run the test suite. Test-only +dependencies should be specified in a DEPEND behind a USE flag. +Please refer to the section on + +for more information. +

+ +

+Often the default src_test is fine. Sometimes it is necessary +to remove certain tests from the list if they cannot be used with a +portage environment. Reasons for such a failure could include: +

+ +
    +
  • + Needing to work with files which are disallowed by the sandbox. +
  • +
  • Requiring user input (src_test must not be interactive).
  • +
  • Requiring root privileges.
  • +
+ +

+Usually, removing the relevant test from the Makefile +using sed or skipping a particular make target is +sufficient. +

+ +

+Try to ensure that tests work properly for your ebuild. A good test +suite is extremely helpful for arch maintainers. +Sometimes it is necessary to skip tests entirely. This can be done by +setting RESTRICT="test" in the ebuild. +

+ + +If upstream provides a test suite that doesn't work, consider talking +to them about getting it fixed. A broken test suite requires developers +to investigate each test failure in order to determine whether it is +genuine or indicates a broken test. + + +
+
Tests that require network or service access @@ -207,53 +267,5 @@ src_test() {
-
-Common <c>src_test</c> Tasks - -

-Often the default src_test is fine. Sometimes it is necessary -to remove certain tests from the list if they cannot be used with a -portage environment. Reasons for such a failure could include: -

- -
    -
  • - Needing to work with files which are disallowed by the sandbox. -
  • -
  • Requiring user input (src_test must not be interactive).
  • -
  • Requiring root privileges.
  • -
- -

-Usually, removing the relevant test from the Makefile -using sed or skipping a particular make target is -sufficient. -

- -

-Try to ensure that tests work properly for your ebuild. A good test -suite is extremely helpful for arch maintainers. -

- - -
- -
-Skipping Tests - -

-Sometimes it is necessary to skip tests entirely. This can be done by -setting RESTRICT="test" in the ebuild. -

- - -If upstream provides a test suite that doesn't work, consider talking -to them about getting it fixed. A broken test suite requires developers -to investigate each test failure in order to determine whether it is -genuine or indicates a broken test. - - -
-