all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: emacs-devel@gnu.org
Cc: johnw@gnu.org, Michael Albinus <michael.albinus@gmx.de>
Subject: Re: Locations of Tests
Date: Wed, 04 Nov 2015 21:26:17 +0000	[thread overview]
Message-ID: <87ziytqww6.fsf@russet.org.uk> (raw)
In-Reply-To: <m2h9l1y3sv.fsf@newartisans.com> (John Wiegley's message of "Wed,  4 Nov 2015 14:15:12 -0500")

[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]



John Wiegley <jwiegley@gmail.com> writes:

>>>>>> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Before we rename everything, wouldn't a simple directive in the source file
>> do the job?
>
>> ;; Package-Tests: test/automated/file-notify-tests.el
>
> That would also work, but having a naming structure also makes it easier for
> contributors to know where new files they create should go. So I'd prefer to
> have a convention, rather than make it freeform, with a set of textual links
> to relate the two sets.

I'd tend to agree.

I think I'd like to get a specification sorted first before making the
changes. I've included my starter-for-ten below. I'm willing to take any
feedback here -- or I could add it to the emacs-repo as an orphan
branch, then people could change directly.

I've given locations for test files, and resources (data files). This is
both for Emacs-lisp source files and for lisp tests for features
provided in C (inotify-test.el for example). There are also suggestions
for ELPA packages.

I've said nothing about C tests for the C core, because I know nothing
about C testing (and almost nothing about C coding!). Adding a
buffer-local as suggested above as a legacy might make sense.

Phil


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-tests.org --]
[-- Type: text/x-org, Size: 2276 bytes --]


#+TITLE: The Location of Emacs-Lisp Tests

* Introduction

In this document, we describe the relationship between Emacs-Lisp files and
their associated automated test files.


* In Emacs

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. The test layout is, therefore, somewhat different than for ELPA
packages.

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.

** Test Files

Automated tests should be stored in the ~test/automated~ directory. Tests
should reflect the directory structure of the source tree; so tests for files
in the ~emacs-lisp~ source directory should reside in the
~test/automated/emacs-lisp~ directory.

Tests should normally reside in a file with an ~-test~ added to the name of
the tested source file; hence ~ert.el~ is tested in ~ert-test.el~, or
~pcase.el~ is tested in ~pcase-test.el~.

Where features of the C source are tested using Emacs-Lisp test files, these
should reside in ~/test/automated/c~ and be named after the C file.

** Resource Files

Resource files for tests (containing test data) should reside in a directory
named after the feature with a ~-resources~ suffix. Hence, tests files for
~flymake.el~ should reside in a directory called ~flymake-resources~.

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


* In ELPA

All paths are given relative to the package root.

** Source Files

ELPA lisp files should be stored at top-level within the package.

** Test Files

Test files should normally reside in the ~test~ directory, and be named after
the file being tested.

** Resources Files

Resource files for tests should reside in the ~dev-resources~ directory. No
guidance is given for the organisation of resource files inside the
~dev-resource~ directory; files can be organised at the author's discretion.





  reply	other threads:[~2015-11-04 21:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 17:36 Locations of Tests Phillip Lord
2015-11-04 17:53 ` John Wiegley
2015-11-04 18:14   ` Artur Malabarba
2015-11-04 18:21     ` John Wiegley
2015-11-25  9:23       ` Phillip Lord
2015-11-25  9:43         ` Artur Malabarba
2015-11-25 14:17           ` Phillip Lord
2015-11-04 19:15     ` Steinar Bang
2015-11-04 19:23       ` David Kastrup
2015-11-04 21:33         ` Phillip Lord
2015-11-04 19:07   ` Michael Albinus
2015-11-04 19:15     ` John Wiegley
2015-11-04 21:26       ` Phillip Lord [this message]
2015-11-05 13:41         ` Stephen Leake
2015-11-05 13:59           ` Artur Malabarba
2015-11-05 15:02             ` Nicolas Petton
2015-11-05 15:08               ` Artur Malabarba
2015-11-06  9:56                 ` Phillip Lord
2015-11-05 15:27           ` Juanma Barranquero
2015-11-06  9:55           ` Phillip Lord
2015-11-06 10:02 ` Makefile-help (was Re: Locations of Tests) Phillip Lord
2015-11-07  6:48   ` Stephen Leake
2015-11-07 10:55     ` Location of tests (again) (was Re: Makefile-help) Phillip Lord
2015-11-07 11:06       ` Juanma Barranquero
2015-11-07 11:22         ` Phillip Lord
2015-11-07 11:36           ` Juanma Barranquero
2015-11-07 17:46             ` Phillip Lord
2015-11-07 11:45           ` Eli Zaretskii
2015-11-07 18:09             ` Stephen Leake
2015-11-10 20:34       ` Przemysław Wojnowski
2015-11-10 20:45         ` Phillip Lord
2015-11-10 21:41           ` Przemysław Wojnowski
2015-11-10 22:27             ` John Wiegley
2015-11-11  0:28             ` bikeshedding (was Re: Location of tests (again) (was Re: Makefile-help)) Stephen Leake
2015-11-11 10:31             ` Location of tests (again) (was Re: Makefile-help) Phillip Lord
2015-11-11 17:02               ` UI tests Richard Stallman
2015-11-11 17:25                 ` John Wiegley
2015-11-12 14:09                 ` Phillip Lord
2015-11-12 14:37                   ` Alan Mackenzie
2015-11-12 16:33                   ` Eli Zaretskii
2015-11-13 21:58                   ` Richard Stallman
2015-11-15 12:14                 ` Przemysław Wojnowski
2015-11-16 19:32                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ziytqww6.fsf@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=emacs-devel@gnu.org \
    --cc=johnw@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.