emacs-module-tests: fix VPATH builds
authorRob Browning <rlb@defaultvalue.org>
Thu, 20 Aug 2020 00:14:35 +0000 (19:14 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 23 Aug 2020 19:56:39 +0000 (14:56 -0500)
Add the actual srcdir to the MODULE_CFLAGS include path, and adjust
the module/describe-function-1 test to ignore the shared library path
prefix, which varies when building outside the source tree.

Bug: https://debbugs.gnu.org/37797
Status: new

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

index f03c194a7cbaf958a0a838b994df3c2a0a0d92f6..6c433f1d682b6a49b5f0857df665d0d70f8137d0 100644 (file)
@@ -260,7 +260,7 @@ GMP_OBJ = $(if @GMP_OBJ@, ../src/@GMP_OBJ@)
 
 # Note: emacs-module.h is generated from emacs-module.h.in, hence we
 # look in ../src, not $(srcdir)/../src.
-MODULE_CFLAGS = -I../src -I$(srcdir)/../lib \
+MODULE_CFLAGS = -I../src -I$(srcdir)/../src -I$(srcdir)/../lib \
   $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
   $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
 
index 91206156f85be9a54a17c81952ce459b12cd0759..1b512aff5660e9d0cf57cea5bdbcc0eb1f23c284 100644 (file)
@@ -318,14 +318,15 @@ local reference."
   (with-temp-buffer
     (let ((standard-output (current-buffer)))
       (describe-function-1 #'mod-test-sum)
-      (should (equal
-               (buffer-substring-no-properties 1 (point-max))
-               (format "a module function in `data/emacs-module/mod-test%s'.
+      (let ((result (buffer-substring-no-properties 1 (point-max))))
+        (should (string-match-p
+                 (format "a module function in `.*data/emacs-module/mod-test%s'.
 
 (mod-test-sum a b)
 
-Return A + B"
-                       module-file-suffix))))))
+Return A \\+ B"
+                         module-file-suffix)
+                 (buffer-substring-no-properties 1 (point-max))))))))
 
 (ert-deftest module/load-history ()
   "Check that Bug#30164 is fixed."