aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/config.rst.bak142
-rw-r--r--docs/options.rst28
2 files changed, 22 insertions, 148 deletions
diff --git a/docs/config.rst.bak b/docs/config.rst.bak
deleted file mode 100644
index 9d2c5bc..0000000
--- a/docs/config.rst.bak
+++ /dev/null
@@ -1,142 +0,0 @@
-.. bt in -*- rst -*- mode!
-
-Configuration
-=============
-
-File
-----
-
-The configuration file is named ``minishell_test.cfg`` and should be located at the root of your project.
-
-Here is what the default configuration looks like:
-
-.. include:: ../minishell_test/data/default.cfg
- :code: ini
-
-
-The format of this file is described in more details
-`here <https://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
-
-Global
-------
-
-Global settings are defined under the ``[minishell_test]`` section.
-
-.. conf:: bonus
-
- :type: true|false
-
- Enable the bonus tests (:ref:`bonus`).
-
-.. conf:: make
-
- :type: true|false
-
- Run the ``make`` command in your project directory before the test.
-
-.. conf:: make_args
-
- :type: space separated list
-
- | Argument given to the ``make`` command.
- | The default value (``MINISHELL_TEST_FLAGS=-DMINISHELL_TEST``) allows you to do conditional compilation
- to support both the ``-c`` option and the :ref:`subject`
- (which doesn't say anything about options, so we assumed the minishell executable didn't take any).
-
- | In your ``Makefile`` add ``$(MINISHELL_TEST_FLAGS)`` in your object compilation command.
- (e.g ``$(CC) $(CCFLAGS) -c -o $@ $<``)
-
- | You can then have something resembling the following in your ``main``:
-
- .. code:: c
-
- #ifndef MINISHELL_TEST
- int main(int argc, char **argv)
- {
- if (argc != 1) error;
- ...
- }
- #else
- int main(int argc, char **argv)
- {
- if (argc != 3 && strcmp(argv[1], "-c") == 0) do the thing;
- ...
- }
- #endif
-
-.. conf:: check_error_messages
-
- :type: true|false
-
- | If is ``true``, will ignore the content of the error messages outputed by the reference shell,
- | Usefull if you have implemented your own error messages and don't want to copy bash's ones.
-
-.. conf:: pager
-
- :type: command name
-
- | Pager to use when viewing your results after the tests finished running.
- | Will be called like so: ``{pager} {log_filename}``.
-
-Shell
------
-
-Shell settings are defined under the ``[shell]`` section.
-
-.. conf:: available_commands
-
- :type: multiline list
-
- Commands available in a test.
-
- .. warning::
- Some of the default tests won't serve their purpose
- if the default available commands are not present.
-
-.. conf:: path_variable
-
- :type: string (``:`` separated directories)
-
- ``$PATH`` environment variable passed to the shell.
-
- .. note::
- ``{shell_available_commands_dir}`` will be replaced by the directory
- where the available commands are stored.
-
-Reference
-+++++++++
-
-Reference shell settings are defined under the ``[shell:reference]`` section.
-
-.. conf:: path
-
- :type: path
-
- Path to reference shell, the one to which minishell will be compared.
-
- .. note::
- has to support the ``-c`` option, ``sh``, ``bash`` and ``zsh`` support it.
-
-.. conf:: args
-
- :type: space separated list
-
- | Supplementary arguments to the reference shell.
- | e.g ``--posix`` can be used with bash for a more posix complient behavior.
-
-Timeout
--------
-
-Timeout settings are defined under the ``[timeout]`` section.
-
-.. conf:: test
-
- :type: float (seconds)
-
- Time before a timeout occurs on a regular test.
-
-.. conf:: leaks
-
- :type: float (seconds)
-
- Time before a timeout occurs on a leak test (with valgrind).
diff --git a/docs/options.rst b/docs/options.rst
index 7a294b5..dd524d9 100644
--- a/docs/options.rst
+++ b/docs/options.rst
@@ -13,8 +13,26 @@ Command line Options
| 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
+ .. code-block::
+
+ $ minishell_test -p ../../minishell inter
+ ########################### preprocess/interpolation ###########################
+ [EXPORTS TEST='bonjour'] echo $TEST [PASS]
+ [EXPORTS TEST='bonjour'] echo $TES [PASS]
+ [EXPORTS TEST='bonjour'] echo $TEST_ [PASS]
+ [EXPORTS TEST='bonjour'] echo "|$TEST|" [PASS]
+ [EXPORTS TEST='bonjour'] echo "|$TES|" [PASS]
+ [EXPORTS TEST='bonjour'] echo "|$TEST_|" [PASS]
+ [EXPORTS TEST='bonjour'] echo '|$TEST|' [PASS]
+ [EXPORTS TEST='bonjour'] echo '|$TES|' [PASS]
+ [EXPORTS TEST='bonjour'] echo '|$TEST_|' [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo $A$B$C [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo "$A$B$C" [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo '$A$B$C' [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo $A,$B,$C [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo "$A,$B,$C" [PASS]
+ [EXPORTS A='foo' B='bar' C='baz'] echo '$A,$B,$C' [PASS]
+ ...
.. option:: -h, --help
@@ -33,10 +51,8 @@ Command line Options
.. 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)
-
- .. command-output:: minishell_test -p ../../minishell --try 'echo bonjour | cat -e'
+ | Run a custom command like the test would,
+ | the only environment variable passed to your executable are ``TERM`` and ``PATH``.
.. option:: -g, --pager