aboutsummaryrefslogtreecommitdiff
path: root/docs/options.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/options.rst')
-rw-r--r--docs/options.rst70
1 files changed, 34 insertions, 36 deletions
diff --git a/docs/options.rst b/docs/options.rst
index 7c29529..7a294b5 100644
--- a/docs/options.rst
+++ b/docs/options.rst
@@ -1,71 +1,69 @@
Command line Options
====================
-.. code-block:: txt
-
- usage: minishell_test [-h] [-p PATH] [-l] [-t COMMAND] [-k] [-r BEGIN END]
- [--show-range] [-x] [-v] [-b] [-n] [-m] [-g]
- [suite ...]
+.. command-output:: minishell_test --help
+ :ellipsis: 3
.. program:: minishell_test
.. option:: suite
- Test suites/group to run.
- It tries to be smart and autocomplete the suite name
- (e.g ./run int -> ./run preprocess/interpolation)
+ | Select the test suites/group to run.
+ | It tries to be smart and autocomplete the suite name,
+ | e.g ``$ minishell_test int`` -> ``$ minishell_test preprocess/interpolation``.
+ | See :option:`--list` to list the available suites.
+ .. command-output:: minishell_test -p ../../minishell inter
+ :ellipsis: 20
.. option:: -h, --help
- show this help message and exit
+ Print usage and exit.
.. option:: -p <PATH>, --path <PATH>
- Path to minishell directory
+ Path to the minishell directory, defaults to the current directory.
.. option:: -l, --list
Print available test suites
-.. option:: -t <COMMAND>, --try <COMMAND>
-
- Run a custom command like this test would
- (the only environment variable passed to your executable are TERM and PATH)
-
-.. option:: -k, --check-leaks
-
- Run valgrind on tests (disable usual comparison with bash)
-
-.. option:: -r <BEGIN> <END>, --range <BEGIN> <END>
-
- Range of test index to run (imply --show-index)
+ .. command-output:: minishell_test --list
+ :ellipsis: 15
-.. option:: --show-range
+.. option:: -t <COMMAND>, --try <COMMAND>
- Show test index (useful with --range)
+ | Run a custom command like this test would
+ | (the only environment variable passed to your executable are TERM and PATH)
-.. option:: -x, --exit-first
+ .. command-output:: minishell_test -p ../../minishell --try 'echo bonjour | cat -e'
- Exit on first fail
+.. option:: -g, --pager
-.. option:: -v, --verbose
+ After running the test, display the result in a pager of your choice, see :ref:`pager configuration <config-pager>`.
- Increase verbosity level (e.g -vv == 2)
+Memory Leaks
+------------
-.. option:: -b, --bonus
+.. option:: -k, --check-leaks
- Enable bonus tests
+ | Runs `valgrind <https://valgrind.org/>`_ on tests to check for memory leaks.
+ | (disable the usual comparison with the :ref:`reference shell <config-shell-reference-path>`)
-.. option:: -n, --no-bonus
+ .. warning::
+ | Running ``valgrind`` on each tests may take a while especially if your ``minishell`` isn't correctly optimized,
+ | See the :ref:`leaks timeout <config-timeout-leaks>` configuration variable to change the leak tests timeout.
- Disable bonus tests
+.. option:: -r <BEGIN> <END>, --range <BEGIN> <END>
-.. option:: -m, --make
+ | Only run the test in the selected range,
+ | ``<BEGIN>`` and ``<END>`` must be test indices.
- Make minishell and exit
+.. option:: --show-range
-.. option:: -g, --pager
+ | Show the tests indices.
+ | Both :option:`--check-leaks` and :option:`--range` imply this option.
- After running the test, display the result in a pager of your choice
+.. option:: -x, --exit-first
+ Immediately stops when a test fails.