aboutsummaryrefslogtreecommitdiff
path: root/docs/index.rst
blob: 7726f0a1afa4f56f15ecd23aff3102c7a7b71a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.. program:: minishell_test

minishell_test
==============

Test for 42 school's minishell project.

.. .. image:: https://i.imgur.com/98xh2xY.gif

Getting Started
---------------

Installation
++++++++++++

.. code-block::

    $ pip3 install minishell-test
    $ pip3 install --user minishell-test  # if you don't have root access

Compatibility
+++++++++++++

Your executable **must** support the ``-c`` option which allow to pass command as string.

.. code-block::

    $ bash -c 'echo bonjour je suis | cat -e'
    bonjour je suis$
    $ ./minishell -c 'echo bonjour je suis | cat -e'
    bonjour je suis$


.. note::
    With this setup ``argv[2]`` is what you would usually get in ``line`` from ``get_next_line``.

Usage
+++++

Run all the predefined tests:

.. code-block::

    $ cd <MINISHELL>
    $ minishell_test

.. warning::
    If you get ``command not found``, do either of those things:

    * ``~/.local/bin`` to your ``PATH`` environment variable.
    * run ``$ python3 -m minishell_test`` instead of ``$ minishell_test``


Documentation
-------------

.. toctree::
   :maxdepth: 2

   config
   options
   developers


.. code-block::

    $ minishell_test --help

The options are explained in more details in :ref:`options <options>`.


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 :option:`--try`.

.. warning::
    Please check that your project still work with this environment before creating an issue or messaging me on Slack.

Bonus
-----

See :ref:`config bonus`
See :ref:`options bonus`

Memory leaks
------------

See :ref:`options leaks`

Linux
-----

It will try to convert to output/status code of ``bash`` on Linux to the one on Mac.