Basic syntax of minishell changed, from now on to start an interactive shell, we have to ./minishell --interactive, to run one command we have to ./minishell --command echo hello world etc.
Target change: now the executable has a numeric parameter trap that fails exactly one malloc. This way we can verify that the program exits gracefully wherever a failure happens.
Side effect: when building with make fulltest (which includes make vania_trapped), an additional line is printed in the end of the program, which states the total amount of calls of ft_calloc_if
To verify:
./minishell --trap 0 --command MOCK_0 no effect, output is still as if there were no trap argument
hello world
Total ft_calloc_calls: 30
./minishell --trap 23 --command MOCK_0 23 and up to 30 - segmentation fault. This means that we don't have enough protection in the program. Fixing those segfaults will be a separate task.
./minishell --trap 31 --command MOCK_0 no effect, ft_calloc_if is called only 30 times
automatic iteration through those values will also be introduced separately
make fulltest
./minishell --interactive
, to run one command we have to./minishell --command echo hello world
etc.trap
that fails exactly one malloc. This way we can verify that the program exits gracefully wherever a failure happens.make fulltest
(which includesmake vania_trapped
), an additional line is printed in the end of the program, which states the total amount of calls offt_calloc_if
To verify:
./minishell --trap 0 --command MOCK_0
no effect, output is still as if there were no trap argument./minishell --trap 23 --command MOCK_0
23 and up to 30 - segmentation fault. This means that we don't have enough protection in the program. Fixing those segfaults will be a separate task../minishell --trap 31 --command MOCK_0
no effect, ft_calloc_if is called only 30 timesautomatic iteration through those values will also be introduced separately