Menu

Tree [eb9429] main /
 History

HTTPS access


File Date Author Commit
 .github 2023-03-17 Colin B. Macdonald Colin B. Macdonald [6ad4f8] CI: always apt-get update before installing
 inst 2023-01-05 Colin B. Macdonald Colin B. Macdonald [27f2d8] Update URLs for repo change
 test 2023-01-05 Colin B. Macdonald Colin B. Macdonald [bc28ce] tests: update links to new repo
 test_extra 2023-01-02 Colin B. Macdonald Colin B. Macdonald [e837e9] Run tests on Matlab
 util 2022-07-11 Colin B. Macdonald Colin B. Macdonald [fe6925] More .oct-config files
 .gitignore 2019-01-22 Colin B. Macdonald Colin B. Macdonald [02e92a] [maint] more files to ignore
 .mailmap 2016-11-14 Colin B. Macdonald Colin B. Macdonald [f68743] [maint] add a mailmap file for git
 CONTRIBUTORS 2023-01-05 Colin B. Macdonald Colin B. Macdonald [018b11] Update contributors
 COPYING 2015-05-10 Colin B. Macdonald Colin B. Macdonald [9b1908] License: reformat/minor rewording to Modified B...
 DESCRIPTION 2023-01-03 Colin B. Macdonald Colin B. Macdonald [7ad4cb] Postrelease version bump
 INDEX 2015-07-10 Michael Walter Michael Walter [a5239b] Added explicit INDEX file.
 Makefile 2023-01-05 Colin B. Macdonald Colin B. Macdonald [2e1067] Update copyright
 NEWS 2023-03-18 Colin B. Macdonald Colin B. Macdonald [ae617a] Small change to force CI
 README.matlab.md 2015-05-12 Colin B. Macdonald Colin B. Macdonald [b2dfbc] Add Matlab-specific readme file
 README.md 2023-01-05 Colin B. Macdonald Colin B. Macdonald [27f2d8] Update URLs for repo change
 io.github.gnu_octave.doctest.metainfo.xml 2023-07-23 Colin B. Macdonald Colin B. Macdonald [dd599a] metainfo: just doctest, not octave doctest

Read Me

Doctest

The Octave-Forge Doctest package finds specially-formatted blocks of example code within documentation files.
It then executes the code and confirms the output is correct.
This can be useful as part of a testing framework or simply to ensure that documentation stays up-to-date during software development.

To get started, here is a simple example:

function greet(user)
  % Returns a greeting.
  %
  % >> greet World
  %
  % Hello, World!

  disp(['Hello, ' user '!']);

end

We can test it by invoking doctest greet at the Octave prompt, which will give the following output:

greet .................................................. PASS    1/1

Summary:

   PASS    1/1

1/1 targets passed, 0 without tests.

Doctest also supports Texinfo markup, which is popular in the Octave world, and it provides various toggles and switches for customizing its behavior.
The Doctest documentation contains information on all this.
Quite appropriately, Doctest can test its own documentation.
We also maintain a list of software that is using Doctest.