aboutsummaryrefslogtreecommitdiffstats
path: root/test/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Improve a native compiler testAndrea Corallo2021-04-222-1/+12
| | | | | | | * test/src/comp-tests.el (comp-test-47868-1): Improve testcase. * test/src/comp-test-funcs.el (comp-test-47868-3-f) (comp-test-47868-4-f): New functions.
* Fix native compiler string hash consing strategy (bug#47868)Andrea Corallo2021-04-212-0/+12
| | | | | | | | | | | * test/src/comp-tests.el (comp-test-47868-1): Add new test. * test/src/comp-test-funcs.el (comp-test-47868-1-f) (comp-test-47868-2-f): New functions. * lisp/emacs-lisp/comp.el (comp-imm-equal-test): Define new hash tanble test. (comp-data-container): Use it. (comp-final, comp-run-async-workers): have comp required before reading dumped hashes so that `comp-imm-equal-test' is defined.
* Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-04-197-13/+102
|\
| * ; Normalize and add missing first and last linesStefan Kangas2021-04-196-6/+6
| |
| * Attempt to print some debugging information on Seccomp failures.Philipp Stephani2021-04-171-8/+52
| | | | | | | | | | | | | | | | | | | | Try to search the audit log as well as recent core dumps. * test/src/emacs-tests.el (emacs-tests--seccomp-debug): New helper function. (emacs-tests/seccomp/allows-stdout) (emacs-tests/seccomp/forbids-subprocess) (emacs-tests/bwrap/allows-stdout): Use it.
| * Add two optional arguments to 'string-width'Eli Zaretskii2021-04-141-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/character.c (Fstring_width, lisp_string_width): Accept two optional arguments FROM and TO, to indicate the substring to be considered. (Fstring_width): Add caveats in the doc string about display features ignored by the function. (Bug#47712) * src/character.h (lisp_string_width): Update prototype. * src/editfns.c (styled_format): Adjust call of lisp_string_width to its changed signature. * test/src/character-tests.el (character-test-string-width): New file with tests for 'string-width'. * doc/lispref/display.texi (Size of Displayed Text): Document caveats of using 'string-width'. * etc/NEWS: Announce the change.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-04-133-0/+215
|\ \ | |/
| * Add a variant of the Seccomp filter file that allows 'execve'.Philipp Stephani2021-04-112-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful when starting Emacs with a Seccomp filter enabled, e.g. using 'bwrap'. * lib-src/seccomp-filter.c (main): Generate new Seccomp files. * lib-src/Makefile.in (all) (seccomp-filter.bpf seccomp-filter.pfc seccomp-filter-exec.bpf seccomp-filter-exec.pfc): Generate new Seccomp files. * .gitignore: Ignore new Seccomp files. * test/src/emacs-tests.el (emacs-tests/bwrap/allows-stdout): New unit test.
| * Add a helper binary to create a basic Secure Computing filter.Philipp Stephani2021-04-102-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The binary uses the 'seccomp' helper library. The library isn't needed to load the generated Secure Computing filter. * configure.ac: Check for 'seccomp' header and library. * lib-src/seccomp-filter.c: New helper binary to generate a generic Secure Computing filter for GNU/Linux. * lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper binary if possible. (all): Add Secure Computing filter file if possible. (seccomp-filter$(EXEEXT)): Compile helper binary. (seccomp-filter.bpf seccomp-filter.pfc): Generate filter files. * test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout) (emacs-tests/seccomp/forbids-subprocess): New unit tests. * test/Makefile.in (src/emacs-tests.log): Add dependency on the helper binary.
| * Add support for --seccomp command-line option.scratch/seccomp-emacs-openPhilipp Stephani2021-04-101-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passing this option on GNU/Linux, Emacs installs a Secure Computing kernel system call filter. See Bug#45198. * configure.ac: Check for seccomp header. * src/emacs.c (usage_message): Document --seccomp option. (emacs_seccomp): New wrapper for 'seccomp' syscall. (load_seccomp, maybe_load_seccomp): New helper functions. (main): Potentially load seccomp filters during startup. (standard_args): Add --seccomp option. * lisp/startup.el (command-line): Detect and ignore --seccomp option. * test/src/emacs-tests.el (emacs-tests/seccomp/absent-file) (emacs-tests/seccomp/empty-file) (emacs-tests/seccomp/file-too-large) (emacs-tests/seccomp/invalid-file-size): New unit tests. (emacs-tests--with-temp-file): New helper macro. * etc/NEWS: Document new --seccomp option.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-04-051-3/+3
|\ \ | |/
| * Remove redundant #' before lambda in testsStefan Kangas2021-04-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-03-312-0/+206
|\ \ | |/
| * File unlock errors now issue warnings (Bug#46397)Matt Armstrong2021-03-271-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary idea is to allow `kill-buffer' and `kill-emacs' to complete even if Emacs has trouble unlocking the buffer's file. * lisp/userlock.el (userlock--handle-unlock-error): New function, call `display-error'. * src/filelock.c (unlock_file_body): New function, do what 'unlock_file' used to. (unlock_file_handle_error): New function, call `userlock--handle-unlock-error' with the captured error. (unlock_file): Handle `file-error' conditions by calling the handler defined above. * test/src/filelock-tests.el (filelock-tests-kill-buffer-spoiled): (filelock-tests-unlock-spoiled): Modify to test new behavior.
| * Add test coverage for src/filelock.c (Bug#46397)Matt Armstrong2021-03-271-0/+173
| | | | | | | | * test/src/filelock-tests.el: New file.
| * Assert not local-variable-p after setq in let_default bindingSpencer Baugh2021-03-251-0/+1
| | | | | | | | | | | | | | | | Breaking this is a likely way to break this test, so this saves a bit of time in debugging. * test/src/data-tests.el (data-tests--let-buffer-local): Add assertion to test.
| * Add a test for let-binding unwindingSpencer Baugh2021-03-251-0/+22
| | | | | | | | | | | | | | | | | | Bindings in other buffers are not un-set when we unwind a let-binding which set the default value. There doesn't seem to be an existing test which covers this, so here's one. * test/src/data-tests.el (data-tests--let-buffer-local-no-unwind-other-buffers): Add test for let-binding unwinding behavior
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-03-251-1/+0
|\ \ | |/
| * Remove unnecessary requires of rxStefan Kangas2021-03-221-1/+0
| | | | | | | | | | * lisp/cedet/semantic/wisent/python.el (rx): * test/src/process-tests.el (rx): Remove unnecessary requires.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-03-191-0/+2
|\ \ | |/
| * Fix a warning due to not preloading facemenu.elStefan Kangas2021-03-191-0/+1
| | | | | | | | * test/src/undo-tests.el (facemenu): Require.
| * Fix breaking undo-testLars Ingebrigtsen2021-03-181-0/+1
| |
* | Fix some entry in `comp-known-type-specifiers' (bug#46847)Andrea Corallo2021-03-141-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Some fix. * test/src/comp-tests.el (comp-tests-46670-1): Update test.
* | * test/src/comp-test-funcs.el (comp-test-46670-1-f): Remove a warning.Andrea Corallo2021-03-091-1/+1
| |
* | Merge commit '9cbdf20316' into native-compAndrea Corallo2021-03-091-1/+57
|\ \ | |/
| * Add some new tests for keymap.cStefan Kangas2021-03-061-1/+57
| | | | | | | | | | | | | | | | | | * test/src/keymap-tests.el (keymap-define-key/undefined) (keymap-define-key/keyboard-macro, keymap-define-key/lambda) (keymap-define-key/keymap, keymap-define-key/menu-item) (keymap-lookup-key/list-of-keymaps, keymap-lookup-key/too-long): New tests. (keymap-lookup-key): Extend test slightly.
* | Fix `comp-cstr-intersection-no-hashcons' for negated result cstrAndrea Corallo2021-03-061-1/+8
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-hashcons): When negated and necessary relax dst to t. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
* | Fix `=' propagation to handle -0.0 0.0 caseAndrea Corallo2021-03-061-8/+24
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-homogeneous): Fix indent + use `memql'. (comp-cstr-=): Handle 0.0 -0.0 idiosyncrasy * test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests and fix enumeration.
* | Don't call _setjmp through a function pointer (Bug#46824)Pip Cet2021-03-032-2/+22
| | | | | | | | | | | | | | | | | | * src/comp.c (helper_link_table): Don't include SETJMP except on Windows. (emit_setjmp): Don't use function pointers except on Windows. (declare_runtime_imported_funcs): Don't import SETJMP at runtime. (ABI_VERSION): Bump. * test/src/comp-tests.el (46824-1): New test. * test/src/comp-test-funcs.el (comp-test-46824-1-f): New function.
* | Fix two compiler ICEs dealing with nan and infinityAndrea Corallo2021-03-031-0/+8
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Don't crash when truncate fails. * test/src/comp-test-funcs.el (comp-test-=-nan): Add two functions to be compiled.
* | Fix = propagation semantic for constrained inputsAndrea Corallo2021-03-021-1/+28
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Synthesize `comp-cstr-shallow-copy'. (comp-cstr-=): Relax inputs before intersecting them. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add three tests.
* | Fix `eql' `equal' propagation of non hash consed values (bug#46843)Andrea Corallo2021-03-011-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend assumes allowing the following form: (assume dst (and-nhc src1 src2)) `and-nhc' assume operator allow for constraining correctly intersections where non hash consed values are not propagated as values but rather promoted to their types. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-hashcons): New function. * lisp/emacs-lisp/comp.el (comp-emit-assume): Logic update to emit `and-nhc' operator (implemented in fwprop by `comp-cstr-intersection-no-hashcons'). (comp-add-cond-cstrs): Map `eq' to `and' assume operator and `equal' `eql' into `and-nhc'. (comp-fwprop-insn): Update to handle `and-nhc'. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests covering `eql' and `equal' propagation of non hash consed values.
* | Don't treat '=' as simple equality emitting constraints (bug#46812)Andrea Corallo2021-02-281-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend assumes allowing the following form (assume dst (= src1 src2)) to caputure '=' semanting during fwprop handling float integer conversions. * lisp/emacs-lisp/comp.el (comp-equality-fun-p): Don't treat '=' as simple equality. (comp-arithm-cmp-fun-p, comp-negate-arithm-cmp-fun) (comp-reverse-arithm-fun): Rename and add '=' '!='. (comp-emit-assume, comp-add-cond-cstrs, comp-fwprop-insn): Update for new function nameing and to handle '='. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): New function. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a bunch of '=' specific tests.
* | Migrate and rename a bunch of functions from comp.el to comp-cstr.elAndrea Corallo2021-02-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-imm-vld-p) (comp-cstr-imm, comp-cstr-fixnum-p, comp-cstr-symbol-p) (comp-cstr-cons-p): Move and rename from 'comp.el'. * lisp/emacs-lisp/comp.el (comp-mvar-type-hint-match-p) (make-comp-mvar, comp-emit-assume, comp-fwprop-prologue) (comp-function-foldable-p, comp-function-call-maybe-fold) (comp-fwprop-call, comp-fwprop-insn, comp-call-optim-func) (comp-compute-function-type): Update for renamed functions. * src/comp.c (emit_mvar_rval): Likewise. * test/src/comp-tests.el (comp-tests-mentioned-p-1) (comp-tests-cond-rw-checker-val): Likewise.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-02-262-7/+19
|\ \ | |/
| * Skip tests that require Internet when there's no InternetRobert Pluim2021-02-221-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#46641 The network-stream-tests actually work fine when the local machine has no IP at all, but cause a crash in the GnuTLS library when there is an IP configured but the interface is down. * test/lisp/net/network-stream-tests.el (internet-is-working): New defvar, checks if we can resolve "google.com". (connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait) (open-network-stream-tls-nowait, open-gnutls-stream-new-api-nowait) (open-gnutls-stream-old-api-nowait): Use it to check for working Internet access. * test/src/process-tests.el (internet-is-working): New defvar, checks if we can resolve "google.com". (lookup-family-specification, lookup-unicode-domains) (unibyte-domain-name, lookup-google, non-existent-lookup-failure): Use it to check for working Internet access.
| * Improve wrong number of args error message in propertizeStefan Kangas2021-02-221-0/+4
| | | | | | | | | | | | | | * src/editfns.c (Fpropertize): Improve error message. (syms_of_editfns) <Qpropertize>: New DEFSYM. * test/src/editfns-tests.el (propertize/error-wrong-number-of-args): New test.
* | Do not emit assumptions referencing clobbered mvars (bug#46670)Andrea Corallo2021-02-232-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-func): Add `vframe-size' slot. (comp-new-frame): Add `vsize' parameter. (comp-limplify-top-level, comp-limplify-function): Update for new `comp-new-frame'. (comp-maybe-add-vmvar): New function. (comp-add-cond-cstrs): Logic update to emit assumptions not referencing clobbered variables. (comp-place-phis, comp-ssa, comp-ssa-rename-insn) (comp-ssa-rename): Update rename logic to rename also negative slots. (comp-fwprop-insn): Update to handle `(assume mvar mvar)' form. * test/src/comp-tests.el (46670-1): Add testcase. * test/src/comp-test-funcs.el (comp-test-46670-1-f) (comp-test-46670-2-f): New functions.
* | * Fix union constraint for mixed pos/neg constraintsAndrea Corallo2021-02-221-1/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix neg type shadowing pos values. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Add testcase. * test/src/comp-tests.el (comp-tests-type-spec-tests): Fix testcase.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-211-8/+31
|\ \ | |/
| * * test/lisp/emacs-lisp/edebug-tests.el: Adjust to new `edebug-eval-defun`.Stefan Monnier2021-02-191-8/+31
| | | | | | | | | | | | | | (edebug-tests-trivial-backquote): Adjust to the way `eval-defun` outputs its result. (edebug-tests-cl-macrolet): Adjust to the fact that now macro expansion takes place during the `eval-defun` even when Edebugging.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-02-171-0/+28
|\ \ | |/
| * Allow any JSON value at the top level (Bug#42994).Philipp Stephani2021-02-131-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer standards like RFC 8259, which obsoletes the earlier RFC 4627, now allow any top-level value unconditionally, so Emacs should too. * src/json.c (Fjson_serialize, Fjson_insert): Pass JSON_ENCODE_ANY to allow serialization of any JSON value. Call 'lisp_to_json' instead of 'lisp_to_json_toplevel'. Remove obsolete comments (neither JSON_DECODE_ANY nor JSON_ALLOW_NUL are allowed here). Reword documentation strings. (Fjson_parse_string, Fjson_parse_buffer): Pass JSON_DECODE_ANY to allow deserialization of any JSON value. Reword documentation strings. (lisp_to_json_nonscalar, lisp_to_json_nonscalar_1): Rename from "toplevel" to avoid confusion. (lisp_to_json): Adapt caller. * test/src/json-tests.el (json-serialize/roundtrip-scalars): New unit test. * doc/lispref/text.texi (Parsing JSON): Update documentation.
* | Fix inverted logic in constraint comparison (bug#46540)Andrea Corallo2021-02-171-1/+28
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr->, comp-cstr->=) (comp-cstr-<, comp-cstr-<=): Fix inverted logic. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add three integer constrain tests.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-105-27/+83
|\ \ | |/
| * ; Minor license statement fixesStefan Kangas2021-02-082-22/+22
| |
| * Move line-number-at-pos to CLars Ingebrigtsen2021-02-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/positions.texi (Text Lines): Revert previous change. * lisp/simple.el (line-number-at-pos): Remove definition. * lisp/simple.el (count-lines): Revert back to using `forward-line', because there seems to be a disagreement on how lines should be counted in a region... * src/fns.c (Fline_number_at_pos): Rename from Fline_number_at_position and adjust parameter list.
| * Add a new function 'line-number-at-position'Lars Ingebrigtsen2021-02-071-0/+8
| | | | | | | | | | | | | | | | | | * doc/lispref/positions.texi (Text Lines): Document it. * lisp/simple.el (count-lines): Use it. (line-number-at-pos): Ditto. * src/fns.c (Fline_number_at_position): New function (bug#22763).
| * ; Fix byte-compilation warningEli Zaretskii2021-02-061-1/+1
| | | | | | | | | | * test/src/process-tests.el (process-sentinel-interrupt-event): Fix byte compilation warning.
| * ; Fix last changeEli Zaretskii2021-02-061-2/+1
| |