Clone this repo in your minishell folder by using this command :
git clone [email protected]:paulogarithm/MinishellTesting.git
You should now have something like this
[minishell] $ ls
lib Makefile src
[minishell] $ git clone [email protected]:paulogarithm/MinishellTesting.git
...
[minishell] $ ls
lib Makefile MinishellTesting src
To run the tests, simply do ./MinishellTesting/run.
To made your own test, you can configure the commands.txt's file in the config folder.
./MinishellTesting/config/commands.txt
Basically, your commands.txt's file should look like this :
:: This is a comment
>>> Cathegory
> Test 1
Command
> Test 2
Command
>>> End
The way the line will be executed is as follow :
Command | Terminal
Terminal is replaced by tcsh and ./mysh.
Then the result of both function are compared.
After all the tests are passed, you get a resume of all cathegories and an overall one.
75% [===============> ] Cathegory 1
25% [=====> ] Cathegory 2
50% [==========> ] Overall
You can also add sub-commands to your tests.
Basically, it will execute this command after the pipe but before the terminal command :
Command | Subcommand Terminal
To add them in your test, you can use the $ sign followed by a space like this in your commands.txt's file.
> Test
$ Subcommand
Command