diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-26 15:55:26 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-26 15:58:27 +0100 |
| commit | 86355a6fd7375f954bf92cb49a14c718610c4d60 (patch) | |
| tree | c9f10c225fe6cec7439343dbc6dbf0e8c973c71e | |
| parent | c2ca0d297b8e067c5e315500fb2f35f50ff6af8a (diff) | |
| download | minishell_test-86355a6fd7375f954bf92cb49a14c718610c4d60.tar.gz minishell_test-86355a6fd7375f954bf92cb49a14c718610c4d60.tar.bz2 minishell_test-86355a6fd7375f954bf92cb49a14c718610c4d60.zip | |
Added command line argument documentation draft
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | docs/index.rst | 6 | ||||
| -rw-r--r-- | docs/options.rst | 69 | ||||
| -rw-r--r-- | minishell_test/config.py | 7 |
4 files changed, 81 insertions, 13 deletions
@@ -1,4 +1,4 @@ -# minishell test [](https://travis-ci.com/cacharle/minishell_test) [](https://pypi.org/project/minishell-test/) +# minishell test [](https://travis-ci.com/cacharle/minishell_test) [](https://pypi.org/project/minishell-test/) [](https://minishell-test.readthedocs.io) Test for the minishell project of school 42. @@ -75,20 +75,20 @@ $ ./minishell -c 'ls' README.md test.sh ``` -With this setup `argv[2]` is what you would usually get in `line` from `get_next_line`. +With this setup `argv[2]` is what you would usually get in `line` from `get_next_line`. This allows you to set the prompt to whatever you want. ### Environement variables -My test only gives the `PATH` and `TERM` environment variables to your minishell. -**Please check that your project still work with those settings before messaging me on Slack or creating an issue**. +My test only gives the `PATH` and `TERM` environment variables to your minishell. +**Please check that your project still work with those settings before messaging me on Slack or creating an issue**. You can test this quickly with the `-t` option (e.g `minishell_test -t 'echo bonjour`). ## Bonus * Force the bonus tests with `$ minishell_test -b` * Change the `BONUS` variable in [config.py](minishell_test/config.py) to True -* Set the environment variable `MINISHELL_TEST_BONUS` to `yes` +* Set the environment variable `MINISHELL_TEST_BONUS` to `yes` (e.g `echo 'export MINISHELL_TEST_BONUS=yes' >> ~/.zshrc`) ## Memory leaks @@ -99,7 +99,7 @@ to select the tests to run since valgrind is really slow. ## Don't check error messages If you don't want to copy bash syntax error message, -you can set the environment variable `MINISHELL_TEST_DONT_CHECK_ERROR_MESSAGE` to `yes`. +you can set the environment variable `MINISHELL_TEST_DONT_CHECK_ERROR_MESSAGE` to `yes`. It will still test your exit status code but will discard any output on error tests. ## Linux diff --git a/docs/index.rst b/docs/index.rst index 109963f..7726f0a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,3 +1,5 @@ +.. program:: minishell_test + minishell_test ============== @@ -72,10 +74,10 @@ Environement variables This test only gives the ``PATH`` and ``TERM`` environment variables to your minishell by default (see :ref:`config env`). -You can test this quickly with the `-t` option (See :ref:`options try`). +You can test this quickly with :option:`--try`. .. warning:: - Please check that your project still work with those settings before creating an issue or messaging me on. + Please check that your project still work with this environment before creating an issue or messaging me on Slack. Bonus ----- diff --git a/docs/options.rst b/docs/options.rst index 56a8c55..7c29529 100644 --- a/docs/options.rst +++ b/docs/options.rst @@ -1,2 +1,71 @@ 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 ...] + +.. 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) + + +.. option:: -h, --help + + show this help message and exit + +.. option:: -p <PATH>, --path <PATH> + + Path to minishell 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) + +.. option:: --show-range + + Show test index (useful with --range) + +.. option:: -x, --exit-first + + Exit on first fail + +.. option:: -v, --verbose + + Increase verbosity level (e.g -vv == 2) + +.. option:: -b, --bonus + + Enable bonus tests + +.. option:: -n, --no-bonus + + Disable bonus tests + +.. option:: -m, --make + + Make minishell and exit + +.. option:: -g, --pager + + After running the test, display the result in a pager of your choice + diff --git a/minishell_test/config.py b/minishell_test/config.py index ac5b3ca..1d471c9 100644 --- a/minishell_test/config.py +++ b/minishell_test/config.py @@ -1,18 +1,15 @@ # ############################################################################ # # # # ::: :::::::: # -# config.py :+: :+: :+: # +# defaults.py :+: :+: :+: # # +:+ +:+ +:+ # # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:19 by charles #+# #+# # -# Updated: 2021/02/24 07:50:26 by cacharle ### ########.fr # +# Updated: 2021/02/26 09:40:07 by cacharle ### ########.fr # # # # ############################################################################ # -################################################################################ -# Minishell configuration file # -################################################################################ import os import shutil |
