1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00
Commit Graph

4942 Commits

Author SHA1 Message Date
Stephen Gildea
aacafbe267 Refactor mh-utils-tests macro 'with-mh-test-env'
* test/lisp/mh-e/mh-utils-tests.el (with-mh-test-env): Refactor to
reduce the size of the expanded macro.
(mh-test-utils-setup): New helper function.
(mh-ensure-native-trampolines): Absorbed by mh-test-utils-setup.
2021-10-05 20:34:03 -07:00
Stephen Gildea
d86b2e59c7 native-comp-available-p is the definitive test
* doc/lispref/compile.texi (Native Compilation): Document
native-comp-available-p as the way to test for native compilation.
* lisp/emacs-lisp/package.el (package--native-compile-async):
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
Test for native compilation with native-comp-available-p.

Thank you to Andrea Corallo for reviewing this patch.
2021-10-05 09:24:11 -07:00
Andrea Corallo
63cb65dcce * Fix mh tests for native comp builds (bug#50975)
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
New function.
(mh-test-utils-setup-with-mocks)
(mh-test-utils-setup-with-variant): Use it.
2021-10-04 22:49:45 +02:00
Michael Albinus
7a98a62079 * test/README: Mention :nativecomp tag. 2021-10-04 18:01:06 +02:00
Michael Albinus
3863919a00 Fix unmounting in Tramp
* doc/misc/tramp.texi (FUSE setup): Add tramp-fuse-unmount-on-cleanup.

* lisp/net/tramp.el (tramp-file-name-unify): New defun.
(tramp-file-name-equal-p):
* lisp/net/tramp-cache.el (tramp-get-connection-property)
(tramp-set-connection-property, tramp-flush-connection-property)
(tramp-flush-connection-properties): Use it.

* lisp/net/tramp-fuse.el (tramp-fuse-get-fusermount): New defun.
(tramp-fuse-mount-points): New defvar.
(tramp-fuse-unmount): Use it.  Delete VEC from
`tramp-fuse-mount-points'.  Delete mount point.
(tramp-fuse-unmount-on-cleanup): New user option.
(tramp-fuse-cleanup, tramp-fuse-cleanup-all): New defuns.
(top): Adapt `tramp-fuse-unload-hook',
`tramp-cleanup-connection-hook',
`tramp-cleanup-all-connections-hook' and `kill-emacs-hook'.

* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
Add VEC to `tramp-fuse-mount-points'.

* test/lisp/net/tramp-tests.el (tramp-fuse-unmount-on-cleanup): Declare.
(tramp-test39-make-lock-file-name): Use it.
2021-10-03 18:55:35 +02:00
João Távora
137fa2d716 Rename elisp-shorthands to read-symbol-shorthands
The new name fits better in the family of variables that affect
the Lisp reader.

Suggested-by: Po Lu <luangruo@yahoo.com>

* doc/lispref/symbols.texi (Shorthands): Mention read-symbol-shorthands

* lisp/shorthands.el (hack-read-symbol-shorthands)
(hack-read-symbol-shorthands)
(shorthands-font-lock-shorthands): Use read-symbol-shorthands

* lisp/progmodes/elisp-mode.el (elisp--completion-local-symbols)
(elisp--completion-local-symbols)
(elisp-shorthands): Use read-symbol-shorthands

* src/lread.c:
(syms_of_lread): Define Vread_symbol_shorthands
(oblookup_considering_shorthand): Use Vread_symbol_shorthands.

* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer):
(elisp-shorthand-read-from-string): Use read-symbol-shorthands

* test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el
Use new symbol name read-symbol-shorthands.
2021-10-03 16:18:40 +01:00
João Távora
e6fbc45b7b Font-lock shorthands in elisp-mode for quick visual recognition (bug#50959)
Only the shorthanded prefix is font-locked.  This allows the remainder
of the font-lock logic to subsist (e.g. for macro-defining symbols).

* lisp/shorthands.el (cl-lib): Require it when compiling.
(elisp-shorthand-font-lock-face): New face.
(shorthands--mismatch-from-end): New helper.
(shorthands-font-lock-shorthands): New helper.

* test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el:
Add some dummy test code.
2021-10-03 16:18:40 +01:00
Stefan Kangas
6c01a21365 Clarify the purpose of internal--format-docstring-line
* test/lisp/subr-tests.el (subr-test-internal--format-docstring-line):
* lisp/subr.el (internal--format-docstring-line): Make it more clear
that this function is not intended for the first line of a docstring.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add comment explaining
why we use 'internal--format-docstring-line'.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
2021-10-03 01:59:52 +02:00
Dmitry Gutov
86da812afb Migrate Xref off EIEIO
To improve performance and flexibility (bug#50777).

* lisp/progmodes/xref.el (xref-location): Remove.
(xref-file-location): Change to cl-struct.
(xref-buffer-location, xref-bogus-location): Ditto.
(xref-item, xref-match-item): Same.
And update all method definitions accordingly.
(xref--insert-xrefs): Don't use 'oref', use 'xref-item-location'.
(xref--insert-xrefs, xref-show-definitions-completing-read):
Insetad of 'with-slots', use 'xref-item-summary' and
'xref-item-location'.

* lisp/progmodes/etags.el (xref-etags-location):
Change from EIEIO class into a cl-struct.
(xref-etags-apropos-location): Ditto.
Update all method definitions.

* test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-test-run):
Avoid using 'oref'.
2021-10-01 00:02:21 +03:00
Michael Albinus
bd3a1c3134 ; Still working on emba CI
* test/infra/Dockerfile.emba (emacs-base): Install also acl.

* test/infra/gitlab-ci.yml (.test-template): Move 'allow_failure'
clause level up.
2021-09-30 18:28:31 +02:00
Mattias Engdegård
4f24dee675 ; Mark cl-flet indentation test as failing (bug#9622) 2021-09-30 17:23:20 +02:00
Mattias Engdegård
6374943581 ; * test/lisp/emacs-lisp/bytecomp-tests.el: remove ineffective \ 2021-09-30 17:08:46 +02:00
Michael Albinus
e457cff3f4 * test/Makefile.in (WRITE_LOG): Add emacs-module-tests as problematic. 2021-09-29 14:51:39 +02:00
Michael Albinus
0d72beec9b Some inmprovements in emba CI files
* test/infra/Dockerfile.emba: Remove superfluous "make -j4".

* test/infra/gitlab-ci.yml (.test-template): Add 'allow_failure' clause.
(test-all-inotify): Add 'needs' clause.
2021-09-29 09:48:01 +02:00
Mattias Engdegård
2902257128 ; * test/lisp/electric-tests.el: Reduce python-mode log spam. 2021-09-28 17:01:09 +02:00
Michael Albinus
2c3c4446cf Adapt tramp-tests.el for macOS
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Adapt for macOS.
2021-09-28 15:47:01 +02:00
Lars Ingebrigtsen
7757e9b204 Use ert-resource-file in the shorthand tests
Also move to the standard directory naming.
2021-09-28 06:49:03 +02:00
Stefan Kangas
3cabf64131 checkdoc: Allow Lisp symbols to start a message
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Allow
Lisp symbols to start a message.
(checkdoc--error-bad-format-p): New helper function.

* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-test-error-format-is-good)
(checkdoc-test-error-format-is-bad): New helper functions.
(checkdoc-tests-error-message-bad-format-p)
(checkdoc-tests-error-message-bad-format-p/defined-symbols)
(checkdoc-tests-error-message-bad-format-p/not-capitalized):
New tests.
2021-09-28 01:12:36 +02:00
Michael Albinus
f8ef415d4e ; Still more instrumentation on autorevert-tests.el 2021-09-27 20:36:12 +02:00
Michael Albinus
2c2688ffbf Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2021-09-27 14:28:50 +02:00
Michael Albinus
3ad1bcaf04 ; More instrumentation in autorevert-tests.el
* test/lisp/autorevert-tests.el
(auto-revert-test--instrument-kill-buffer-hook): New defun.
(auto-revert-test05-global-notify): More instrumentation.
2021-09-27 14:28:32 +02:00
Stefan Kangas
3d2d7e8ea2 Fix automatic filling of docstring in cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix bug where a paragraph
was filled as if it were a single line, which led to garbled
output in the docstring.  (Bug#50839)

* test/lisp/subr-tests.el
(subr-test-internal--format-docstring-line): New test.
2021-09-27 11:47:55 +02:00
Lars Ingebrigtsen
da4e58458f Fix checkdoc-related test failure 2021-09-27 09:33:56 +02:00
Lars Ingebrigtsen
5f6e88ec9b Fix two doc-related test failures 2021-09-27 09:28:58 +02:00
Michael Albinus
2cef8c216a Optimize emba builds
* test/infra/Dockerfile.emba (emacs-base): Install also
libdbus-1-dev and libacl1-dev.

* test/infra/gitlab-ci.yml (prep-image-base): Comment out.  This
stage is activated by default in Dockerfile.emba.
2021-09-27 09:21:53 +02:00
Lars Ingebrigtsen
00011c0ad2 Make comint understand the ccrypt password phrases
* lisp/comint.el (comint-password-prompt-regexp): Add the ccrypt
confirmation phrase (bug#50837).

* lisp/international/mule-conf.el (password-word-equivalents): Add
the ccrypt phrases.
2021-09-27 08:15:24 +02:00
Lars Ingebrigtsen
bec88ecc82 Add "passwd" (change password) prompt to comint
* lisp/comint.el (comint-password-prompt-regexp): Add "passwd" (to
change the password) first promp in Debian bullseye.
2021-09-27 07:55:37 +02:00
dickmao
cc3b11480c Get a package-test-signed to work again
The test signing key succumbed to either expiration or bitrot.
I hope I didn't just publish my secret key to the world.

* test/lisp/emacs-lisp/package-resources/key.pub: Refresh.
* test/lisp/emacs-lisp/package-resources/key.sec: Refresh.
2021-09-27 06:00:46 +02:00
Lars Ingebrigtsen
d31e56046b Move test-cl-flet-indentation to the right file 2021-09-27 05:57:04 +02:00
João Távora
66f3087530 Add #_ reader macro to escape shorthand renaming
* src/lread.c (read1): Add skip_shorthand variable.  Add a '#_'
case.  If skip_shorthand call oblookup instead of
oblookup_considering_shorthand.

* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-escape): New test.

* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el
(#_f-test4---): New fixture function.
2021-09-27 01:07:11 +01:00
João Távora
90cbf0cb8d Consider shorthands in Elisp's elisp-completion-at-point
Instead of referencing obarray directly, that function has to consider
a collection of completions which includes the shorthand versions of
some of the symbols.  That collection changes from buffer to buffer,
depending on the choice of elisp-shorthands.

To make this process efficient, and avoid needless recalculation of
the above collection, a new obarray-specific cache was invented.  The
Elisp variable obarray-cache is immediately nullified if something
touches the obarray.

* lisp/progmodes/elisp-mode.el : New helper.
(elisp-completion-at-point): Use new helpers.
(elisp--completion-local-symbols)
(elisp--fboundp-considering-shorthands)
(elisp--bboundp-considering-shorthands): New helpers

* src/lread.c (intern_driver): Nullify Qobarray_cache.
(syms_of_lread): Add Qobarray_cache.

* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-completion-at-point): New test.

* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el
(f-test-complete-me): New fixture.
2021-09-27 01:07:11 +01:00
João Távora
68d73eb154 Rework Elisp shorthands to only allow only prefix substitution
This simplification in requirements makes for more complex C code but
that code is much less wasteful in Lisp strings than the previous
implementation.

* src/lread.c (read1): Rework.
(Fintern): Rework.
(Fintern_soft): Rework.
(Funintern): Rework.
(oblookup_considering_shorthand): Rewrite.

* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer)
(elisp-shorthand-read-from-string): Use new format of
elisp-shorthands.

* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el (f-test)
(f-test2, f-test3): Use new form of elisp-shorthands.
2021-09-27 01:07:11 +01:00
João Távora
71857d4106 Move most of the shorthand implementation to C code
It passes the tests designed for the previous Elisp implementation.

Likely, this isn't the final form of the implementation.  For one, the
reader is much slower and allocates a Lisp string for every atom read,
regardless if its already interned or not.  This has the potential to
be catastrophic in terms of GC.

Also rename the main variable to elisp-shorthands, from the
repetitive shorthand-shorthands.

For some reason, I had to put 'hack-elisp-shorthands' and
'load-with-shorthands-and-code-conversion', the new source-file
loading functions, in lisp/international/mule.el.

Otherwise, lisp/loadup.el wouldn't see them, for some reason that I
didn't investigate.  This should probably be fixed.

* lisp/shorthand.el: Remove.

* test/lisp/shorthand-tests.el: Remove.

* src/lread.c:
(read1, Fintern, Fintern_soft, Funintern): Use
oblookup_considering_shorthand.
(oblookup_considering_shorthand): New helper.
(syms_of_lread): Declare elisp-shorthands.

* lisp/progmodes/elisp-mode.el (elisp-shorthands):
Put a safe-local-variable spec.

* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer)
(elisp-shorthand-read-from-string)
(elisp-shorthand-byte-compile-a-file)
(elisp-shorthand-load-a-file): New tests.

* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el: New file

* lisp/loadup.el (load-source-file-function): Set to
load-with-shorthands-and-code-conversion.

* lisp/international/mule.el (hack-elisp-shorthands): Move here.
(load-with-shorthands-and-code-conversion): And here.
2021-09-27 01:07:11 +01:00
João Távora
6237bad419 First Elisp version of lisp/shorthand.el, failing some tests
* lisp/shorthand.el: New file

* test/lisp/shorthand-tests.el: New file
2021-09-27 01:07:11 +01:00
Stefan Kangas
c00785cbab Move two incorrectly named test files
* test/lisp/emacs-lisp/tabulated-list-test.el: Move from here...
* test/lisp/emacs-lisp/tabulated-list-tests.el: ...to here.
* test/lisp/url/url-handlers-test.el: Move from here...
* test/lisp/url/url-handlers-tests.el: ...to here.
2021-09-26 20:45:07 +02:00
Stefan Kangas
8bb28e740d ; Minor stylistic checkdoc fixes in test/**/*.el 2021-09-26 17:53:23 +02:00
Stephen Gildea
4cc4344943 ; Clarify and simplify time-stamp comments
* lisp/time-stamp.el (time-stamp-end, time-stamp-string-preprocess,
time-stamp-formatz-from-parsed-options): Simplify doc.
* test/lisp/time-stamp-tests.el (time-stamp-custom-pattern):
Refactor to set limit-number only once.
2021-09-26 08:23:29 -07:00
Michael Albinus
94af99b298 * test/infra/gitlab-ci.yml (variables): Set DOCKER_BUILDKIT. 2021-09-26 15:28:17 +02:00
Stefan Kangas
3bab1476f6 Rename "Homepage" field to "Website" in package description
* lisp/emacs-lisp/package.el (describe-package-1): Rename
"Homepage" field to "Website".

* test/lisp/emacs-lisp/package-tests.el
(package-test-describe-package)
(package-test-describe-installed-multi-file-package)
(package-test-describe-non-installed-package)
(package-test-describe-non-installed-multi-file-package): Update tests.
2021-09-26 14:55:19 +02:00
Stefan Kangas
a0d5de4fb9 Add test for lm-website
* lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx.
* test/lisp/emacs-lisp/lisp-mnt-tests.el
(lm--tests-lm-website): New test.
2021-09-26 14:55:19 +02:00
Stefan Kangas
c51b1c02db Warn about overly long docstring in lambda
* lisp/emacs-lisp/bytecomp.el
(byte-compile-docstring-length-warn): Warn about overly long
docstring in lambda.  (Bug#44858)

(byte-compile--wide-docstring-p): Improve comment.
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-wide-docstring-defun.el"): Update to test for the above new
warning.
2021-09-26 13:33:29 +02:00
Stefan Kangas
f3a6fe2c7d Avoid false positives in bytecomp docstring width warning
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Ignore more function argument lists.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests-byte-compile--wide-docstring-p): New test.
2021-09-26 13:23:57 +02:00
Stefan Kangas
c78e16962e ; Adjust overly long docstrings to fit 80 characters 2021-09-26 13:23:57 +02:00
Stefan Kangas
ce6cee4ca3 Unbreak ert tests
* test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-print)
(tabulated-list-sort): Update tests for recent change.
2021-09-26 13:21:53 +02:00
Michael Albinus
2cd2fc74e4 ; More instrumentation in autorevert-tests.el 2021-09-26 12:40:55 +02:00
Michael Albinus
27d8726ae2 Adapt Tramp's make-process for macOS.
* lisp/net/tramp-sh.el (tramp-check-remote-uname): New defun.
(tramp-sh-handle-file-ownership-preserved-p)
(tramp-sh-handle-make-process, tramp-find-executable)
(tramp-find-shell, tramp-get-remote-stat): Use it.  (Bug#50748)

* test/lisp/net/tramp-tests.el (tramp-check-remote-uname): Declare.
(tramp-test29-start-file-process, tramp-test30-make-process):
Instrument for macOS.
(tramp--test-hpux-p): Adapt function.
(tramp--test-macos-p): New defun.
2021-09-26 10:32:15 +02:00
Mattias Engdegård
45c32d7f00 Fix byte-compiler crash for legal dynamic-binding code
This should really be taken care of by a syntax normalisation step in
the frontend, but there is no such step for non-lexbind code yet.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Tolerate bindingsa
without initialising expressions.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
2021-09-25 20:25:02 +02:00
Mattias Engdegård
8d0ee5e7a9 Constant-propagate variables bound outside loops
Previously, variables bound outside `while` loops were not substituted
inside even in the absense of mutation.  Add the necessary mutation
checking inside loops to allow propagation of values and aliased
variables.

* lisp/emacs-lisp/byte-opt.el
(byte-optimize--inhibit-outside-loop-constprop): New variable.
(byte-optimize-form-code-walker): First traverse each loop without
substitution to discover mutation, then without restrictions.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-loop): New.
(bytecomp-tests--test-cases): Add test cases.
2021-09-25 20:25:02 +02:00
Mattias Engdegård
0b099e34dc Use ambient lexical-binding value in ert-deftest body (bug#50738)
* lisp/emacs-lisp/ert.el (ert-deftest):
Evaluate the body of `ert-deftest` with the `lexical-binding` value of
the source file (or more precisely the value in force when the
definition is evaluated), which is what everyone expected, instead of
always using dynamic binding which is what they got until now.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-deftest-lexical-binding-t): New test.
2021-09-25 20:25:01 +02:00
Mattias Engdegård
ed02b88bba Renege on anonymous &rest (bug#50268, bug#50720)
Allowing &rest without a variable name following turned out not to be
very useful, and it never worked properly.  Disallow it.

* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list):
* src/eval.c (funcall_lambda):
Signal error for &rest without variable name.
* doc/lispref/functions.texi (Argument List): Adjust manual.
* etc/NEWS (file): Announce.
* test/src/eval-tests.el (eval-tests--bugs-24912-and-24913):
Extend test, also checking with and without lexical binding.
(eval-tests-accept-empty-optional-rest): Reduce to...
(eval-tests-accept-empty-optional): ...this, again checking
with and without lexical binding.
2021-09-25 20:25:01 +02:00