33
44Eldev has built-in support for running regression/unit tests of your
55project. 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
1010Simply executing
1111
@@ -73,9 +73,9 @@ command `test` work.
7373`simple`:: Like `standard` with a few Eldev-specific tweaks that I
7474feel are useful (see `--list-runners` output for details). This is
7575the 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
8080If you always use a different test runner, it is a good idea to set it
8181as the default in file `~/.config/eldev/config`. Finally, you can
@@ -85,15 +85,16 @@ even write your own runner.
8585=== Frameworks
8686
8787As 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
9899Eldev tries to provide uniform command line interface to the supported
99100frameworks, but of course there are many differences between them.
@@ -132,6 +133,30 @@ Things that won’t work with Buttercup at the moment:
132133Unlike <<ert,ERT>>, Buttercup also has no special selectors that base
133134on 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