π‘ Test cases are slightly outdated (and too harsh). I recommend using this script as a starting point, while editing test cases to match your subject version. Feel free to contribute!
The goal is to make your own shell
If it moves like bash,
If it doesn't crash
It's a beautiful, one and only, minishell.
-
Make sure your prompt and error messages are written to
stderr
, like in bash. -
git clone this repo into your project root and run check.sh.
-
check.sh will run
make -C $SHELL_PATH
with a default path of../
.
It might help if you have a rule like this in your Makefile:
check:
@cd minishell-helper && bash check.sh
./check.sh
runs all tests./check.sh [echo, cd, pwd, export, unset, env, exit]
runs builtin command tests./check.sh [mytest.txt]
runs commandlines from a custom text file