From 2ae77423200364d3fb6c1823e4ddfb7542c834fb Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 1 Mar 2021 12:39:52 +0100 Subject: Added bonus doc, Updated command line options doc --- docs/options.rst | 70 +++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'docs/options.rst') 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 to minishell directory + Path to the minishell directory, defaults to the current directory. .. option:: -l, --list Print available test suites -.. option:: -t , --try - - 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 , --range - - Range of test index to run (imply --show-index) + .. command-output:: minishell_test --list + :ellipsis: 15 -.. option:: --show-range +.. option:: -t , --try - 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 `. - Increase verbosity level (e.g -vv == 2) +Memory Leaks +------------ -.. option:: -b, --bonus +.. option:: -k, --check-leaks - Enable bonus tests + | Runs `valgrind `_ on tests to check for memory leaks. + | (disable the usual comparison with the :ref:`reference shell `) -.. 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 ` configuration variable to change the leak tests timeout. - Disable bonus tests +.. option:: -r , --range -.. option:: -m, --make + | Only run the test in the selected range, + | ```` and ```` 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. -- cgit