From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#30198: 26.0.91; [PATCH] Fix emacs-module-tests to work with out of tree build directory Date: Sun, 21 Jan 2018 18:44:16 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1516560222 31535 195.159.176.226 (21 Jan 2018 18:43:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 Jan 2018 18:43:42 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 To: 30198@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 21 19:43:37 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edKaI-0006i7-1U for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jan 2018 19:43:14 +0100 Original-Received: from localhost ([::1]:42537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edKcI-00054b-CK for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jan 2018 13:45:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edKc7-00050l-K9 for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:45:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edKc2-0006PD-4O for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:45:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edKc2-0006P1-0X for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1edKc1-0005rQ-Po for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jan 2018 18:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151656027322458 (code B ref -1); Sun, 21 Jan 2018 18:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Jan 2018 18:44:33 +0000 Original-Received: from localhost ([127.0.0.1]:37380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edKbZ-0005q5-F9 for submit@debbugs.gnu.org; Sun, 21 Jan 2018 13:44:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edKbX-0005po-QW for submit@debbugs.gnu.org; Sun, 21 Jan 2018 13:44:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edKbR-0005ys-7I for submit@debbugs.gnu.org; Sun, 21 Jan 2018 13:44:26 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43480) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edKbR-0005ya-53 for submit@debbugs.gnu.org; Sun, 21 Jan 2018 13:44:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edKbP-0004bi-Ud for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:44:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edKbM-0005vw-RN for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:44:23 -0500 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:39429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edKbM-0005uA-Ki for bug-gnu-emacs@gnu.org; Sun, 21 Jan 2018 13:44:20 -0500 Original-Received: by mail-wm0-x233.google.com with SMTP id b21so12723796wme.4 for ; Sun, 21 Jan 2018 10:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:subject:from:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=UFXQzZiFsY1UWv/BUlZ9t9/E2/fRGcOglzbpNjguWSg=; b=g9lgWL/cPn0wzLTx8pDMnvGFbhOEP0BfgF3lmnLDB9JnYlow1XUpbVau8+v9rH3ktd xqTPrToNVYIDpRSTcfOU4TeYU+ym7ooQPeHRtkB+7dbHdltebgDcc8VdHXK69+UyXJ+s lDBJqkXHVlNV97ocVlDFpDnXN1aqXLfyOYtMIo8GSb2BSGqO0ZxUhBh7iXbRIwwsHxSZ kUHXzpWldQQtCUv9xhmHOT53F9sudKOInmDKvlbQDJyEy4KFZkDEch64bm4ah38fVebd fsNYJUcMd06+vzXhzju+k4w0rysvo19gMwxSYsmoCsAyf0lJmRP+/otrW6tWvUJ/Rv2G QhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:from:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=UFXQzZiFsY1UWv/BUlZ9t9/E2/fRGcOglzbpNjguWSg=; b=hz5Of8Pok6AjFE2/xR6Cj0Xqx6TZ/PNeRPuQPLiF++IR6wp6ZsEeTNHGUemSlv12Mm 4qsKAyZZurVklHBipNa9mbfEO2APdQ7ccKPHStVkmU5qmrWMZvJiOJHdbjbCVEFyGNK/ vsjoClNrZhrH/jdx4G2lxtSH5Xfr0oY3J7vo3u0bvdXcrMPfiGjp9T7Jg80C+HAF7RNr 1nWr42eab+8uJZu/k7PW+nZiksOLQ2xm53tcwFmLtF/2eJo+1m1Ss1Qat+DqyyUAuufS zkwrC3egXX705LFK3efesk+u9Aj6lgkoW/hkVLgnm4L+u6kjP0VpfUurQKt6DRg6OwtH W75g== X-Gm-Message-State: AKwxytfl9tDwWZ4rB7u5exowPcfT7rJCEuGIwzI/9AzdNwiv/OWMcTTE WRiz70F8nYpR8Hl12Xjl18HeGg== X-Google-Smtp-Source: AH8x226QHtRTqu3wf+/4LGJQJQHIBX4eF1g4Yor857eKnXJCsyKP3wmm+cyyUBmzJaSsN9PMpcUNYA== X-Received: by 10.28.5.145 with SMTP id 139mr3107595wmf.89.1516560258857; Sun, 21 Jan 2018 10:44:18 -0800 (PST) Original-Received: from [192.168.0.3] (82-69-64-228.dsl.in-addr.zen.co.uk. [82.69.64.228]) by smtp.gmail.com with ESMTPSA id x79sm7550459wrb.44.2018.01.21.10.44.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jan 2018 10:44:17 -0800 (PST) Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142356 Archived-At: Currently the emacs module tests fail to build when using an out of tree build directory. The following patch moves the location of the module library mod-test.{so,dll} from test/data/emacs-module to /test/data/emacs-module, as build outputs do not belong in the source tree. It also fixes the test module build to find the module header at the correct lcoation, namely /src/emacs-module.h. Tested on Windows with the mingw64-x86_64 toolchain (msys2) for both both in-tree and out-of-tree build directories: Fix emacs-module-tests to work with an out of tree build directory * test/Makefile.in(test_module_dir): Build the test module library in a subdirectory of the build directory (not the source tree). (MODULE_CFLAGS): Fix location of emacs-module.h header file. (test_module): Move built library out of the source tree. * test/src/emacs-module-tests.el(mod-test-file): Locate the test module library relative to the running emacs executable. diff --git a/test/Makefile.in b/test/Makefile.in index 341b09b03f..7c5976435c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -119,7 +119,7 @@ emacs =   EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \   $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) -test_module_dir := $(srcdir)/data/emacs-module +test_module_dir := data/emacs-module  .PHONY: all check @@ -222,12 +222,13 @@ FPIC_CFLAGS =  FPIC_CFLAGS = -fPIC  endif -MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ +MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \    $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)  test_module = $(test_module_dir)/mod-test${SO}  src/emacs-module-tests.log: $(test_module) -$(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h +$(test_module): ${srcdir}/$(test_module:${SO}=.c) ../src/emacs-module.h +    $(AM_V_at)${MKDIR_P} $(dir $@)      $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \        -o $@ $<  endif diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index d9406a9609..85d6305386 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -25,8 +25,7 @@ mod-test-emacs  (eval-and-compile    (defconst mod-test-file -    (substitute-in-file-name -     "$EMACS_TEST_DIRECTORY/data/emacs-module/mod-test") +    (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory)      "File name of the module test file."))  (require 'mod-test mod-test-file)