1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-19 01:10:57 -08:00
emacs/test/src
Paul Eggert 6e66d1f90a Decouple mod-test.c from Gnulib
mod-test.c should not use Gnulib code, as that creates
unnecessary coupling between Emacs internals and this test module.
Also Gnulib code is compiled without -fPIC whereas mod-test.c
needs -fPIC and recompiling Gnulib with -fPIC would be too painful.
* src/Makefile.in (LIB_NANOSLEEP): New macro.
(LIBES): Use it.
* test/Makefile.in (REPLACE_FREE, FREE_SOURCE_0, FREE_SOURCE_0):
Remove.  All uses removed.
(LIB_CLOCK_GETTIME, LIB_NANOSLEEP): New macros.
(MODULE_CFLAGS): Do not -I from lib as that would include Gnulib
modifications to standard .h files (e.g., "#define nanosleep
rpl_nanosleep") and we don’t want the Gnulib replacements.
Instead, for gmp.h (on platforms lacking <gmp.h>) simply '-I.'
with a suitable gmp.h.
(gmp.h): New rule to create a suitable gmp.h.
($(test_module)): Depend on config.h since the code uses config.h.
Depend on gmp.h if we need to create a suitable one.
If compiling mini-gmp.h, compile the original one and not
the Emacs-specific one, to lessen coupling with Emacs internals.
Link with LIB_CLOCK_GETTIME and LIB_NANOSLEEP.
(clean): Remove gmp.h.
* test/src/emacs-module-resources/mod-test.c: Don’t include timespec.h.
All uses of timespec.h APIs changed to use system-supplied APIs.
Change _Static_assert to plain assert, so that we needn’t rely
on Gnulib’s _Static_assert.
(timespec_le) [CLOCK_REALTIME]: New function.
Change use of timespec_cmp changed to use this instead.
(Fmod_test_sleep_until, Fmod_test_nanoseconds):
Define these functions and their Lisp names mod-test-sleep-until
and mod-test-nanoseconds only if CLOCK_REALTIME,
since they now won’t work on platforms lacking CLOCK_REALTIME.
(Fmod_test_nanoseconds): Just use _Static_assert since it
should work on all platforms.
* test/src/emacs-module-tests.el (mod-test-sleep-until)
(mod-test-nanoseconds, mod-test-double):
Skip test if the corresponding functione is not defined.
2022-03-08 18:51:18 -08:00
..
comp-resources Silence byte-compiler slightly in tests 2022-01-27 04:25:08 +01:00
emacs-module-resources Decouple mod-test.c from Gnulib 2022-03-08 18:51:18 -08:00
lread-resources
regex-resources
syntax-resources
alloc-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
buffer-tests.el Silence byte-compiler in two tests 2022-02-04 14:18:35 +01:00
callint-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
callproc-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
casefiddle-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
character-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
charset-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
chartab-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
cmds-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
coding-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
comp-tests.el Merge from origin/emacs-28 2022-02-10 06:56:22 +01:00
data-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
decompress-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
doc-tests.el Adjust doc-tests-documentation/autoloaded-macro 2022-02-20 17:42:21 +01:00
editfns-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
emacs-module-tests.el Decouple mod-test.c from Gnulib 2022-03-08 18:51:18 -08:00
emacs-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
eval-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
fileio-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
filelock-tests.el Extend filelock-tests.el for bug#53207 2022-01-31 15:26:06 +01:00
floatfns-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
fns-tests.el Add tests for concat, vconcat and append 2022-01-26 17:10:16 +01:00
font-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
image-tests.el ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
indent-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
inotify-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
json-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
keyboard-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
keymap-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
lcms-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
lread-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
marker-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
minibuf-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
print-tests.el Add new variable print-unreadable-function 2022-01-22 15:13:27 +01:00
process-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
regex-emacs-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
search-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
sqlite-tests.el ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
syntax-tests.el Fix Fchar_syntax for non-ASCII in unibyte buffers 2022-01-20 11:44:07 +01:00
textprop-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
thread-tests.el Rewrite thread context switch code (bug#48990) 2022-02-12 15:25:53 -05:00
timefns-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
undo-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
xdisp-tests.el Allow redirecting `message' output to a different buffer 2022-01-29 17:24:49 +01:00
xfaces-tests.el Don't accept whitespace or hex floats in rgbi: colour specs 2022-03-06 14:07:26 +01:00
xml-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00