Support automated ‘make check’ in non-C locale

This lets the builder optionally test Emacs behavior in other locales.
The C locale is still the default for tests.
* test/automated/Makefile.in (TEST_LOCALE): New macro.
(emacs): Use it.
* test/automated/flymake-tests.el (flymake-tests--current-face):
Use C locale for subprocesses so that tests behave as expected.
* test/automated/python-tests.el:
(python-shell-prompt-validate-regexps-1)
(python-shell-prompt-validate-regexps-2)
(python-shell-prompt-validate-regexps-3)
(python-shell-prompt-validate-regexps-4)
(python-shell-prompt-validate-regexps-5)
(python-shell-prompt-validate-regexps-6)
(python-shell-prompt-set-calculated-regexps-1):
Adjust expected output to match locale.
* test/automated/tildify-tests.el (tildify-test--test)
(tildify-space-test--test, tildify-space-undo-test--test):
This test assumes UTF-8 encoding.
This commit is contained in:
Paul Eggert 2015-09-03 22:13:31 -07:00
parent 26bd978d87
commit 4874f0bbac
4 changed files with 25 additions and 8 deletions

View file

@ -52,9 +52,15 @@ unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
## To run tests under a debugger, set this to eg: "gdb --args".
GDB =
# The locale to run tests under. Tests should work if this is set to
# any supported locale. Use the C locale by default, as it should be
# supported everywhere.
TEST_LOCALE = C
# The actual Emacs command run in the targets below.
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) $(GDB) "$(EMACS)" $(EMACSOPT)
emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) EMACS_TEST_DIRECTORY=$(srcdir) \
$(GDB) "$(EMACS)" $(EMACSOPT)
.PHONY: all check

View file

@ -34,6 +34,7 @@
(defun flymake-tests--current-face (file predicate)
(let ((buffer (find-file-noselect
(expand-file-name file flymake-tests-data-directory)))
(process-environment (cons "LC_ALL=C" process-environment))
(i 0))
(unwind-protect
(with-current-buffer buffer

View file

@ -2920,7 +2920,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-input-regexps'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-input-regexps'")))))
(ert-deftest python-shell-prompt-validate-regexps-2 ()
"Check `python-shell-prompt-output-regexps' are validated."
@ -2929,7 +2930,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-output-regexps'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-output-regexps'")))))
(ert-deftest python-shell-prompt-validate-regexps-3 ()
"Check `python-shell-prompt-regexp' is validated."
@ -2938,7 +2940,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-regexp'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-regexp'")))))
(ert-deftest python-shell-prompt-validate-regexps-4 ()
"Check `python-shell-prompt-block-regexp' is validated."
@ -2947,7 +2950,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-block-regexp'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-block-regexp'")))))
(ert-deftest python-shell-prompt-validate-regexps-5 ()
"Check `python-shell-prompt-pdb-regexp' is validated."
@ -2956,7 +2960,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-pdb-regexp'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-pdb-regexp'")))))
(ert-deftest python-shell-prompt-validate-regexps-6 ()
"Check `python-shell-prompt-output-regexp' is validated."
@ -2965,7 +2970,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-output-regexp'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-output-regexp'")))))
(ert-deftest python-shell-prompt-validate-regexps-7 ()
"Check default regexps are valid."
@ -2982,7 +2988,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
:type 'user-error)))
(should
(string= (cadr error-data)
"Invalid regexp \\( in `python-shell-prompt-output-regexp'"))))
(format-message
"Invalid regexp \\( in `python-shell-prompt-output-regexp'")))))
(ert-deftest python-shell-prompt-set-calculated-regexps-2 ()
"Check `python-shell-prompt-input-regexps' are set."

View file

@ -55,6 +55,7 @@ If IS-XML is non-nil, <pre> tag is not treated specially."
INPUT is the initial content of the buffer and EXPECTED is expected result
after `tildify-buffer' is run."
(with-temp-buffer
(setq-local buffer-file-coding-system 'utf-8)
(dolist (mode modes)
(erase-buffer)
(funcall mode)
@ -187,6 +188,7 @@ The function must terminate as soon as callback returns nil."
(defun tildify-space-test--test (modes nbsp env-open &optional set-space-string)
(with-temp-buffer
(setq-local buffer-file-coding-system 'utf-8)
(dolist (mode modes)
(funcall mode)
(when set-space-string
@ -226,6 +228,7 @@ The function must terminate as soon as callback returns nil."
(defun tildify-space-undo-test--test
(modes nbsp env-open &optional set-space-string)
(with-temp-buffer
(setq-local buffer-file-coding-system 'utf-8)
(dolist (mode modes)
(funcall mode)
(when set-space-string