]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix emacs-module-tests to work out of build tree
authorAndy Moreton <andrewjmoreton@gmail.com>
Fri, 26 Jan 2018 10:09:42 +0000 (12:09 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 26 Jan 2018 10:09:42 +0000 (12:09 +0200)
* 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.

test/Makefile.in
test/src/emacs-module-tests.el

index 3f4f8e7836c6098afbcef45ca5d9f709057a99df..a85d491d2d3caf12ad9f09c3415676344a9b1847 100644 (file)
@@ -120,7 +120,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
  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
 
@@ -223,12 +223,13 @@ else
 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
+       $(AM_V_at)${MKDIR_P} $(dir $@)
        $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
          -o $@ $<
 endif
index d9406a9609e131f53b86a043af09dd72a52cfdba..85d63053867b75f4d5ed39c05298dbb5e2888455 100644 (file)
@@ -25,8 +25,7 @@
 
 (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)