Menu

Tree [1cc92e] main /
 History

HTTPS access


File Date Author Commit
 .github 2025-09-13 Colin B. Macdonald Colin B. Macdonald [bf59fd] CI: smaller apt installs with --no-install-reco...
 inst 2025-09-13 Colin B. Macdonald Colin B. Macdonald [95115b] Post-release version bump
 test 2025-09-13 Colin B. Macdonald Colin B. Macdonald [6e5b77] only test classdef delete stuff on OCtave >= 9
 test_extra 2024-03-02 Colin B. Macdonald Colin B. Macdonald [4a373e] Don't put .m on the end of things we're testing
 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 2025-09-13 Colin B. Macdonald Colin B. Macdonald [95115b] Post-release version bump
 INDEX 2015-07-10 Michael Walter Michael Walter [a5239b] Added explicit INDEX file.
 Makefile 2025-09-13 Colin B. Macdonald Colin B. Macdonald [1cc92e] Makefile: compute sha256sum as well
 NEWS 2025-09-13 Colin B. Macdonald Colin B. Macdonald [95115b] Post-release version bump
 README.matlab.md 2015-05-12 Colin B. Macdonald Colin B. Macdonald [b2dfbc] Add Matlab-specific readme file
 README.md 2024-05-28 Colin B. Macdonald Colin B. Macdonald [09de43] Update URLs
 io.github.gnu_octave.doctest.metainfo.xml 2024-03-05 Colin B. Macdonald Colin B. Macdonald [fbd985] metainfo: The Octave Community

Read Me

Doctest

The Octave 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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.