unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 7cf5b88d6d06079108faceab4b04da627c80e036 2628 bytes (raw)
name: test/file-organization.org 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
#+TITLE: The Location of Emacs Lisp Tests



* The Main Emacs Repository

The Emacs repository contains a very large number of Emacs Lisp files, many of
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~).

C source is stored in the ~src~ directory, which is flat.  Source for
utility programs is stored in the ~lib-src~ directory.

** Test Files

Automated tests should be stored in the ~test/lisp~ directory for
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
the directory structure of the source tree; so tests for files in the
~lisp/emacs-lisp~ source directory should reside in the
~test/lisp/emacs-lisp~ directory.

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
~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~.  As an
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~

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~.

There are also some test materials that cannot be run automatically
(i.e. via ert).  These should be placed in ~/test/manual~; they are
not run by the "make check" command and its derivatives.

** Resource Files

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
~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~.

No guidance is given for the organization of resource files inside the
~-resources~ directory; files can be organized at the author's
discretion.

** Testing Infrastructure Files

Files used to support testing infrastructure such as EMBA should be
placed in ~infra~.

debug log:

solving 7cf5b88d6d ...
found 7cf5b88d6d in https://git.savannah.gnu.org/cgit/emacs.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).