1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-21 12:03:55 -08:00
Commit graph

935 commits

Author SHA1 Message Date
Jonas Bernoulli
cb58a3c552 * test/src/emacs-module-tests.el: Use proper outline headings.
This library already used section headings but it used just two
instead of three semicolons, making them indistinguishable from
plain comments.
2020-08-13 11:30:16 +02:00
Andrea Corallo
e5095f0fd3 Merge remote-tracking branch 'savannah/master' into HEAD 2020-08-02 17:36:29 +02:00
Glenn Morris
8f46e67ffd Merge from origin/emacs-27
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
2020-07-29 08:39:28 -07:00
Philipp Stephani
73a2f51043 Add another test for global module references
* 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.
2020-07-26 22:54:33 +02:00
Philipp Stephani
3838aeb739 Backport: add another test case for module assertions.
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.
2020-07-26 14:33:59 +02:00
Philipp Stephani
bde5f5f897 Backport: Add module test for edge case.
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.
2020-07-26 14:31:49 +02:00
Andrea Corallo
7a161dc688 Merge remote-tracking branch 'savahnna/master' into HEAD 2020-07-26 09:40:02 +02:00
Philipp Stephani
9f01ce6327 Make checking for liveness of global values more precise.
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.
2020-07-25 23:23:19 +02:00
Philipp Stephani
6355a3ec62 Fix subtle bug when checking liveness of module values.
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.
2020-07-25 23:04:05 +02:00
Andrea Corallo
2c2cc21f1b Add a testcase for bug#42360
* test/src/comp-tests.el (comp-test-42360): New testcase.

	* test/src/comp-test-funcs.el (comp-test-42360-f): New function.
2020-07-15 23:13:36 +02:00
Andrea Corallo
5be335e6b5 Merge remote-tracking branch 'savahnna/master' into HEAD 2020-07-13 15:13:46 +02:00
Paul Eggert
c86f3fe0d0 Fix out-of-source ‘make check’ emacs-module-tests
Problem reported by Koki Fukuda in:
https://lists.gnu.org/r/emacs-devel/2020-07/msg00169.html
* test/Makefile.in (MODULE_CFLAGS):
Include from the same directories included from in ../src.
* test/src/emacs-module-tests.el (module/describe-function-1):
Strip path to source directory.
2020-07-09 16:38:45 -07:00
Andrea Corallo
02bf2e08e2 * Disable ipa-pure in comp-tests-tco
* test/src/comp-tests.el (comp-tests-tco): Disable ipa-pure to
	check effectively for tail recursion elimination.
2020-07-09 16:23:34 +01:00
Andrea Corallo
92e744d787 ;* test/src/comp-test-funcs-dyn.el: Fix comment header. 2020-07-09 16:23:34 +01:00
Andrea Corallo
a53b446cb0 Add some tests for pure function optimization
* test/src/comp-tests.el (comp-tests-fw-prop): Fix docstring.
	(comp-tests-pure-checker-1, comp-tests-pure-checker-2): New
	functions.
	(comp-tests-pure): New test testing for pure function
	optimization.
2020-07-09 16:23:31 +01:00
Andrea Corallo
4348969536 * test/src/comp-test-funcs.el (comp-tests-aref-aset-f) : Fix UB. 2020-07-09 16:22:48 +01:00
Andrea Corallo
e6ab4e3dfe * Add a test targeting forward propagation
* test/src/comp-tests.el (comp-tests-fw-prop-checker-1): New
	function.
	(comp-tests-fw-prop): New test.
2020-07-09 16:22:37 +01:00
Andrea Corallo
b31b0ebefe * Rework some test logic for generality
* test/src/comp-tests.el (comp-tests-make-insn-checker): New
	function splitting logic from `comp-tests-tco-checker' to have it
	more general.
	(comp-tests-tco-checker): Make use of
	`comp-tests-make-insn-checker'.
