diff options
| author | Andy Moreton | 2018-01-26 12:09:42 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-01-26 12:09:42 +0200 |
| commit | e08f241658667a328bade89ab479fc5f7389bb9b (patch) | |
| tree | 8dcec0a391a46e0cb3cce343f0499877fa84628c | |
| parent | 62e4148a395c706aa87ca6d00110f0e174ece9f1 (diff) | |
| download | emacs-e08f241658667a328bade89ab479fc5f7389bb9b.tar.gz emacs-e08f241658667a328bade89ab479fc5f7389bb9b.zip | |
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.
| -rw-r--r-- | test/Makefile.in | 5 | ||||
| -rw-r--r-- | test/src/emacs-module-tests.el | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index 3f4f8e7836c..a85d491d2d3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in | |||
| @@ -120,7 +120,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \ | |||
| 120 | EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ | 120 | EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ |
| 121 | $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) | 121 | $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) |
| 122 | 122 | ||
| 123 | test_module_dir := $(srcdir)/data/emacs-module | 123 | test_module_dir := data/emacs-module |
| 124 | 124 | ||
| 125 | .PHONY: all check | 125 | .PHONY: all check |
| 126 | 126 | ||
| @@ -223,12 +223,13 @@ else | |||
| 223 | FPIC_CFLAGS = -fPIC | 223 | FPIC_CFLAGS = -fPIC |
| 224 | endif | 224 | endif |
| 225 | 225 | ||
| 226 | MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ | 226 | MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ |
| 227 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) | 227 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) |
| 228 | 228 | ||
| 229 | test_module = $(test_module_dir)/mod-test${SO} | 229 | test_module = $(test_module_dir)/mod-test${SO} |
| 230 | src/emacs-module-tests.log: $(test_module) | 230 | src/emacs-module-tests.log: $(test_module) |
| 231 | $(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h | 231 | $(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h |
| 232 | $(AM_V_at)${MKDIR_P} $(dir $@) | ||
| 232 | $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ | 233 | $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ |
| 233 | -o $@ $< | 234 | -o $@ $< |
| 234 | endif | 235 | endif |
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index d9406a9609e..85d63053867 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el | |||
| @@ -25,8 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | (eval-and-compile | 26 | (eval-and-compile |
| 27 | (defconst mod-test-file | 27 | (defconst mod-test-file |
| 28 | (substitute-in-file-name | 28 | (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory) |
| 29 | "$EMACS_TEST_DIRECTORY/data/emacs-module/mod-test") | ||
| 30 | "File name of the module test file.")) | 29 | "File name of the module test file.")) |
| 31 | 30 | ||
| 32 | (require 'mod-test mod-test-file) | 31 | (require 'mod-test mod-test-file) |