summaryrefslogtreecommitdiff
path: root/test/data
Commit message (Collapse)AuthorAgeFilesLines
* Add tests for gif to src/image-tests.elStefan Kangas2021-10-241-0/+0
| | | | | | | | | * test/src/image-tests.el (image-tests--images): Rename from image-tests-files. Add gif. (image-tests-image-size/gif) (image-tests-image-mask-p/gif) (image-tests-image-metadata/gif): New tests. * test/data/image/black.gif: New file.
* Add WebP image format support (Bug#51296)Stefan Kangas2021-10-221-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (--with-webp): New option. (HAVE_WEBP): New variable. (emacs_config_features): Add webp. * src/image.c (enum webp_keyword_index) [HAVE_WEBP]: New enum. (webp_format) [HAVE_WEBP]: New variable. (webp_image_p, init_webp_functions, webp_load) [HAVE_WEBP]: New functions for WebP support. (image_types) [HAVE_WEBP]: Define WebP format. (syms_of_image) <Qwebp> [HAVE_WEBP]: New DEFSYM. Add image type Qwebp. * src/Makefile.in (LIBIMAGE): Add WEBP_LIBS. * lisp/files.el (auto-mode-alist): * lisp/image-file.el (image-file-name-extensions): * lisp/image.el (image-type-header-regexps) (image-type-file-name-regexps, image-type-auto-detectable): Add WebP support. * lisp/term/w32-win.el (dynamic-library-alist): Add the libwebp DLL. * INSTALL: * admin/CPP-DEFINES: * doc/lispref/display.texi (Image Formats, Other Image Types): * nt/INSTALL: Document WebP support. * test/lisp/image-tests.el (image-find-image) (image-type-from-file-name): Expand tests. * test/src/image-tests.el (image-tests--files): Add WebP. (image-tests-image-size/webp, image-tests-image-mask-p/webp) (image-tests-image-metadata/webp): New tests. * test/data/image/black.webp: New file.
* Move faces.el test data to follow our conventionsStefan Kangas2020-10-242-69/+0
| | | | | | | * test/lisp/faces-tests.el (ert-x): Require. (faces--test-data-dir): Remove variable. (faces--test-extend-with-themes): Use ert-resource-directory. * test/lisp/faces-resources/*: Moved from test/data/themes/*.
* Move epg.el test data to follow our conventionsStefan Kangas2020-10-243-75/+0
| | | | | | | * test/lisp/epg-tests.el (ert-x): Require. (epg-tests-data-directory): Remove variable. (with-epg-tests): Use ert-resource-file. * test/lisp/epg-resources/*: Moved from test/data/epg/.
* Move shr.el test data to follow our conventionsStefan Kangas2020-10-2414-95/+0
| | | | | | | * test/lisp/net/shr-tests.el (ert, ert-x): Require. (shr-tests--datadir): Remove variable. (shr-test, rendering): Use ert-resource-directory. * test/lisp/net/shr-resources/*: Move from test/data/shr/.
* Move mml-sec.el test data to follow our conventionsStefan Kangas2020-10-2434-31/+0
| | | | | | | | * test/lisp/gnus/mml-sec-tests.el (ert-x): Require. (mml-secure-test-fixture, mml-sec-test--kill-gpg-agent): Use ert-resource-directory. * test/lisp/gnus/mml-sec-resources/*: Moved from test/data/mml-sec/. * .gitignore: Update location of moved file "random_seed".
* Move more test data to follow our conventionsStefan Kangas2020-10-2313-96/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/minibuffer-test-cttq$tion: Move from here... * test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion: ...to here. * test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test: * test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test: New files. * test/lisp/minibuffer-tests.el (ert, ert-x): Require. (completion-table-test-quoting): Use ert-resource-directory. * test/data/net/cert.pem: * test/data/net/key.pem: Move frome here... * test/lisp/net/network-stream-resources/cert.pem: * test/lisp/net/network-stream-resources/key.pem: ...to here. * test/lisp/net/network-stream-tests.el (ert, ert-x): Require. (network-stream-tests--datadir): Remove variable. (make-tls-server): Use ert-resource-file. * test/data/vc/diff-mode/hello_emacs.c: * test/data/vc/diff-mode/hello_emacs_1.c: * test/data/vc/diff-mode/hello_world.c: * test/data/vc/diff-mode/hello_world_1.c: Move from here... * test/lisp/vc/diff-mode-resources/hello_emacs.c: * test/lisp/vc/diff-mode-resources/hello_emacs_1.c: * test/lisp/vc/diff-mode-resources/hello_world.c: * test/lisp/vc/diff-mode-resources/hello_world_1.c: ...to here. * test/lisp/vc/diff-mode-tests.el (ert, ert-x): Require. (diff-mode-tests--datadir): Remove variable. (diff-mode-test-font-lock-syntax-one-line) (diff-mode-test-font-lock): Use ert-resource-directory. * test/data/xdg/l10n.desktop: * test/data/xdg/malformed.desktop: * test/data/xdg/mimeapps.list: * test/data/xdg/mimeinfo.cache: * test/data/xdg/test.desktop: Move from here... * test/lisp/xdg-resources/l10n.desktop: * test/lisp/xdg-resources/malformed.desktop: * test/lisp/xdg-resources/mimeapps.list: * test/lisp/xdg-resources/mimeinfo.cache: * test/lisp/xdg-resources/test.desktop: ...to here. * test/lisp/xdg-tests.el (ert-x): Require. (xdg-tests-data-dir): Remove variable. (xdg-desktop-parsing, xdg-mime-associations): Use ert-resource-file.
* Move some test data to follow our conventionsStefan Kangas2020-10-238-892/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory.
* Move icalendar test data to test/lisp/calendar/icalendar-resourcesUlf Jasper2020-10-23141-1107/+0
| | | | | | | | | | * test/lisp/calendar/icalendar-tests.el (ert-x): Required for 'ert-resource-file'. (icalendar-tests--data-dir): Removed. (icalendar-tests--get-file-contents): Use 'ert-resource-file' for finding test data files. * test/data/icalendar/*: Moved to test/lisp/calendar/icalendar-resources/. * test/lisp/calendar/icalendar-resources/*: Moved from test/data/icalendar.
* Move test data for icalendar tests to separate files.Ulf Jasper2020-10-22141-0/+1107
| | | | | | | | | | | | | | | | | * test/lisp/calendar/icalendar-tests.el (icalendar-tests--data-dir, icalendar-tests--get-file-contents): New. (icalendar-tests--test-import, icalendar-tests--do-test-import): Read input and expected results from files. (icalendar-import-non-recurring, icalendar-import-rrule) (icalendar-import-duration, icalendar-import-bug-6766) (icalendar-import-bug-24199, icalendar-import-bug-33277) (icalendar-import-multiple-vcalendars, icalendar-import-with-uid) (icalendar-import-with-timezone, icalendar-real-world): Move test data (input and expected result) to separate files. * test/calendar/icalendar/* New files containing test data for icalendar tests.
* Allow creating unibyte strings from Emacs modulesLars Ingebrigtsen2020-10-131-0/+11
| | | | | | | | | | | | | | | * doc/lispref/internals.texi (Module Values): Document make_unibyte_string (bug#34873). * src/emacs-module.c (module_make_unibyte_string): New function. (initialize_environment): Export it. * src/module-env-25.h: Define it. * test/data/emacs-module/mod-test.c (Fmod_test_return_unibyte): Test it. * test/src/emacs-module-tests.el (module/unibyte): Test it.
* Enhance syntax-tests.el to test comments in parse-partial-sexpAlan Mackenzie2020-10-021-6/+7
| | | | | | | | | | | | | This now tests the interface between parse-partial-sexp and the low level comment function in syntax.c * test/src/syntax-tests.el (syntax-comments-midpoint): New function. (syntax-pps-comments): New macro. (top level): Two new syntax-br-comments tests and five new syntax-pps-comments tests. * test/data/syntax-comments.txt (top level): Amend some test fragments and add some more.
* Enhance syntax-tests.el to test comments in scan-listsAlan Mackenzie2020-10-021-14/+15
| | | | | | | | | | This now tests the interface between scan_lists and the comment functions. * test/src/syntax-tests.el (syntax-br-comments): New macro. ({-in, ;-in, /*-in): Set parse-sexp-ignore-comments to t. (top level): Add 15 tests for comments inside brace lists. * test/data/syntax-comments.txt (top level): Amend some test fragments.
* Enhance syntax-tests.el to test some comment character handling.Alan Mackenzie2020-10-011-0/+66
| | | | | | | * test/src/syntax-tests: Add a new section testing some aspects of comment handling in syntax.c. This needs further enhancement. It uses .... * test/data/syntax-comments.txt: A new test file.
* Add facility to make module functions interactive (Bug#23486).Philipp Stephani2020-09-131-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/module-env-28.h: Add field for 'make_interactive' function. * src/emacs-module.c (Lisp_Module_Function): Add new field holding the interactive form. (allocate_module_function): Adapt to structure layout change. (module_make_interactive, module_function_interactive_form): New functions. (initialize_environment): Use them. * src/eval.c (Fcommandp): * src/data.c (Finteractive_form): Also handle interactive module functions. * test/data/emacs-module/mod-test.c (Fmod_test_identity): New test function. (emacs_module_init): Create two interactive module test functions. * test/src/emacs-module-tests.el (module/interactive/return-t) (module/interactive/return-t-int, module/interactive/identity): New unit tests. * doc/lispref/internals.texi (Module Functions): Document new function. Rework paragraph about wrapping module functions, as the example no longer applies. * etc/NEWS: Document new facility.
* ; Fix license statements.Stefan Kangas2020-08-272-6/+10
|
* Remove mistakenly checked-in random_seed fileLars Ingebrigtsen2020-08-041-0/+0
|
* Add tests for mml-sec.elJens Lechtenbörger2020-08-0435-0/+31
|
* * test/data/emacs-module/mod-test.c (Fmod_test_string_a_to_b): Fix leakPhilipp Stephani2020-08-011-1/+3
|
* Merge from origin/emacs-27Glenn Morris2020-07-291-0/+31
|\ | | | | | | | | | | | | | | | | | | | | | | 1fc742b63e ; Update ChangeLog.3 4c7f6217da * etc/AUTHORS: Update. 24391f517a Update authors.el 56f958807c * etc/NEWS: Remove temporary markup. 73a2f51043 Add another test for global module references # Conflicts: # etc/AUTHORS # etc/NEWS
| * Add another test for global module referencesPhilipp Stephani2020-07-261-0/+31
| | | | | | | | | | | | | | | | | | * test/src/emacs-module-tests.el (mod-test-globref-reordered): New unit test. * test/data/emacs-module/mod-test.c (Fmod_test_globref_reordered): New test module function. (emacs_module_init): Export it.
| * Backport: add another test case for module assertions.Philipp Stephani2020-07-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | This backports commit 9f01ce6327 from master. Since the bug isn’t present on emacs-27, just backport the new test case. * test/data/emacs-module/mod-test.c (Fmod_test_globref_invalid_free): New test module function. (emacs_module_init): Export it. * test/src/emacs-module-tests.el (module--test-assertions--globref-invalid-free): New unit test.
| * Backport: Add module test for edge case.Philipp Stephani2020-07-261-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This backports commit 6355a3ec62 from master. Since the bug isn’t present in emacs-27, just backport the test case. * test/data/emacs-module/mod-test.c (Fmod_test_invalid_store_copy): New test module function. (emacs_module_init): Export it. * test/src/emacs-module-tests.el (module--test-assertions--load-non-live-object-with-global-copy): New unit test.
| * Don't have exif bugging out on short stringsLars Ingebrigtsen2020-03-191-0/+0
| | | | | | | | | | | | | | * lisp/image/exif.el (exif--direct-ascii-value): New function (bug#40127). (exif--parse-directory): Use it to get the correct values for in-directory (i.e., shorter than 4 octets) strings.
* | Make checking for liveness of global values more precise.Philipp Stephani2020-07-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't just use a hash lookup because a global and a local reference might refer to the same Lisp object. * src/emacs-module.c (module_free_global_ref): More precise check for global liveness. * test/data/emacs-module/mod-test.c (Fmod_test_globref_invalid_free): New test module function. (emacs_module_init): Export it. * test/src/emacs-module-tests.el (module--test-assertions--globref-invalid-free): New unit test.
* | Fix subtle bug when checking liveness of module values.Philipp Stephani2020-07-251-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't simply look up the Lisp object in the global reference table because an invalid local and a valid global reference might refer to the same object. Instead, we have to test the address of the global reference against the stored references. * src/emacs-module.c (module_global_reference_p): New helper function. (value_to_lisp): Use it. * test/data/emacs-module/mod-test.c (Fmod_test_invalid_store_copy): New test module function. (emacs_module_init): Export it. * test/src/emacs-module-tests.el (module--test-assertions--load-non-live-object-with-global-copy): New unit test.
* | Use Gnulib libgmp modulePaul Eggert2020-07-091-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of doing GMP by hand, use the Gnulib libgmp module. * .gitignore: Add lib/gmp.h. * admin/merge-gnulib (GNULIB_MODULES): Add libgmp. * configure.ac (GMP_LIB, GMP_OBJ): Remove. Gnulib uses the name LIB_GMP, so all uses changed. All uses of GMP_OBJ removed. (HAVE_GMP): Set this from Gnulib’s variables. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4: New files, copied from Gnulib. * src/bignum.h, test/data/emacs-module/mod-test.c: Include gmp.h unconditionally. * src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h: Remove. This moves these files from src to lib, and updates them to the current GMP version. * test/Makefile.in (GMP_H): New macro. ($(test_module)): Use it to decide whether to compile mini-gmp-gnulib.c too.
* | Port the 'module/async-pipe' test to MS-WindowsEli Zaretskii2020-03-271-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes let the code compile and produce a valid DLL, but the test hangs. It looks like the hang is in Fdelete_process, when it closes one of the descriptors of the pipe process. In addition, this use of the pipe process cannot currently work on MS-Windows, since make-pipe-process doesn't set up the reader thread to read from the Emacs's side of the pipe, so the select emulation doesn't know there's stuff to read from that pipe. * test/data/emacs-module/mod-test.c [WINDOWSNT]: Include windows.h. (ALIGN_STACK) [!__x86_64__]: Define for 32-bit builds. (sleep_for_half_second): New function. (write_to_pipe): Declare return type differently for WINDOWSNT. Call sleep_for_half_second. (Fmod_test_async_pipe) [WINDOWSNT]: Use _beginthread as substitute for pthread_create. (invalid_finalizer): Replace non_ASCII character in a comment. * test/src/emacs-module-tests.el (module/async-pipe): Skip on MS-Windows, as the test fails and then hangs.
* | Add a module function to open a file descriptor connected to a pipe.Philipp Stephani2020-03-261-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common complaint about the module API is that modules can't communicate asynchronously with Emacs. While it isn't possible to call arbitrary Emacs functions asynchronously, writing to a pipe should always be fine and is a pretty low-hanging fruit. This patch implements a function that adapts an existing pipe process. That way, users can use familiar tools like process filters or 'accept-process-output'. * src/module-env-28.h: Add 'open_channel' module function. * src/emacs-module.c (module_open_channel): Provide definition for 'open_channel'. (initialize_environment): Use it. * src/process.c (open_channel_for_module): New helper function. (syms_of_process): Define necessary symbol. * test/src/emacs-module-tests.el (module/async-pipe): New unit test. * test/data/emacs-module/mod-test.c (signal_system_error): New helper function. (signal_errno): Use it. (write_to_pipe): New function running in the background. (Fmod_test_async_pipe): New test module function. (emacs_module_init): Export it. * doc/lispref/internals.texi (Module Misc): Document new module function. * doc/lispref/processes.texi (Asynchronous Processes): New anchor for pipe processes. * etc/NEWS: Document 'open_channel' function.
* | Don't have exif bugging out on short stringsLars Ingebrigtsen2020-03-191-0/+0
| | | | | | | | | | | | | | * lisp/image/exif.el (exif--direct-ascii-value): New function (bug#40127). (exif--parse-directory): Use it to get the correct values for in-directory (i.e., shorter than 4 octets) strings.
* | Also print function data when printing module functions.Philipp Stephani2020-01-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is especially useful in cases where modules only use a single entry point and use the data to dispatch to the actual function. Such a design is common for languages such as Go and C++. * src/emacs-module.c (module_function_data): New function. * src/print.c (print_vectorlike): Use it to print module function data if not NULL. (print_object): Adapt size of buffer. * test/data/emacs-module/mod-test.c (emacs_module_init): Pass some non-NULL data to ‘mod-test-sum’. (Fmod_test_sum): Check that correct data is passed through. * test/src/emacs-module-tests.el (mod-test-sum-test) (module-function-object): Adapt unit tests.
* | Implement finalizers for module functions (Bug#30373)Philipp Stephani2020-01-031-2/+47
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/module-env-28.h: Add new module environment functions to module environment for Emacs 28. * src/emacs-module.h.in: Document that 'emacs_finalizer' also works for function finalizers. * src/emacs-module.c (CHECK_MODULE_FUNCTION): New function. (struct Lisp_Module_Function): Add finalizer data member. (module_make_function): Initialize finalizer. (module_get_function_finalizer) (module_set_function_finalizer): New module environment functions. (module_finalize_function): New function. (initialize_environment): Initialize new environment functions. * src/alloc.c (cleanup_vector): Call potential module function finalizer during garbage collection. * test/data/emacs-module/mod-test.c (signal_error): New helper function. (memory_full): Use it. (finalizer): New example function finalizer. (Fmod_test_make_function_with_finalizer) (Fmod_test_function_finalizer_calls): New test module functions. (emacs_module_init): Define them. * test/src/emacs-module-tests.el (module/function-finalizer): New unit test. * doc/lispref/internals.texi (Module Functions): Document new functionality. (Module Misc): Move description of 'emacs_finalizer' type to 'Module Functions' node, and add a reference to it. * etc/NEWS: Mention new functionality.
* Update copyright year to 2020Paul Eggert2020-01-013-3/+3
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Rename faces used in faces-tests.elDmitry Gutov2019-12-102-5/+5
| | | | | | | | * test/data/themes/faces-test-light-theme.el: * test/data/themes/faces-test-dark-theme.el: Update accordingly. * test/lisp/faces-tests.el (faces--test-extend-with-themes): Don't use the diff-mode faces. Rename the definitions.
* Make ':extend' inherited from default spec unless overriddenDmitry Gutov2019-12-102-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (face-spec-recalc): Handle the :extend attribute specially and always inherit it from the default spec unless overwritten in a theme (bug#37774). * test/lisp/faces-tests.el (faces--test-data-dir): New variable. (faces--test-extend-with-themes): Use test themes instead of ones from etc/themes. Update expected values. * test/data/themes/faces-test-dark-theme.el: New file. * test/data/themes/faces-test-light-theme.el: New file. * doc/lispref/display.texi (Face Attributes): Update the description of ':extend'. * etc/NEWS: Update the entry for ':extend'. * etc/themes/adwaita-theme.el: * etc/themes/deeper-blue-theme.el: * etc/themes/dichromacy-theme.el: * etc/themes/leuven-theme.el: * etc/themes/light-blue-theme.el: * etc/themes/manoj-dark-theme.el: * etc/themes/misterioso-theme.el: * etc/themes/tango-dark-theme.el: * etc/themes/tango-theme.el: * etc/themes/tsdh-dark-theme.el: * etc/themes/tsdh-light-theme.el: * etc/themes/wheatgrass-theme.el: * etc/themes/wombat-theme.el: Remove the now-redundant ':extend' attribute in all the themes.
* Fix recent modifications in emacs-module-testsEli Zaretskii2019-12-051-1/+1
| | | | | | | | | | | | * test/data/emacs-module/mod-test.c (extract_big_integer): Fix calculation of size of 'magnitude' when 'emacs_limb_t' is wider than 'unsigned long'. * test/src/emacs-module-tests.el (module--test-assertions--load-non-live-object) (module--test-assertions--call-emacs-from-gc): On MS-Windows, check also mod-test-emacs with ".exe" appended, before skipping the tests.
* Change module interface to no longer use GMP objects directly.Philipp Stephani2019-12-041-14/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the new comment added to emacs-module.c, using GMP directly in the module interface has significant downsides: it couples the module interface directly to the implementation and requires module authors to link their module against the same GMP library as Emacs itself, which is often difficult and an unnecessary burden. By picking a representation for the magnitude that often matches the one used by GMP, we can avoid overhead when converting from and to GMP in most cases. Loading the test module in test/data/emacs-module and evaluating (dotimes (_ 10000) (mod-test-double (* 2 most-negative-fixnum))) under Callgrind shows that on my (GNU/Linux) machine Emacs only spends 10% of the CPU time of mod-test-double in mpz_import and mpz_export combined, even though that function does little else. (By contrast, 30% is spent in allocate_pseudovector.) * src/emacs-module.h.in: Don't check EMACS_MODULE_GMP. Don't include gmp.h. Remove emacs_mpz structure. Instead, define type alias emacs_limb_t and macro EMACS_LIMB_MAX. * src/module-env-27.h: Change interface of extract_big_integer and make_big_integer to take a sign-magnitude representation instead of mpz_t. * src/emacs-module.c: Don't check EMACS_MODULE_GMP or EMACS_MODULE_HAVE_MPZ_T. Add a comment about the chosen implementation. (module_extract_big_integer, module_make_big_integer): Reimplement without using mpz_t in the interface. * doc/lispref/internals.texi (Module Values): Adapt function documentation and example. Stop mentioning GMP and EMACS_MODULE_GMP. * test/data/emacs-module/mod-test.c: Don't define EMACS_MODULE_GMP or EMACS_MODULE_HAVE_MPZ_T. (memory_full, extract_big_integer, make_big_integer): New helper functions, identical to example in the Info documentation. (Fmod_test_nanoseconds, Fmod_test_double): Adapt to new interface.
* * test/lisp/minibuffer-tests.el (completion-table-test-quoting): New testStefan Monnier2019-11-261-0/+0
| | | | * test/data/minibuffer-test-cttq$tion: New file-name test data.
* Add an Exif parsing libraryLars Ingebrigtsen2019-09-211-0/+0
| | | | | | * lisp/image/exif.el: New file (bug#23070). * test/lisp/image/exif-tests.el: Add some basic tests.
* Port mod-test to --enable-gcc-warningsPaul Eggert2019-05-051-0/+2
| | | | | | * test/data/emacs-module/mod-test.c (NDEBUG): Undef, to prevent GCC from complaining “error: unused variable ‘dummy’” and failing to build the test, if --enable-gcc-warnings.
* Fix compilation of mod-test.c on MinGWEli Zaretskii2019-05-051-0/+4
| | | | | | * test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds) [__MINGW32__]: Use _Static_assert, not static_assert, as the latter is not available in mingw.org's MinGW's assert.h.
* Use extract_time in test module.Philipp Stephani2019-05-051-17/+1
| | | | | | | | | * test/data/emacs-module/mod-test.c (Fmod_test_sleep_until): Use extract_time for time argument. (signal_wrong_type_argument): Remove unused function. * test/src/emacs-module-tests.el (mod-test-sleep-until): Remove unnecessary ‘float-time’.
* Export major version of latest Emacs supported by emacs-module.h.Philipp Stephani2019-04-281-0/+5
| | | | | | | | | | | | | | | This is useful if module authors want to support multiple versions of emacs-module.h. * configure.ac (emacs_major_version): Define substitution. * src/emacs-module.h.in (EMACS_MAJOR_VERSION): Define macro. * doc/lispref/internals.texi (Module Initialization): Document EMACS_MAJOR_VERSION preprocessor macro. * test/data/emacs-module/mod-test.c (emacs_module_init): Verify behavior of EMACS_MAJOR_VERSION.
* Unbreak build when building without GMP support.Philipp Stephani2019-04-241-2/+7
| | | | | | | | | | | | | | | | | | | | | Add support for a new preprocessor macro EMACS_MODULE_HAVE_MPZ_T to emacs-module.h. If this macro is defined, assume that mpz_t is already defined and don’t include gmp.h. Don’t document the new macro for now, as it’s unclear whether we want to support this in modules outside the Emacs tree. * src/emacs-module.h.in: Allow user to prevent inclusion of gmp.h. * src/emacs-module.c: Use mini-gmp if GMP is unavailable. Don’t include gmp.h. * src/lisp.h: Don’t require gmp.h. It’s not needed for lisp.h. * test/Makefile.in (GMP_LIB, GMP_OBJ): New variables. ($(test_module)): Use them. * test/data/emacs-module/mod-test.c: Use mini-gmp if GMP is unavailable.
* Clarify rounding mode when converting to struct timespec.Philipp Stephani2019-04-241-0/+17
| | | | | | | | | | | * doc/lispref/internals.texi (Module Values): Clarify that the truncation is towards negative infinity. * test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds): Add test function. (emacs_module_init): Define it. * test/src/emacs-module-tests.el (mod-test-nanoseconds): New unit test.
* Add module functions to convert from and to big integers.Philipp Stephani2019-04-241-0/+19
| | | | | | | | | | | | | | | | | | | * src/module-env-27.h: Add new module functions to convert big integers. * src/emacs-module.h.in (emacs_mpz): Define if GMP is available. * src/emacs-module.c (module_extract_big_integer) (module_make_big_integer): New functions. (initialize_environment): Use them. * test/data/emacs-module/mod-test.c (Fmod_test_double): New test function. (emacs_module_init): Define it. * test/src/emacs-module-tests.el (mod-test-double): New unit test. * doc/lispref/internals.texi (Module Values): Document new functions.
* Add conversions to and from struct timespec to module interface.Philipp Stephani2019-04-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Time values are a fundamental data type, and such conversions are hard to implement within modules because of the various forms of time values in Emacs Lisp. Adding dedicated conversion functions can significantly simplify module code dealing with times. This approach uses nanosecond precision. While Emacs in theory has support for higher-precision time values, in practice most languages and standards, such as POSIX, C, Java, and Go, have settled on nanosecond-precision integers to represent time. * src/emacs-module.h.in: Add header for struct timespec. * src/module-env-27.h: Add module functions for time conversion. * src/emacs-module.c (module_extract_time, module_make_time): New functions. (initialize_environment): Use them. * test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New test function. (emacs_module_init): Define it. * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid) (mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New unit tests. * doc/lispref/internals.texi (Module Values): Document time conversion functions.
* Revert "Revert "Revert "Rely on conservative stack scanning to find ↵Eli Zaretskii2019-03-221-3/+3
| | | | | | | | "emacs_value"s""" This reverts commit 093d3e78d21d3d6c718997368ef4b31f9884401c, which reverted ee7ad83f20903208404a84b58b7a478b62924570, which reverted 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a.
* Revert "Revert "Rely on conservative stack scanning to find "emacs_value"s""Eli Zaretskii2019-03-211-3/+3
| | | | | | | | This reverts commit ee7ad83f20903208404a84b58b7a478b62924570. There was no consensus on reverting 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, so doing that will have to wait until the discussion ends.
* Revert "Rely on conservative stack scanning to find "emacs_value"s"Philipp Stephani2019-03-211-3/+3
| | | | | | | | This reverts commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a. There was no consensus for that commit, see https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00150.html. Also, reverting this commit should fix Bug#31238.