From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Tests, Emacs-25 and Conditional Features Date: Fri, 18 Mar 2016 12:00:43 +0100 Message-ID: <87pousdp9g.fsf@gmx.de> References: <87k2l2zgre.fsf@russet.org.uk> <87h9g6xzrb.fsf@gmx.de> <87shzpxvfv.fsf@russet.org.uk> <83bn6d9iml.fsf@gnu.org> <87zitwf4pz.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458298933 6239 80.91.229.3 (18 Mar 2016 11:02:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 11:02:13 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 18 12:02:00 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1agsAJ-0003Cm-5S for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2016 12:01:59 +0100 Original-Received: from localhost ([::1]:42887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agsAI-0000Hp-7y for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2016 07:01:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ags9y-0000DG-Vm for emacs-devel@gnu.org; Fri, 18 Mar 2016 07:01:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ags9v-0008Q8-1F for emacs-devel@gnu.org; Fri, 18 Mar 2016 07:01:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:60637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ags9o-0008P9-GY; Fri, 18 Mar 2016 07:01:28 -0400 Original-Received: from detlef.gmx.de ([87.146.50.242]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LhjeH-1a2sV21ODp-00mqOi; Fri, 18 Mar 2016 12:00:45 +0100 In-Reply-To: <87zitwf4pz.fsf@russet.org.uk> (Phillip Lord's message of "Fri, 18 Mar 2016 10:41:28 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:27gRgCoHu8WNCbAaZxIDEWPmjdejrOPrxuiN/RyoodwAncF/v4A nVx09qcT8WJK1jtDwknQ5Ami8k0y7mlstR7LZ8lHk5Gg4UQI63rDAmiRmx5ogaolYdGveMM LT40TbNplsyMQXs6uIh9wTtRag865mznbIGq13LpevNPwNQHNlk8bE94Ai0gNsgc4ndo8ls mQ48uMxaZBB887f2BaucA== X-UI-Out-Filterresults: notjunk:1;V01:K0:d0GP/RENT9Q=:Zlhc1IH6DnWnpoPoEhReqM j3o0kU/w1Xg/vmlMSFcBexw3aS90rCpEJ+zY0Rmw/jU2Epl3nBT8HsZTCe63hDPWkvVnhpmlj d2zUHwVubD8ih5ygtK3u1AGiw77RrnaQ2QE9kRF3mPiiVNrefDFp3iagCZzq3kKEjd1cuqA62 DbrYnXiJiyB3s+AqUFvuxxpRUMNZiqAk6/IiAK99jOYaVwynbVRzGXaFApmT+cTFpQAJ8hksZ r+PCLn7W7hgEJzIpmnSFfIbQJO4ZDAVrbu0yRD8pFcb1KaWc0tnvv1zZjlUQQqtqijE5ak5IN tJcp5bObboUTguooS9+YVvX73PLK2+TiI8rY/ev3hc1vDQEaEG4DHrCm6mG3PDjB1IeDnHh5O eLdWAXk5Im2IJn9gF1lvtOYnEHSTfss/dBS9c0uMZiHFWNDs1t/vark2TDXv/7cInI6aSwkku 4Bbgb+NejQSniMSk/hUH8IPak0lRr3KstP4Qs7JOos80rSen+Y7qprWZCCxrx1f+r9XRmsIkd cG7zQBBCnAvGPOEwXpvhQw7XGs7ZjUepRIvsBCVam0EyWUtp+AsEUNFpqt68znwvb/R/FU24s RcK+g1JF8svYRqa07ApA5sHMGXIq/FSoYnYB+HDmJen9kyIxV4uv6bs1ayJIkrue+pDLg5iTL RQ29HilEhOCAVMzeCNwsptGXDqOK4nmjS6bZ16mDvbE7IXhrQMF59snujbDE+dH8Tb8xRzg0m nyHAB4A2w5WyvuFgwu6vGRbqK0S5TMnEN8BijlbknKRqklGUt9wyxA/zdgYozZpx6YdKXQCA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201820 Archived-At: phillip.lord@russet.org.uk (Phillip Lord) writes: Hi Philip, > Something like > > (skip-unless (or (gnutls-available-p) conditional-feature-force)) > > So, we pick have a standard test selector which means "all the > conditional features should be expected to be on". Probably, you would > want "all the conditional features that are supposed to be on by > default, should be expected to be on" That does not exist for everything. For example, in the file notification case there are 5 different possible "conditional features", all of them valid: - inotify enabled - kqueue enabled - gfilenotify enabled - w32notify enable - file notification disabled. How does a test library shall know what is intended by the user? In all my tests packages, I have one test which checks all these alternatives, and maybe checks additionally whether they make sense. See file-notify-test00-availability or, more sophistiacted, tramp-test00-availability. For all other test cases, I'll start with the (skip-unless ...) form. >> Then there's the issue of how do you test this. An API that was not >> compiled into Emacs cannot be invoked, so what do we want to show the >> user? a "void function" error? ert error messages are not so easy to >> interpret. > > It would be nice if there were a standard way of detecting this. As > Michael's example shows, we have a gnutls-available-p function which > is defined if gnutls is not available, but for libxml, we check for > non-definition of functions. This would require for all optional packages to provide such a standardized form. We don't have it. One way would be to test (skip-unless (featurep 'package)). But even this is not possible in general, packages like xml.c miss Fprovide (intern_c_string ("libxml"), Qnil); Maybe this is an error in xml.c, which should be fixed? > Phil Best regards, Michael.