2020-09-01 21:59:11 +00:00
|
|
|
#+TITLE: The Location of Emacs Lisp Tests
|
2015-11-23 22:02:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* The Main Emacs Repository
|
|
|
|
|
2020-09-01 21:59:11 +00:00
|
|
|
The Emacs repository contains a very large number of Emacs Lisp files, many of
|
2015-11-23 22:02:42 +00:00
|
|
|
which pre-date both formal package support for Emacs and automated unit
|
|
|
|
testing.
|
|
|
|
|
|
|
|
All paths are relative to the Emacs root directory.
|
|
|
|
|
|
|
|
** Source
|
|
|
|
|
|
|
|
Lisp files are stored in the ~lisp~ directory or its sub-directories.
|
|
|
|
Sub-directories are in many cases themed after packages (~gnus~, ~org~,
|
|
|
|
~calc~), related functionality (~net~, ~emacs-lisp~, ~progmodes~) or status
|
|
|
|
(~obsolete~).
|
|
|
|
|
2021-01-19 13:12:22 +00:00
|
|
|
C source is stored in the ~src~ directory, which is flat. Source for
|
|
|
|
utility programs is stored in the ~lib-src~ directory.
|
2015-11-23 22:02:42 +00:00
|
|
|
|
|
|
|
** Test Files
|
|
|
|
|
2017-02-14 16:17:51 +00:00
|
|
|
Automated tests should be stored in the ~test/lisp~ directory for
|
2021-01-19 13:12:22 +00:00
|
|
|
tests of functionality implemented in Lisp, in the ~test/src~
|
|
|
|
directory for functionality implemented in C, and in the
|
|
|
|
~test/lib-src~ directory for utility programs. Tests should reflect
|
2017-02-14 16:17:51 +00:00
|
|
|
the directory structure of the source tree; so tests for files in the
|
|
|
|
~lisp/emacs-lisp~ source directory should reside in the
|
2015-11-23 22:02:42 +00:00
|
|
|
~test/lisp/emacs-lisp~ directory.
|
|
|
|
|
2017-02-14 16:17:51 +00:00
|
|
|
Tests should normally reside in a file with ~-tests.el~ added to the
|
|
|
|
base-name of the tested source file; hence ~ert.el~ is tested in
|
2017-11-05 11:40:13 +00:00
|
|
|
~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As an
|
2017-02-14 16:17:51 +00:00
|
|
|
exception, tests for a single feature may be placed into multiple
|
|
|
|
files of any name which are themselves placed in a directory named
|
|
|
|
after the feature with ~-tests~ appended, such as
|
|
|
|
~/test/lisp/emacs-lisp/eieio-tests~
|
2015-11-23 22:02:42 +00:00
|
|
|
|
2021-01-19 13:12:22 +00:00
|
|
|
Similarly, tests of features implemented in C should reside in
|
|
|
|
~/test/src~ or in ~test/lib-src~ and be named after the C file with
|
|
|
|
~-tests.el~ added to the base-name of the tested source file. Thus,
|
|
|
|
tests for ~src/fileio.c~ should be in ~test/src/fileio-tests.el~.
|
2015-11-23 22:02:42 +00:00
|
|
|
|
2021-02-19 11:31:56 +00:00
|
|
|
Some tests do not belong to any one particular file. Such tests
|
|
|
|
should be put in the ~misc~ directory and be given a descriptive name
|
|
|
|
that does /not/ end with ~-tests.el~.
|
|
|
|
|
2015-11-23 22:02:42 +00:00
|
|
|
There are also some test materials that cannot be run automatically
|
2017-02-14 16:17:51 +00:00
|
|
|
(i.e. via ert). These should be placed in ~/test/manual~; they are
|
|
|
|
not run by the "make check" command and its derivatives.
|
2015-11-23 22:02:42 +00:00
|
|
|
|
|
|
|
** Resource Files
|
|
|
|
|
2017-02-14 16:17:51 +00:00
|
|
|
Resource files for tests (containing test data) should reside in a
|
|
|
|
directory named after the feature with a ~-resources~ suffix, and
|
|
|
|
located in the same directory as the feature. Hence, the lisp file
|
Fix obsolete ‘test/automated’ references
* Makefile.in (mostlyclean, clean, maybeclean_dirs, distclean)
(bootstrap-clean, maintainer-clean):
Clean ‘test’, not ‘test/automated’. Test for existence of
subdirectory only for ‘test’, not for directories that should
always exist.
* admin/MAINTAINERS, etc/TODO, lisp/emacs-lisp/bytecomp.el:
* lisp/emacs-lisp/seq.el, lisp/emacs-lisp/thunk.el:
* lisp/man.el (Man-parse-man-k):
* lisp/url/url-domsuf.el, make-dist:
* test/file-organization.org:
Fix obsolete references to test/automated.
2017-03-27 18:22:54 +00:00
|
|
|
~lisp/progmodes/flymake.el~, with tests in
|
|
|
|
~test/lisp/progmodes/flymake-tests.el~, should have resources in a
|
|
|
|
directory called ~test/lisp/progmodes/flymake-resources~.
|
2015-11-23 22:02:42 +00:00
|
|
|
|
2016-01-04 22:46:35 +00:00
|
|
|
No guidance is given for the organization of resource files inside the
|
2018-01-18 20:54:21 +00:00
|
|
|
~-resources~ directory; files can be organized at the author's
|
2017-02-14 16:17:51 +00:00
|
|
|
discretion.
|
2021-01-14 10:34:09 +00:00
|
|
|
|
|
|
|
** Testing Infrastructure Files
|
|
|
|
|
|
|
|
Files used to support testing infrastructure such as EMBA should be
|
|
|
|
placed in ~infra~.
|