Commit e08f2416 authored by Andy Moreton's avatar Andy Moreton Committed by Eli Zaretskii
Browse files

Fix emacs-module-tests to work out of build tree

* 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.
parent 62e4148a
...@@ -120,7 +120,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \ ...@@ -120,7 +120,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \
$(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT)
test_module_dir := $(srcdir)/data/emacs-module test_module_dir := data/emacs-module
.PHONY: all check .PHONY: all check
...@@ -223,12 +223,13 @@ else ...@@ -223,12 +223,13 @@ else
FPIC_CFLAGS = -fPIC FPIC_CFLAGS = -fPIC
endif endif
MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
test_module = $(test_module_dir)/mod-test${SO} test_module = $(test_module_dir)/mod-test${SO}
src/emacs-module-tests.log: $(test_module) src/emacs-module-tests.log: $(test_module)
$(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h $(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) \ $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
-o $@ $< -o $@ $<
endif endif
......
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
(eval-and-compile (eval-and-compile
(defconst mod-test-file (defconst mod-test-file
(substitute-in-file-name (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory)
"$EMACS_TEST_DIRECTORY/data/emacs-module/mod-test")
"File name of the module test file.")) "File name of the module test file."))
(require 'mod-test mod-test-file) (require 'mod-test mod-test-file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment