Command line Options
$ minishell_test --help
usage: minishell_test [-h] [-p PATH] [-l] [-t COMMAND] [-k] [-r BEGIN END]
[--show-range] [-x] [-m] [-g]
[SUITE [SUITE ...]]
...
- suite
- Select the test suites/group to run.It tries to be smart and autocomplete the suite name,e.g
$ minishell_test int->$ minishell_test preprocess/interpolation.See--listto list the available suites.$ 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] ...
- -h, --help
Print usage and exit.
- -p <PATH>, --path <PATH>
Path to the minishell directory, defaults to the current directory.
- -l, --list
Print available test suites
$ minishell_test --list Groups: - builtin - path - flow - cmd - misc - preprocess The available suites are: - path/path ................... searching a command in the path tests - path/path_variable .......... $PATH environment variable tests - cmd/redirection ............. append/write/read redirections - cmd/cmd ..................... long cmd, cmd not found tests - cmd/status .................. $? tests - cmd/cmd_path ................ cmd is a relative path, permissions on executable - flow/end .................... `;` tests - flow/pipe ................... `|` tests - flow/and .................... `&&` tests - flow/or ..................... `||` tests - flow/parenthesis ............ `(`, `)` tests - flow/syntax_error ........... separator syntax error test - flow/syntax_error_bonus ..... separator syntax error bonus test - builtin/echo ................ echo builtin tests - builtin/export .............. export builtin tests - builtin/cd .................. cd builtin tests - builtin/unset ............... unset builtin tests - builtin/pwd ................. pwd builtin tests - builtin/env ................. env builtin tests - builtin/exit ................ exit builtin tests - misc/shlvl .................. test for the SHLVL variable - misc/lastcmd ................ test for $_, the last executed command - preprocess/quote ............ double and single quote test, escape in quotes, quote missmatch - preprocess/interpolation .... environment variable interpolation tests, valid name, escape in variable - preprocess/escape ........... escape test, in command, with space, before quote - preprocess/spaces ........... field splitting with spaces and tabs
- -t <COMMAND>, --try <COMMAND>
- Run a custom command like the test would,the only environment variable passed to your executable are
TERMandPATH.
- -g, --pager
After running the test, display the result in a pager of your choice, see pager configuration.
Memory Leaks
- -k, --check-leaks
- Runs valgrind on tests to check for memory leaks.(disable the usual comparison with the Reference Shell)
Warning
Runningvalgrindon each tests may take a while especially if yourminishellisn’t correctly optimized,See the leaks timeout configuration variable to change the leak tests timeout.
- -r <BEGIN> <END>, --range <BEGIN> <END>
- Only run the test in the selected range,
<BEGIN>and<END>must be test indices.
- --show-range
- Show the tests indices.Both
--check-leaksand--rangeimply this option.
- -x, --exit-first
Immediately stops when a test fails.