aboutsummaryrefslogtreecommitdiff
path: root/docs/config.rst
blob: a8933d5f36e4dad6c6086454fdddf73ff3bb93d5 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.. bt in -*- rst -*- mode!

Configuration
=============

Configuration file
------------------

It looks for a ``minishell_test.cfg`` file in your project directory.

Here is what the default configuration looks like:

.. code-block:: cfg

   .. include:: ../minishell_test/data/default.cfg

Format used for the configuration file:

https://docs.python.org/3/library/configparser.html#supported-ini-file-structure

Global
------

Global settings are defined under the ``minishell_test`` section:

.. code-block:: cfg

   [minishell_test]
   bonus = true

.. conf:: bonus

   :type: true|false
   :default: false

    Run the bonus tests

.. conf:: exec_name

   :type: PATH
   :default: minishell

    Minishell executable name

.. conf:: make

   :type: true|false
   :default: true

    Run ``make`` in your project directory before the test

.. conf:: pager

   :type: NAME
   :default: less

    Pager to use when viewing your results

.. conf:: log_path

   :type: PATH
   :default: minishell_test.log

    File where to put the test results

.. conf:: cache_path

   :type: PATH
   :default: $XDG_CACHE_HOME/minishell_test ^ ~/.cache/minishell_test


Shell
-----

Shell settings are defined under the ``shell`` section:

.. code-block:: cfg

   [shell]
   available_commands = ls,cat

.. conf:: available_commands

   :type: LIST
   :default: rmdir env cat touch ls grep sh head

    Commands available in test

.. conf:: path_variable

   :type: LIST
   :default: {cache:executables_path}

    ``$PATH`` environment variable passed to the shell

Reference
+++++++++

Reference shell settings are defined under the ``shell:reference`` section:

.. code-block:: cfg

   [shell:reference]
   path = /bin/sh

.. conf:: path

   :type: PATH
   :default: /bin/bash

    Path to reference shell (shell which will be compared minishell)
    has to support the ``-c`` option (``sh``, ``bash`` and ``zsh`` support it)

.. conf:: args

   :type: ARGV

   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:

.. code-block:: cfg

   [timeout]
   leaks = 60

.. conf:: test

   :type: FLOAT
   :default: 0.5

   Time before a timeout occurs on a regular test (in seconds)

.. conf:: leaks

   :type: FLOAT
   :default: 10

   Time before a timeout occurs on a leak test (with valgrind) (in seconds)