Skip to content

Unit test for the mandatory part of minishell (42cursus project)

Notifications You must be signed in to change notification settings

martingarcialopez/minishell_unit_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

minishell_unit_test

Unit test for the mandatory part of minishell (42cursus project)


Prerequisites

Your executable must support the -c option, which allows you to pass commands as a string (man bash)

Installation

  • Clone this repository at the root of your minishell project

Usage

./unit_test.sh inside this repository

  • Options

    --no-error or -n Does not test the stderr output, which is tested by default


    You can run tests of a given section by doing:

    --<test_section_name> e.g. --builtins Only errors in these tests will be written in the log file. Note that you can combine them

    ./unit_test.sh --n --builtins --quotes

    will only run the builtins and quotes tests and won't test the stderr output


    --help or -h Shows the script usage, mainly the names of each test section and its abreviation

Behaviour

  • For each test, stdout and stderr of your minishell and real bash will be compared, along with their return codes. For a test to be passed, you need to have the same return code of bash, as well as the same output in the stdout.

  • If the stderr differs, you will see [FAIL] on the stderr column, but that won't affect the previous result of the test. If the stderr is empty or if it doesn't differs, stderr column will be empty.

About

Unit test for the mandatory part of minishell (42cursus project)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages