; ChangeLog.3 update
[emacs.git] / test / README
blobef5f53cba5563be80b3e3052e2a17d113d8f755e
1 Copyright (C) 2008-2018 Free Software Foundation, Inc.
2 See the end of the file for license conditions.
4 This directory contains files intended to test various aspects of
5 Emacs's functionality.  Please help add tests!
7 See the file file-organization.org for the details of the directory
8 structure and file-naming conventions.
10 Emacs uses ERT, Emacs Lisp Regression Testing, for testing.  See (info
11 "(ert)") or https://www.gnu.org/software/emacs/manual/html_node/ert/
12 for more information on writing and running tests.
14 The Makefile in this directory supports the following targets:
16 * make check
17   Run all tests as defined in the directory.  Expensive tests are
18   suppressed.  The result of the tests for <filename>.el is stored in
19   <filename>.log.
21 * make check-maybe
22   Like "make check", but run only the tests for files which have
23   unresolved prerequisites.
25 * make check-expensive
26   Like "make check", but run also the tests marked as expensive.
28 * make <filename>  or  make <filename>.log
29   Run all tests declared in <filename>.el.  This includes expensive
30   tests.  In the former case the output is shown on the terminal, in
31   the latter case the output is written to <filename>.log.
33 ERT offers selectors, which make it possible to filter out which test
34 cases shall run.  The make variable $(SELECTOR) gives you a simple
35 mean to use your own selectors.  The ERT manual describes how
36 selectors are constructed, see (info "(ert)Test Selectors") or
37 https://www.gnu.org/software/emacs/manual/html_node/ert/Test-Selectors.html
39 You could use predefined selectors of the Makefile.  "make <filename>
40 SELECTOR='$(SELECTOR_DEFAULT)'" runs all tests for <filename>.el
41 except the tests tagged as expensive.
43 If your test file contains the tests "test-foo", "test2-foo" and
44 "test-foo-remote", and you want to run only the former two tests, you
45 could use a selector regexp (note that the "$" needs to be doubled to
46 protect against "make" variable expansion):
48     make <filename> SELECTOR='"foo$$"'
50 Note that although the test files are always compiled (unless they set
51 no-byte-compile), the source files will be run by default, to give
52 nicer backtraces.  To run the compiled version of a test use
54     make TEST_LOAD_EL=no ...
56 The tests are run in batch mode by default; sometimes it's useful to
57 get precisely the same environment but run in interactive mode for
58 debugging.  To do that, use
60     make TEST_INTERACTIVE=yes ...
62 Some of the tests require a remote temporary directory
63 (filenotify-tests.el, shadowfile-tests.el and tramp-tests.el).  Per
64 default, a mock-up connection method is used (this might not be
65 possible when running on MS Windows).  If you want to test a real
66 remote connection, set $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable
67 value in order to overwrite the default value:
69   env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ...
72 (Also, see etc/compilation.txt for compilation mode font lock tests.)
75 This file is part of GNU Emacs.
77 GNU Emacs is free software: you can redistribute it and/or modify
78 it under the terms of the GNU General Public License as published by
79 the Free Software Foundation, either version 3 of the License, or
80 (at your option) any later version.
82 GNU Emacs is distributed in the hope that it will be useful,
83 but WITHOUT ANY WARRANTY; without even the implied warranty of
84 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
85 GNU General Public License for more details.
87 You should have received a copy of the GNU General Public License
88 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.