Skip to content

Commit 075c51c

Browse files
committed
Merge branch 'future-doc'
2 parents 5bb986a + 9285ecb commit 075c51c

File tree

8 files changed

+106
-36
lines changed

8 files changed

+106
-36
lines changed

README.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ provides only a brief overview.
5151
setups.
5252
* Can run on {uri-documentation}#different-emacs-versions[different
5353
Emacs version] even on the same machine; can also use
54-
{uri-documentation}#docker[Docker] for that.
54+
{uri-documentation}#docker[Docker] or
55+
{uri-documentation}#podman[Podman] for that.
5556
* There are {uri-documentation}#setup-procedure[_four_ levels of
5657
configuration] — you can customize most aspects of Eldev for your
5758
project needs and personal preferences.

doc/README.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
:uri-ert-sel: https://www.gnu.org/software/emacs/manual/html_node/ert/Test-Selectors.html
1919
:uri-buttercup: https://github.com/jorgenschaefer/emacs-buttercup
2020
:uri-buttercup-rt: https://github.com/jorgenschaefer/emacs-buttercup/blob/master/docs/running-tests.md
21+
:uri-doctest: https://github.com/ag91/doctest
2122
:uri-ecukes: https://github.com/ecukes/ecukes
2223
:uri-cask: https://github.com/cask/cask
2324
:uri-makem-sh: https://github.com/alphapapa/makem.sh
@@ -37,6 +38,7 @@
3738
:uri-travis: https://travis-ci.org/
3839
:uri-circle: https://circleci.com/
3940
:uri-docker: https://www.docker.com/
41+
:uri-podman: https://podman.io/
4042
:uri-coveralls: https://coveralls.io/
4143
:uri-setup-emacs: https://github.com/jcs090218/setup-emacs
4244
:uri-setup-eldev: https://github.com/emacs-eldev/setup-eldev
@@ -72,6 +74,7 @@
7274
:since-1-7: image:https://img.shields.io/badge/since-1.7-8be[Since 1.7,float=right]
7375
:since-1-8: image:https://img.shields.io/badge/since-1.8-8be[Since 1.8,float=right]
7476
:since-1-9: image:https://img.shields.io/badge/since-1.9-8be[Since 1.9,float=right]
77+
:since-1-10: image:https://img.shields.io/badge/since-1.10-8be[Since 1.10,float=right]
7578

7679

7780
toc::[]

doc/continuous-integration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Because of Eldev’s trivial installation and built-in support for
55
testing, it is a suitable tool for use on continuous integration
66
servers. But of course this only applies if the test framework your
77
project uses is already supported (currently <<ert,ERT>>,
8-
<<buttercup,Buttercup>> and <<ecukes,Ecukes>>).
8+
<<buttercup,Buttercup>>, <<doctest,Doctest>> and <<ecukes,Ecukes>>).
99

1010
Eldev will even try to make your CI runs <<robust-mode,more
1111
reliable>>.

doc/emacs-versions.adoc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,28 @@ Therefore, if you use byte-compilation and switch Emacs versions,
3838
don’t forget to clean the directory.
3939

