-
Notifications
You must be signed in to change notification settings - Fork 0
Adding new tests
Ferdinand Ratajczak edited this page Feb 13, 2020
·
1 revision
A test file consists of multiple tests that relate to one part of the shell (e.g cd, pipe, redir...),
they are basically shell scripts consisting of a list of commands.
Each test file is ran like so when you run test.sh: ./42sh test_file.test.
The output of ./42sh test_file.test is then compared with:
- the output of
bash test_file.testif the test file is intests/bash_tests/ - a predetermined output file
test_name.rightthat you need to modify or create manually if the test file is intests/fixed_tests/
The basic format for a test is as follows:
echo "command ran in the test or a description if the command is too long"
one or multiple commands
echo "~~~"
~~~ is used as a separator to split the output into multiple files in order to diff on each individual test.