public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Göktürk Yüksek" <gokturk@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_test/
Date: Thu, 24 Aug 2017 19:02:05 +0000 (UTC)	[thread overview]
Message-ID: <1503601222.084a5771a359da6a083e8f11169ccfdff6066abd.gokturk@gentoo> (raw)

commit:     084a5771a359da6a083e8f11169ccfdff6066abd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 22 09:02:51 2017 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Thu Aug 24 19:00:22 2017 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=084a5771

ebuild-writing/.../src_test: Provide a detailed solution for X11 requirement

 ebuild-writing/functions/src_test/text.xml | 44 ++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/ebuild-writing/functions/src_test/text.xml b/ebuild-writing/functions/src_test/text.xml
index 5d1ba3f..bd8f297 100644
--- a/ebuild-writing/functions/src_test/text.xml
+++ b/ebuild-writing/functions/src_test/text.xml
@@ -63,6 +63,50 @@ src_test() {
 </section>
 
 <section>
+<title>Tests that require X11</title>
+<body>
+<p>
+Some packages include tests (or other build-time applications) that
+attempt to use the user's X11 session and fail being unable to connect
+to it. Those tests need to be fixed to work independently of the X11
+server that might or might not be running when packages are being built.
+</p>
+
+<p>
+If the program in question does not strictly need X11 but merely
+attempts to take opportunity of the <c>DISPLAY</c> variable being set,
+the best solution is to simply unset this variable in the ebuild.
+</p>
+
+<codesample lang="ebuild">
+src_test() {
+	# tests attempt to connect to X11 and fail when it is set
+	# however, they work just fine without X11
+	unset DISPLAY
+
+	default
+}
+</codesample>
+
+<p>
+If the package actually requires a running X11 server to run
+the complete test suite, you can use the <c>virtualx</c> eclass to
+provide an isolated Xvfb environment for the tests to use. It provides
+a virtual X11 display that is not connected to any physical device
+and that programs can use reliably.
+</p>
+
+<codesample lang="ebuild">
+inherit virtualx
+
+src_test() {
+	virtx default
+}
+</codesample>
+</body>
+</section>
+
+<section>
 <title>Common <c>src_test</c> Tasks</title>
 <body>
 <p>


             reply	other threads:[~2017-08-24 19:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 19:02 Göktürk Yüksek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-01  9:55 [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_test/ Ulrich Müller
2021-08-01  9:51 Ulrich Müller
2021-07-06  8:03 Ulrich Müller
2021-01-03 13:57 Ulrich Müller
2020-08-28 19:02 Ulrich Müller
2020-08-19 17:32 Ulrich Müller
2017-08-24 19:08 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek
2017-08-24 19:02 Göktürk Yüksek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503601222.084a5771a359da6a083e8f11169ccfdff6066abd.gokturk@gentoo \
    --to=gokturk@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox