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 BC06B1396D1 for ; Thu, 24 Aug 2017 19:02:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2335E0D47; Thu, 24 Aug 2017 19:02:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 D37D3E0D47 for ; Thu, 24 Aug 2017 19:02:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 EB53333FE7D for ; Thu, 24 Aug 2017 19:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C5B1814F for ; Thu, 24 Aug 2017 19:02:05 +0000 (UTC) From: "Göktürk Yüksek" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Göktürk Yüksek" Message-ID: <1503601222.084a5771a359da6a083e8f11169ccfdff6066abd.gokturk@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: gokturk X-VCS-Committer-Name: Göktürk Yüksek X-VCS-Revision: 084a5771a359da6a083e8f11169ccfdff6066abd X-VCS-Branch: master Date: Thu, 24 Aug 2017 19:02:05 +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-Archives-Salt: 2e002a8e-a189-4723-978f-ed9db95582e9 X-Archives-Hash: 9ad8185895f8ad591892c3ceeb26003e commit: 084a5771a359da6a083e8f11169ccfdff6066abd Author: Michał Górny gentoo org> AuthorDate: Tue Aug 22 09:02:51 2017 +0000 Commit: Göktürk Yüksek gentoo 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() {
+Tests that require X11 + +

+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. +

+ +

+If the program in question does not strictly need X11 but merely +attempts to take opportunity of the DISPLAY variable being set, +the best solution is to simply unset this variable in the 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 +} + + +

+If the package actually requires a running X11 server to run +the complete test suite, you can use the virtualx 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. +

+ + +inherit virtualx + +src_test() { + virtx default +} + + +
+ +
Common <c>src_test</c> Tasks