4040
[#docker]
41-
=== Using Docker
41+
=== Using Docker or Podman
4242

4343
Alternatively, if you are on a Linux or macOS system and have
44-
{uri-docker}[Docker] installed, you can run arbitrary Eldev commands
45-
within containers based on the images distributed by
46-
{uri-docker-emacs}[docker-emacs]. For example:
44+
{uri-docker}[Docker] or (since 1.10) {uri-podman}[Podman] installed,
45+
you can run arbitrary Eldev commands within containers based on the
46+
images distributed by {uri-docker-emacs}[docker-emacs]. For example:
4747

4848
$ eldev docker 27.2 emacs --eval '(insert (format "Emacs version: %s" emacs-version))'
4949

5050
will start an Emacs 27.2 container and run `eldev emacs --eval
5151
'(insert (format "Emacs version: %s" emacs-version))'` in it.
5252

53+
[#podman]
54+
{since-1-10} Podman, from Eldev’s point of view, works just the
55+
same. There is a special command for it, but it is basically
56+
indistinguishable (except for the name):
57+
58+
$ eldev podman 27.2 emacs --eval '(insert (format "Emacs version: %s" emacs-version))'
59+
5360
NOTE: You may have to run `xhost +local:root` which allows the Docker
54-
container to make connections to the host X server. However, this
55-
does come with some security considerations, see `man xhost`.
61+
(Podman) container to make connections to the host X server. However,
62+
this does come with some security considerations, see `man xhost`.
5663

5764
This command can be used not only to start Emacs of given version, but
5865
to run _any_ Eldev command. For example, run project’s tests on an
@@ -64,20 +71,21 @@ or evaluate something using project’s functions:
6471

6572
$ eldev docker 26.3 eval "(my-project-read-data \"foo.bin\")"
6673

67-
Docker’s output is forwarded to normal Eldev output, however, because
68-
of {uri-emacs-forwarding}[Elisp limitations], it all ends up on
69-
Eldev’s stdout! There might also be unwieldy delays, so that output
70-
doesn’t come smoothly as generated by the process inside Docker, but
71-
instead in larger chunks. Before Eldev 1.2 the output would instead
72-
only appear when Docker has exited.
74+
Docker’s (Podman’s) output is forwarded to normal Eldev output,
75+
however, because of {uri-emacs-forwarding}[Elisp limitations], it all
76+
ends up on Eldev’s stdout! There might also be unwieldy delays, so
77+
that output doesn’t come smoothly as generated by the process inside
78+
Docker, but instead in larger chunks. Before Eldev 1.2 the output
79+
would instead only appear when Docker has exited.
7380

7481
It is also possible to use a custom image. For this, replace Emacs
7582
version argument (26.3 in the last example above) with the full image
7683
name. The image must contain a preinstalled Emacs of a version
7784
supported by Eldev (i.e. 24.4 and up), but not Eldev itself.
7885

7986
Additionally, `docker run` arguments are customisable via the variable
80-
`eldev-docker-run-extra-args`. For example, adding the following to
87+
`eldev-docker-run-extra-args` (and likewise for Podman:
88+
`eldev-podman-run-extra-args`). For example, adding the following to
8189
your project’s `Eldev`:
8290

8391
....

doc/extending-eldev.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ Functions for many of the hooks listed below do receive arguments.
5656
{since-0-2} `eldev-test-FRAMEWORK-hook (SELECTORS)`::
5757

5858
Called immediately before executing tests with given framework
59-
(<<ert,ERT>>, <<buttercup,Buttercup>>, <<ecukes,Ecukes>>).
60-
Functions on the hook get passed `SELECTORS` as the only argument.
61-
At this point project dependencies and additional set `test` will
62-
have been loaded already, so functions can `require` features from
63-
the project.
59+
(<<ert,ERT>>, <<buttercup,Buttercup>>, <<doctest,Doctest>>,
60+
<<ecukes,Ecukes>>). Functions on the hook get passed `SELECTORS`
61+
as the only argument. At this point project dependencies and
62+
additional set `test` will have been loaded already, so functions
63+
can `require` features from the project.
6464

6565
=== Writing builders
6666

doc/loading-modes.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,38 @@ You can always ask Eldev for a full list:
9494

9595
$ eldev --list-modes
9696

97+
[#indirect-builds]
98+
=== Indirect build information
99+
100+
When a loading mode require Eldev to do something in order to prepare
101+
the project or its local dependencies for loading, it tries to do so
102+
silently in that only stderr is normally displayed. The purpose is to
103+
prevent secondary and partially unpredictable (more precisely,
104+
depending on previous builds) output from interfering with normal
105+
output. For example, if you run
106+
107+
$ eldev eval "(some-project-function)"
108+
109+
it might be confusing if the first line of output is instead
110+
111+
ELC some-file.el
112+
113+
if the loading mode is `byte-compiled` and `some-file.elc` doesn’t
114+
exist or is out-of-date. In particular, if such output is then parsed
115+
using some automated tool, this could lead to unexpected errors.
116+
117+
{since-1-10} However, if this is not a concern in your case, you may
118+
want to set variable `eldev-display-indirect-build-stdout` to t. This
119+
is especially useful if your project’s loading mode is `built` and it
120+
involves some custom non-trivial build steps, like e.g. compilation of
121+
a helper non-Elisp program.
122+
123+
Unlike with some other settings, the main project ignores values in
124+
local dependencies. Instead, `eldev-display-indirect-build-stdout` as
125+
defined in the main project affects both the project itself and all
126+
local dependencies at once: only the main project “knows” if it is
127+
important to avoid indirect build output for it or not.
128+
97129
[#source-directory]
98130
=== Project source directory
99131

doc/overview.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Eldev features:
99
* Blends nicely into <<continuous-integration,continuous
1010
integration>> setups.
1111
* Can run on <<different-emacs-versions,different Emacs version>> even
12-
on the same machine; can also use <<docker,Docker>> for that.
12+
on the same machine; can also use <<docker,Docker>> or
13+
<<podman,Podman>> for that.
1314
* There are <<setup-procedure,_four_ levels of configuration>> — you
1415
can customize most aspects of Eldev for your project needs and
1516
personal preferences.

doc/testing.adoc

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
Eldev has built-in support for running regression/unit tests of your
55
project. Currently, Eldev supports {uri-ert}[ERT],
6-
{uri-buttercup}[Buttercup] and {uri-ecukes}[Ecukes] testing
7-
frameworks. Leave a feature request in the issue tracker if you are
8-
interested in a different library.
6+
{uri-buttercup}[Buttercup], {uri-doctest}[Doctest] and
7+
{uri-ecukes}[Ecukes] testing frameworks. Leave a feature request in
8+
the issue tracker if you are interested in a different library.
99

1010
Simply executing
1111

@@ -73,9 +73,9 @@ command `test` work.
7373
`simple`:: Like `standard` with a few Eldev-specific tweaks that I
7474
feel are useful (see `--list-runners` output for details). This is
7575
the default runner.
76-
`concise`:: {since-1-6} Like `simple`, but progress output for ERT and
77-
Buttercup is replaced by a single dot per passing test. Give it a try
78-
to decide if you like that or not.
76+
`concise`:: {since-1-6} Like `simple`, but progress output for ERT,
77+
Buttercup and Doctest is replaced by a single dot per passing test.
78+
Give it a try to decide if you like that or not.
7979

8080
If you always use a different test runner, it is a good idea to set it
8181
as the default in file `~/.config/eldev/config`. Finally, you can
@@ -85,15 +85,16 @@ even write your own runner.
8585
=== Frameworks
8686

8787
As stated above, Eldev supports {uri-ert}[ERT] (Emacs built-in),
88-
{uri-buttercup}[Buttercup] and {uri-ecukes}[Ecukes] testing
89-
frameworks. Normally, you don’t need to specify which framework the
90-
project uses, as the tool can autodetect that. But in rare cases you
91-
may need to set variable `eldev-test-framework` to either `'ert`,
92-
`'buttercup` or `'ecukes`, as appropriate. It is also possible to use
93-
more than one framework in a project, <<multiple-frameworks,see
94-
below>>. You don’t need to declare testing package(s) as
95-
<<additional-dependencies,extra dependencies>>: Eldev will install
96-
them itself when needed.
88+
{uri-buttercup}[Buttercup], {uri-doctest}[Doctest] and
89+
{uri-ecukes}[Ecukes] testing frameworks. With the exception of
90+
Doctest, you don’t need to specify which framework the project uses,
91+
as the tool can autodetect that. But in some cases (for Doctest —
92+
always) you may need to set variable `eldev-test-framework` to either
93+
`'ert`, `'buttercup`, `'doctest` or `'ecukes`, as appropriate. It is
94+
also possible to use more than one framework in a project,
95+
<<multiple-frameworks,see below>>. You don’t need to declare testing
96+
package(s) as <<additional-dependencies,extra dependencies>>: Eldev
97+
will install them itself when needed.
9798

9899
Eldev tries to provide uniform command line interface to the supported
99100
frameworks, but of course there are many differences between them.
@@ -132,6 +133,30 @@ Things that won’t work with Buttercup at the moment:
132133
Unlike <<ert,ERT>>, Buttercup also has no special selectors that base
133134
on the previous run’s results.
134135

136+
[#doctest]
137+
==== Doctest
138+
139+
{since-1-10} {uri-doctest}[Doctest] is a framework that allows you to
140+
embed test expressions into source code, e.g. function documentation.
141+
As a result, your unit tests turn into documentation that your users
142+
can read.
143+
144+
Because the tests are located directly in the source code rather than
145+
in separate files, there is no robust way to autodetect their
146+
presence. For this reason, you must _always_ <<frameworks,declare
147+
that you use this framework>> using variable `eldev-test-framework`.
148+
You can also freely mix it with other tests by employing
149+
<<multiple-frameworks,multiple test frameworks>> in the same project.
150+
151+
Support for Doctest in Eldev is quite limited and many things won’t
152+
work currently:
153+
154+
* the framework has no notion comparable to selectors, so those will
155+
be ignored;
156+
* Doctest doesn’t print failure backtraces, so relevant options have
157+
no effect;
158+
* option `--stop-on-unexpected` is not supported.
159+
135160
[#ecukes]
136161
==== Ecukes
137162

0 commit comments

Comments
 (0)