Metadata-Version: 2.1
Name: sphinxcontrib-shtest
Version: 0.1
Description-Content-Type: text/x-rst

🧪 shtest
=========

shtest tests shell commands in your Sphinx documentation. The :code:`shtest` directive supports the usual `doctest <https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html>`_ syntax. It offers two options: specifying the expected return code (defaults to 0) and choosing the stream to compare with (defaults to stdout).

Examples
--------

.. code-block::


    # Obligatory hello world example.
    $ echo hello world
    hello world

.. code-block::

    :stream: stderr

    # Read from stderr instead of stdout.
    $ echo message on stderr >&2
    message on stderr

.. code-block::

    :returncode: 1

    # Use a non-zero expected return code.
    $ false

.. code-block::


    # Run multiple tests in one directive.
    $ echo hello
    hello
    $ echo world
    world

Installation
------------

Run :code:`pip install sphinxcontrib-shtest` to install the package and add :code:`"sphinxcontrib-shtest"` to your :code:`extensions` list in :code:`conf.py` (see `here <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-extensions>`__ for details). Then execute :code:`sphinx-build -b shtest /path/to/source/directory /path/to/output/directory`.