2020-07-08 17:29:24 +01:00
Andrea Corallo
3d43d45755 Merge remote-tracking branch 'savannah/master' into HEAD 2020-07-07 20:44:39 +01:00
Glenn Morris
3b36b38713 Merge from origin/emacs-27
59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
2020-07-07 07:50:39 -07:00
Andrea Corallo
7e004d24a4 * Add a test to verify tail recursion elimination
* test/src/comp-tests.el (comp-tests-tco): Compile a recursive
	functions at speed 3 and verify the tail recursion elimination.
	(comp-tests-tco-checker, comp-tests-mentioned-p)
	(comp-tests-mentioned-p-1): New support functions.
2020-07-02 22:55:42 +02:00
Andrea Corallo
25bdf99713 Merge remote-tracking branch 'savahnna/master' into HEAD 2020-07-02 22:30:37 +02:00
Andrea Corallo
0f964db327 Add a test for lambda list containing uninterned symbols
* test/src/comp-test-funcs-dyn.el
	(comp-tests-cl-uninterned-arg-parse-f): New function.

	* test/src/comp-tests.el (comp-tests-cl-uninterned-arg-parse-f):
	New test.
2020-06-30 21:30:44 +02:00
Paul Eggert
d0872638b4 * test/src/fns-tests.el (test-secure-hash): Test getrandom format. 2020-06-29 09:55:33 -07:00
Philipp Stephani
59e768d64a Fix undefined behavior in json.c (Bug#42113)
* src/json.c (lisp_to_json_toplevel_1, Fjson_parse_string): Check
whether input strings are actually strings.

* test/src/json-tests.el (json-parse-string/wrong-type)
(json-serialize/wrong-hash-key-type): New regression tests.
2020-06-29 12:32:56 +02:00
Andrea Corallo
5b8b298283 Add a test to verify CL macro expansion in dynamic scope
* test/src/comp-tests.el (comp-tests-cl-macro-exp): New test.

	* test/src/comp-test-funcs-dyn.el: Require `cl-lib'.
	(comp-tests-cl-macro-exp-f): New function.
2020-06-28 15:53:08 +01:00
Andrea Corallo
0eedb5af0b Merge remote-tracking branch 'savannah/master' into HEAD 2020-06-27 21:42:16 +01:00
Eli Zaretskii
30ff2433b1 Minor improvements as followup to recent RGB string-parsing change
* src/xfaces.c (Finternal_color_values_from_color_spec): Rename to...
(Fcolor_values_from_color_spec): ...this.  Callers changed.
Rename the argument to SPEC and improve the doc string.
(parse_color_spec, parse_float_color_comp, parse_hex_color_comp):
Improve commentary.
(parse_color_spec): Rename the argument S to SPEC.

* etc/NEWS: Mention 'color-values-from-color-spec'.
2020-06-22 18:32:01 +03:00
Andrea Corallo
c324e02f75 Merge remote-tracking branch 'savahnna/master' into dev 2020-06-22 00:20:03 +02:00
Andrea Corallo
1179a1c748 * Add a func-arity test for dynamic functions
* test/src/comp-tests.el (comp-tests-dynamic-arity): New test.
2020-06-22 00:13:18 +02:00
Andrea Corallo
34117dea77 Add a test for speed -1
* test/src/comp-tests.el (comp-test-speed--1): New test

	* test/src/comp-test-funcs.el (comp-test-speed--1-f): New
	function.
2020-06-22 00:11:40 +02:00
Andrea Corallo
47ab6c237e Add some testing for dynamic scope
* test/src/comp-test-funcs-dyn.el: New file.

	* test/src/comp-tests.el (comp-tests-dynamic-ffuncall): Add
	new tests.
2020-06-22 00:02:57 +02:00
Mattias Engdegård
9fe2bdb88a Consolidate #RGB string parsers
Use a single parser of color strings in the #RGB, rgb:R/G/B and
rgbi:R/G/B formats, replacing four existing ones.  Previously,
error-checking was spotty, handling of the rgbi: format not always
present, and normalization of the result was sometimes incorrect.

* src/dispextern.h: New prototype.
* src/xfaces.c (parse_hex_color_comp, parse_float_color_comp)
(parse_color_spec, Finternal-color_values_from_color_spec): New functions.
* test/src/xfaces-tests.el (xfaces-internal-color-values-from-color-spec):
New test.
* lisp/term/tty-colors.el (tty-color-standard-values):
Use internal-color-values-from-color-spec, replacing old parser.
* src/nsterm.m (ns_get_color):
* src/w32fns.c (x_to_w32_color):
* src/xterm.c (x_parse_color): Use parse_color_spec, replacing old
parsers.
(HEX_COLOR_NAME_LENGTH): Remove #define.
2020-06-21 21:22:26 +02:00
Basil L. Contovounesios
4cc6854cd4 Silence some warnings in tests
* test/lisp/emacs-lisp/package-tests.el
(package-test-suffix-matches): Evaluate lambda.
(package-test-list-filter-marked):
* test/lisp/vc/vc-tests.el
(vc-test--run-maybe-unsupported-function):
* test/src/undo-tests.el (undo-test-skip-invalidated-markers):
Silence "unused local variable" warnings.
* test/lisp/imenu-tests.el (imenu-simple-scan-deftest): Fix
docstring.  Don't shadow global major-mode.
2020-06-21 12:50:34 +01:00
Andrea Corallo
3d576c784b Merge remote-tracking branch 'savannah/master' into dev 2020-06-07 20:08:54 +02:00
Glenn Morris
fa6d56529f Merge from origin/emacs-27
35661ef943 (origin/emacs-27) Fix typo in "(elisp) Type Keywords"
1af0e95fec Gnus nnir-summary-line-format has no effect
dd366b5d3b Improve documentation of 'window-text-pixel-size'
fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix.  (Bug#41...
d8593fd19f Minor improvements to EDE and EIEIO manuals
3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options
cc35b197c7 Update package-menu-quick-help
bf09106256 Improve documentation of 'sort-subr'
73749efa13 Update Ukrainian transliteration
30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered
7d323f07c0 Silence some byte-compiler warnings in tests
cf473e742f * test/lisp/battery-tests.el: New file.
b07e3b1d97 Improve format-spec documentation (bug#41571)

# Conflicts:
#	test/lisp/emacs-lisp/package-tests.el
2020-06-07 09:03:59 -07:00
Andrea Corallo
f5ea65b436 Merge remote-tracking branch 'savannah/master' into HEAD 2020-06-04 10:33:07 +01:00
Mattias Engdegård
4fff650236 ; * test/src/xfaces-tests.el (xfaces-color-distance): Fix bug id 2020-06-04 10:56:20 +02:00
Mattias Engdegård
7e8c1a6718 Make color-distance symmetric and more accurate
* src/xfaces.c (color_distance): Don't throw away the low 8 bits of
the colours, and make the function symmetric (bug41544)
(Fcolor_distance): Add caution about this not being a true metric.
* test/src/xfaces-tests.el: New file.
2020-06-03 19:09:33 +02:00
Basil L. Contovounesios
7d323f07c0 Silence some byte-compiler warnings in tests
* test/lisp/emacs-lisp/cl-generic-tests.el:
* test/lisp/progmodes/elisp-mode-tests.el: Declare functions
referred to within macroexpansions.
(xref-elisp-overloadable-no-default)
(xref-elisp-overloadable-co-located-default)
(xref-elisp-overloadable-separate-default): Prefix unused arguments
with underscore.

* test/lisp/international/ccl-tests.el:
* test/lisp/wdired-tests.el:
* test/lisp/emacs-lisp/package-tests.el: Declare functions used.
(package-test-update-archives, package-test-signed): Use
revert-buffer in place of its obsolete alias package-menu-refresh.

* test/lisp/eshell/eshell-tests.el:
* test/lisp/mail/footnote-tests.el:
* test/src/buffer-tests.el: Require dependencies used.

* test/lisp/image/exif-tests.el: Remove unneeded (require 'seq).
(test-exit-direct-ascii-value): Actually perform the test.
* test/lisp/progmodes/sql-tests.el (sql-test-add-existing-product):
Fix typo.

* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
* test/src/data-tests.el (test-bool-vector-bv-from-hex-string)
(test-bool-vector-apply-mock-op): Remove unused local variables.
2020-06-03 01:22:41 +01:00
Andrea Corallo
3fa73fa0fb Add a compiler hint test
Test that compiler hints are executed transparently.

* test/src/comp-tests.el (comp-tests-type-hints): New test.

* test/src/comp-test-funcs.el (comp-tests-hint-fixnum-f)
(comp-tests-hint-cons-f): New functions.
2020-05-25 22:24:53 +01:00
Andrea Corallo
9daffe9cfe Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-24 10:20:23 +01:00
Glenn Morris
ca7224d5db Add test for recent buffer-local-variables change
* test/src/buffer-tests.el (buffer-tests-buffer-local-variables-undo):
New.
2020-05-18 13:08:27 -07:00
Andrea Corallo
cd4ef52c86 Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-17 22:49:02 +01:00
Paul Eggert
c7bc28bf03 Don’t attempt to modify constant conses
From a patch privately suggested by Mattias Engdegård on 2020-05-11
in a followup to Bug#40671.
* admin/charsets/cp51932.awk:
* admin/charsets/eucjp-ms.awk:
Generate code that does not modify constant conses.
* doc/misc/emacs-mime.texi (Encoding Customization):
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops):
* lisp/frameset.el (frameset-persistent-filter-alist):
* lisp/gnus/gnus-sum.el (gnus-article-mode-line-format-alist):
Use append instead of nconc.
* lisp/language/japanese.el (japanese-ucs-cp932-to-jis-map)
(jisx0213-to-unicode):
Use mapcar instead of mapc.
* lisp/language/lao-util.el (lao-transcription-consonant-alist)
(lao-transcription-vowel-alist):
* lisp/language/tibetan.el (tibetan-subjoined-transcription-alist):
Use copy-sequence.
* test/src/fns-tests.el (fns-tests-nreverse):
(fns-tests-sort, fns-tests-collate-sort)
(fns-tests-string-version-lessp, fns-tests-mapcan):
Use copy-sequence, vector, and list.
2020-05-16 17:05:37 -07:00
Andrea Corallo
e5b24b85a2 * Native compiler test update
* test/src/comp-tests.el (comp-tests-lambda-return): Add a test
	verifying that the returned lambda is actually native compiled.
2020-05-15 20:06:49 +01:00
Andrea Corallo
28df049b8d * test/src/comp-tests.el (comp-tests-bootstrap): Fix test. 2020-05-14 07:14:27 +01:00
Andrea Corallo
c984a53b4e Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-25 15:13:18 +01:00
Stefan Kangas
c52f8863a5 Use lexical-binding in most src tests
* test/src/charset-tests.el:
* test/src/chartab-tests.el:
* test/src/cmds-tests.el:
* test/src/coding-tests.el (top-level)
(generate-ascii-file, generate-mostly-nonascii-file):
* test/src/doc-tests.el:
* test/src/floatfns-tests.el:
* test/src/font-tests.el:
* test/src/keymap-tests.el:
* test/src/process-tests.el (top-level)
(process-test-sentinel-wait-function-working-p)
(process-test-stderr-buffer, process-test-stderr-filter):
* test/src/textprop-tests.el:
* test/src/thread-tests.el:
* test/src/timefns-tests.el:
* test/src/undo-tests.el:
* test/src/xml-tests.el: Use lexical-binding.
2020-04-24 18:25:13 +02:00
Andrea Corallo
301cf0d278 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-23 08:41:15 +01:00