case loop no more leaks
This commit is contained in:
parent
6569be04bb
commit
b2615bc266
14 changed files with 200 additions and 3049 deletions
235
42sh/21sh_error
235
42sh/21sh_error
|
|
@ -1,235 +0,0 @@
|
||||||
[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/misc/002-simple-command-line[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -rf "./size"
|
|
||||||
02: rm -rf "TOKEN201703241734"
|
|
||||||
03: echo '^'$(echo TOKEN201703241734_FILE_TOKEN201703241734_STDOUT | wc -c)'$' > "./size"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: mkdir TOKEN201703241734 ; cd TOKEN201703241734 ; touch TOKEN201703241734_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703241734_STDOUT ; cat TOKEN201703241734_STDOUT[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `TOKEN201703241734_FILE$`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to match_each_regex_of_file `./size`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_FILE
|
|
||||||
02: 98839 redirect_great.c 24 3 1
|
|
||||||
03: 23[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/001-creates-file-if-not-exits[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The right redirection `>` opens the file with the oflag `O_CREAT` so that the file is created if it does not exists.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f new_file[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout TOKEN201703241734 >new_file[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734`[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241734`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file` with_nb_of_lines `1`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/002-truncates-file-if-exists[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The right redirection `>` opens the file with the oflag `O_TRUNC` so that the file size is truncated to 0 before writing in it.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: ./write_on_stdout TOKEN201703241734_first >truncated_file[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout TOKEN201703241734_second >truncated_file[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex TOKEN201703241734_second[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file `truncated_file` matching_regex `TOKEN201703241734_second`[0m
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file `truncated_file` not_matching_regex `TOKEN201703241734_first`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `truncated_file` with_nb_of_lines `1`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/003-whitespace-before-filename[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The file name for a right redirection can be specified closely to the character `>` or in a separated field.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "new_file"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout TOKEN201703241734 > new_file[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734`[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241734`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file` with_nb_of_lines `1`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/multiple/004-together[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "new_file_stderr_and_stdout"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703241734_1 TOKEN201703241734_2 &>new_file_stderr_and_stdout[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703241734_1`[0m
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734_2`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_1[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734_1`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703241734_2`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_2[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_1$`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_2$`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
|
|
||||||
In this test, we specify the file name in a separate field.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f new_file_stderr_and_stdout[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703241734_1 TOKEN201703241734_2 &> new_file_stderr_and_stdout[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703241734_1`[0m
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734_2`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_1[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734_1`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703241734_2`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_2[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_1$`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_2$`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/stderr/001-works[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that redirecting the standard error STDERR to a file `2>` works. In this test, the binary writes a token on each standard and error output, so that only the STDOUT is outputted and STDERR is written in a file `new_file_stderr`.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "./new_file_stderr"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703241734_STDOUT TOKEN201703241734_STDERR 2>new_file_stderr[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `TOKEN201703241734_STDOUT`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703241734_STDOUT[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703241734_STDERR`[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file `new_file_stderr` matching_regex `TOKEN201703241734_STDERR`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr` with_nb_of_lines 1[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check if '1>' redirect STDIN to a file.
|
|
||||||
We are using echo with one argument. The output should NOT return anything on the standard output.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f new_file[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: /bin/echo TOKEN1 1>new_file[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not match_regex TOKEN1[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to create_file new_file matching_regex TOKEN1[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to create_file new_file with_nb_of_lines 1[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1m21sh/separators/semicolon/003-parse-error-empty-inline-command[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error.[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./write_on_stdout TOKEN201703241734 ; ; ./exit_with_status 42[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
|
||||||
[31m[38;5;34m SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error`[0m
|
|
||||||
[38;5;239m 01: syntax error near unexpected token `;'[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not exit_with_status `42`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to_not exit_with_status `0`[0m
|
|
||||||
|
|
||||||
Total tests: 36
|
|
||||||
Total failed tests: 9
|
|
||||||
Total pending tests: 0
|
|
||||||
10
42sh/42ShellTester/file
Normal file
10
42sh/42ShellTester/file
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
42ShellTester.sh
|
||||||
|
README.md
|
||||||
|
file
|
||||||
|
lib
|
||||||
|
log
|
||||||
|
minishell_error
|
||||||
|
spec
|
||||||
|
support
|
||||||
|
tasks
|
||||||
|
tmp
|
||||||
|
|
@ -1,116 +1,25 @@
|
||||||
[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[1;33m~[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m
|
[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;34m.[0m[31m[38;5;160mx[0m[31m[38;5;34m.[0m
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
[37;1mminishell/binary/004-binary-test-empty-path[0m [31m[38;5;160m(FAILED)[0m
|
[37;1m21sh/misc/002-simple-command-line[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
[38;5;239m The purpose of this test is to check that the Shell finds binaries that are located in the current directory when the environment variable PATH is empty.[0m
|
[38;5;239m The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`.[0m
|
||||||
|
|
||||||
Before test:
|
Before test:
|
||||||
[38;5;239m 01: export PATH=""[0m
|
[38;5;239m 01: rm -rf "./size"
|
||||||
|
02: rm -rf "TOKEN201703270303"
|
||||||
|
03: echo '^'$(echo TOKEN201703270303_FILE_TOKEN201703270303_STDOUT | wc -c)'$' > "./size"[0m
|
||||||
|
|
||||||
STDIN:
|
STDIN:
|
||||||
[38;5;239m 01: write_on_stdout "TOKEN201703252056"[0m
|
[38;5;239m 01: mkdir TOKEN201703270303 ; cd TOKEN201703270303 ; touch TOKEN201703270303_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703270303_STDOUT ; cat TOKEN201703270303_STDOUT[0m
|
||||||
|
|
||||||
STDOUT:
|
STDOUT:
|
||||||
[31m[38;5;160m FAILURE expected_to match_regex `TOKEN201703252056`[0m
|
[31m[38;5;34m SUCCESS expected_to match_regex `TOKEN201703270303_FILE$`[0m
|
||||||
[38;5;239m (no output)[0m
|
[31m[38;5;160m FAILURE expected_to match_each_regex_of_file `./size`[0m
|
||||||
|
[38;5;239m 01: TOKEN201703270303_FILE
|
||||||
STDERR:
|
02: 23[0m
|
||||||
[31m[38;5;160m FAILURE expected_to be_empty[0m
|
|
||||||
[38;5;239m 01: ../../42sh: command not found: write_on_stdout[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;160m FAILURE expected_to exit_with_status `0`[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/binary/008-binary-too-many-symbolic-links-encountered[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that trying to execute a path that encounters an infinite loop of symbolic link results in an error on standard error and a failure exit status.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -rf ./symbolic_link1 ./symbolic_link2 ./symbolic_link3
|
|
||||||
02: ln -s ./symbolic_link1 ./symbolic_link2
|
|
||||||
03: ln -s ./symbolic_link2 ./symbolic_link3
|
|
||||||
04: ln -s ./symbolic_link3 ./symbolic_link1[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: ./symbolic_link1[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS might be_empty[0m
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
|
||||||
[31m[1;33m WARNING might match_regex `[Tt]oo many.*symbolic links`[0m
|
|
||||||
[38;5;239m 01: ../../42sh: ./symbolic_link1: no such file or directory[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not exit_with_status 0[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/builtins/cd/007-symbolic-link[0m [31m[38;5;160m(FAILED)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving the linked directory.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "./symbolic_link"
|
|
||||||
02: mkdir -p "./sub_directory"
|
|
||||||
03: ln -s "./sub_directory" "./symbolic_link"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: cd symbolic_link
|
|
||||||
02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd
|
|
||||||
03: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_env[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD$`[0m
|
|
||||||
[31m[38;5;160m FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/symbolic_link$`[0m
|
|
||||||
[38;5;239m 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD
|
|
||||||
02: ------------------------------
|
|
||||||
03: TERM_PROGRAM=iTerm.app
|
|
||||||
04: TERM=screen-256color
|
|
||||||
05: SHELL=/bin/zsh
|
|
||||||
06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp
|
|
||||||
07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/
|
|
||||||
08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.h7gvN9K1go/Render
|
|
||||||
09: TERM_PROGRAM_VERSION=3.0.10
|
|
||||||
10: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
11: ZSH=/Users/ariard/.oh-my-zsh
|
|
||||||
12: USER=ariard
|
|
||||||
13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners
|
|
||||||
14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0
|
|
||||||
15: PAGER=less
|
|
||||||
16: TMUX=/private/tmp/tmux-18965/default,23758,2
|
|
||||||
17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches
|
|
||||||
18: LSCOLORS=Gxfxcxdxbxegedabagacad
|
|
||||||
19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin
|
|
||||||
20: MAIL=ariard@student.42.fr
|
|
||||||
21: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory
|
|
||||||
22: LANG=en_US.UTF-8
|
|
||||||
23: ITERM_PROFILE=Default
|
|
||||||
24: XPC_FLAGS=0x0
|
|
||||||
25: TMUX_PANE=%21
|
|
||||||
26: XPC_SERVICE_NAME=0
|
|
||||||
27: SHLVL=4
|
|
||||||
28: HOME=/Users/ariard
|
|
||||||
29: COLORFGBG=7;0
|
|
||||||
30: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
31: LOGNAME=ariard
|
|
||||||
32: LESS=-R
|
|
||||||
33: LC_CTYPE=en_US.UTF-8
|
|
||||||
34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/
|
|
||||||
35: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester/tmp
|
|
||||||
36: _=../../42sh
|
|
||||||
37: ?=0
|
|
||||||
38: ------------------------------
|
|
||||||
39: TOTAL ENVIRONMENT VARIABLES: 35[0m
|
|
||||||
|
|
||||||
STDERR:
|
STDERR:
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
||||||
|
|
@ -118,229 +27,138 @@
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
[37;1mminishell/builtins/cd/008-symbolic-link-2[0m [31m[38;5;160m(FAILED)[0m
|
[37;1m21sh/redirections/outputs/truncating/multiple/002-together-stdout-first[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
[38;5;239m The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving to the linked directory. In this test, the directory is linked with to chained symbolic links.[0m
|
[38;5;239m A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
|
||||||
|
In this test the standard output is specified first.[0m
|
||||||
|
|
||||||
Before test:
|
Before test:
|
||||||
[38;5;239m 01: rm -f "./symbolic_link1" "./symbolic_link2"
|
[38;5;239m 01: rm -f new_file_stderr_and_stdout[0m
|
||||||
02: mkdir -p "./sub_directory"
|
|
||||||
03: ln -s "./sub_directory" "./symbolic_link1"
|
|
||||||
04: ln -s "./symbolic_link1" "./symbolic_link2"[0m
|
|
||||||
|
|
||||||
STDIN:
|
STDIN:
|
||||||
[38;5;239m 01: cd symbolic_link2
|
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 1>new_file_stderr_and_stdout 2>&1[0m
|
||||||
02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd
|
|
||||||
03: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_env[0m
|
|
||||||
|
|
||||||
STDOUT:
|
STDOUT:
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD$`[0m
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
[31m[38;5;160m FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/symbolic_link2$`[0m
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
[38;5;239m 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD
|
[38;5;239m (no output)[0m
|
||||||
02: ------------------------------
|
|
||||||
03: TERM_PROGRAM=iTerm.app
|
|
||||||
04: TERM=screen-256color
|
|
||||||
05: SHELL=/bin/zsh
|
|
||||||
06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp
|
|
||||||
07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/
|
|
||||||
08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.h7gvN9K1go/Render
|
|
||||||
09: TERM_PROGRAM_VERSION=3.0.10
|
|
||||||
10: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
11: ZSH=/Users/ariard/.oh-my-zsh
|
|
||||||
12: USER=ariard
|
|
||||||
13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners
|
|
||||||
14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0
|
|
||||||
15: PAGER=less
|
|
||||||
16: TMUX=/private/tmp/tmux-18965/default,23758,2
|
|
||||||
17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches
|
|
||||||
18: LSCOLORS=Gxfxcxdxbxegedabagacad
|
|
||||||
19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin
|
|
||||||
20: MAIL=ariard@student.42.fr
|
|
||||||
21: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory
|
|
||||||
22: LANG=en_US.UTF-8
|
|
||||||
23: ITERM_PROFILE=Default
|
|
||||||
24: XPC_FLAGS=0x0
|
|
||||||
25: TMUX_PANE=%21
|
|
||||||
26: XPC_SERVICE_NAME=0
|
|
||||||
27: SHLVL=4
|
|
||||||
28: HOME=/Users/ariard
|
|
||||||
29: COLORFGBG=7;0
|
|
||||||
30: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
31: LOGNAME=ariard
|
|
||||||
32: LESS=-R
|
|
||||||
33: LC_CTYPE=en_US.UTF-8
|
|
||||||
34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/
|
|
||||||
35: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester/tmp
|
|
||||||
36: _=../../42sh
|
|
||||||
37: ?=0
|
|
||||||
38: ------------------------------
|
|
||||||
39: TOTAL ENVIRONMENT VARIABLES: 35[0m
|
|
||||||
|
|
||||||
STDERR:
|
STDERR:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m (no output)[0m
|
||||||
|
|
||||||
|
MISC:
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`[0m
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
[37;1m21sh/redirections/outputs/truncating/multiple/003-together-stderr-first[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
|
Description:
|
||||||
|
[38;5;239m A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
|
||||||
|
In this test the standard error is specified first.[0m
|
||||||
|
|
||||||
|
Before test:
|
||||||
|
[38;5;239m 01: rm -f new_file_stderr_and_stdout[0m
|
||||||
|
|
||||||
|
STDIN:
|
||||||
|
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 2>new_file_stderr_and_stdout 1>&2[0m
|
||||||
|
|
||||||
|
STDOUT:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m (no output)[0m
|
||||||
|
|
||||||
|
STDERR:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m (no output)[0m
|
||||||
|
|
||||||
|
MISC:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`[0m
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
[37;1m21sh/redirections/outputs/truncating/multiple/004-together[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
|
Description:
|
||||||
|
[38;5;239m A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.[0m
|
||||||
|
|
||||||
|
Before test:
|
||||||
|
[38;5;239m 01: rm -f "new_file_stderr_and_stdout"[0m
|
||||||
|
|
||||||
|
STDIN:
|
||||||
|
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &>new_file_stderr_and_stdout[0m
|
||||||
|
|
||||||
|
STDOUT:
|
||||||
|
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m 01: TOKEN201703270303_1[0m
|
||||||
|
|
||||||
|
STDERR:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m 01: TOKEN201703270303_2[0m
|
||||||
|
|
||||||
|
MISC:
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`[0m
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
[37;1m21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
|
Description:
|
||||||
|
[38;5;239m A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
|
||||||
|
In this test, we specify the file name in a separate field.[0m
|
||||||
|
|
||||||
|
Before test:
|
||||||
|
[38;5;239m 01: rm -f new_file_stderr_and_stdout[0m
|
||||||
|
|
||||||
|
STDIN:
|
||||||
|
[38;5;239m 01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &> new_file_stderr_and_stdout[0m
|
||||||
|
|
||||||
|
STDOUT:
|
||||||
|
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m 01: TOKEN201703270303_1[0m
|
||||||
|
|
||||||
|
STDERR:
|
||||||
|
[31m[38;5;34m SUCCESS expected_to_not match_regex `TOKEN201703270303_1`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to_not match_regex `TOKEN201703270303_2`[0m
|
||||||
|
[38;5;239m 01: TOKEN201703270303_2[0m
|
||||||
|
|
||||||
|
MISC:
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`[0m
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
[37;1m21sh/separators/semicolon/003-parse-error-empty-inline-command[0m [31m[38;5;160m(FAILED)[0m
|
||||||
|
|
||||||
|
Description:
|
||||||
|
[38;5;239m The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error.[0m
|
||||||
|
|
||||||
|
STDIN:
|
||||||
|
[38;5;239m 01: ./write_on_stdout TOKEN201703270303 ; ; ./exit_with_status 42[0m
|
||||||
|
|
||||||
|
STDOUT:
|
||||||
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
[31m[38;5;34m SUCCESS expected_to be_empty[0m
|
||||||
[38;5;239m (no output)[0m
|
[38;5;239m (no output)[0m
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/builtins/cd/errors/001-not-a-directory[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using a file name as first argument with the builtin `cd` results in error and not changing current directory.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: touch "./not_a_directory"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: cd not_a_directory
|
|
||||||
02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD`[0m
|
|
||||||
[38;5;239m 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD[0m
|
|
||||||
|
|
||||||
STDERR:
|
STDERR:
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
||||||
[31m[1;33m WARNING might match_regex `[Nn]ot a directory`[0m
|
[31m[38;5;34m SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error`[0m
|
||||||
[38;5;239m 01: ../../42sh: cd : ./not_a_directory: Permission denied[0m
|
[38;5;239m 01: syntax error near unexpected token `;'[0m
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/builtins/cd/errors/005-too-many-symbolic-links-encountered[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using a symbolic link resulting in ELOOP error as first argument with the builtin `cd` results in error and not changing current directory.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "./symbolic_link1" "./symbolic_link2" "./symbolic_link3"
|
|
||||||
02: ln -s "./symbolic_link1" "./symbolic_link2"
|
|
||||||
03: ln -s "./symbolic_link2" "./symbolic_link3"
|
|
||||||
04: ln -s "./symbolic_link3" "./symbolic_link1"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: cd symbolic_link1
|
|
||||||
02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD`[0m
|
|
||||||
[38;5;239m 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
|
||||||
[31m[1;33m WARNING might match_regex `[Tt]oo many.*symbolic links`[0m
|
|
||||||
[38;5;239m 01: ../../42sh: cd : ./symbolic_link1: No such file or directory[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/builtins/cd/options/001-not-following-links[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using symbolic links twice with the builtin `cd` and the option `-P` results in a correct environment variable PWD. The option `-P` makes the Shell to resolve symbolic links.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -fr "./sub_directory_link" "./sub_directory"
|
|
||||||
02: mkdir -p "./sub_directory/sub_sub_directory"
|
|
||||||
03: ln -s "./sub_directory" "./sub_directory_link"
|
|
||||||
04: ln -s "./sub_sub_directory" "./sub_directory/sub_sub_directory_link"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: cd -P sub_directory_link
|
|
||||||
02: cd -P sub_sub_directory_link
|
|
||||||
03: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_env[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory/sub_sub_directory`[0m
|
|
||||||
[38;5;239m 01: ------------------------------
|
|
||||||
02: TERM_PROGRAM=iTerm.app
|
|
||||||
03: TERM=screen-256color
|
|
||||||
04: SHELL=/bin/zsh
|
|
||||||
05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp
|
|
||||||
06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/
|
|
||||||
07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.h7gvN9K1go/Render
|
|
||||||
08: TERM_PROGRAM_VERSION=3.0.10
|
|
||||||
09: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
10: ZSH=/Users/ariard/.oh-my-zsh
|
|
||||||
11: USER=ariard
|
|
||||||
12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners
|
|
||||||
13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0
|
|
||||||
14: PAGER=less
|
|
||||||
15: TMUX=/private/tmp/tmux-18965/default,23758,2
|
|
||||||
16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches
|
|
||||||
17: LSCOLORS=Gxfxcxdxbxegedabagacad
|
|
||||||
18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin
|
|
||||||
19: MAIL=ariard@student.42.fr
|
|
||||||
20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory/sub_sub_directory
|
|
||||||
21: LANG=en_US.UTF-8
|
|
||||||
22: ITERM_PROFILE=Default
|
|
||||||
23: XPC_FLAGS=0x0
|
|
||||||
24: TMUX_PANE=%21
|
|
||||||
25: XPC_SERVICE_NAME=0
|
|
||||||
26: SHLVL=4
|
|
||||||
27: HOME=/Users/ariard
|
|
||||||
28: COLORFGBG=7;0
|
|
||||||
29: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123
|
|
||||||
30: LOGNAME=ariard
|
|
||||||
31: LESS=-R
|
|
||||||
32: LC_CTYPE=en_US.UTF-8
|
|
||||||
33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/
|
|
||||||
34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester
|
|
||||||
35: _=../../42sh
|
|
||||||
36: ?=73
|
|
||||||
37: ------------------------------
|
|
||||||
38: TOTAL ENVIRONMENT VARIABLES: 35[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[1;33m WARNING might be_empty[0m
|
|
||||||
[38;5;239m 01: ../../42sh: cd : ./sub_directory_link: Symlink not resolved
|
|
||||||
02: ../../42sh: cd : ./sub_sub_directory_link: Symlink not resolved[0m
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
[37;1mminishell/builtins/env/errors/001-command-not-found[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using the builtin `env` with an invalid binary as argument results in an error and failure exit status.[0m
|
|
||||||
|
|
||||||
Before test:
|
|
||||||
[38;5;239m 01: rm -f "./invalid_binary"[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: env ./invalid_binary[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[38;5;239m (no output)[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
|
||||||
[31m[1;33m WARNING might match_regex `[Cc]ommand not found`[0m
|
|
||||||
[38;5;239m 01: ../../42sh: env: ./invalid_binary: No such file or directory[0m
|
|
||||||
|
|
||||||
MISC:
|
MISC:
|
||||||
[31m[38;5;34m SUCCESS expected_to_not exit_with_status `0`[0m
|
[31m[38;5;34m SUCCESS expected_to_not exit_with_status `42`[0m
|
||||||
|
[31m[38;5;160m FAILURE expected_to_not exit_with_status `0`[0m
|
||||||
|
|
||||||
----------------------------------------------------------------
|
Total tests: 36
|
||||||
|
Total failed tests: 6
|
||||||
[37;1mminishell/builtins/exit/errors/001-too-many-args[0m [31m[1;33m(WARNING)[0m
|
|
||||||
|
|
||||||
Description:
|
|
||||||
[38;5;239m The purpose of this test is to check that using a wrong number of arguments with the builtin `exit` does not result in the Shell termination but an error on standard error.[0m
|
|
||||||
|
|
||||||
STDIN:
|
|
||||||
[38;5;239m 01: exit 21 42
|
|
||||||
02: ./write_on_stdout TOKEN201703252056[0m
|
|
||||||
|
|
||||||
STDOUT:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to match_regex `TOKEN201703252056`[0m
|
|
||||||
[38;5;239m 01: TOKEN201703252056[0m
|
|
||||||
|
|
||||||
STDERR:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to_not be_empty[0m
|
|
||||||
[31m[1;33m WARNING might match_regex `([Tt]oo many arguments|[Aa]rgument list too long)`[0m
|
|
||||||
[38;5;239m 01: ../../42sh: exit: too many argument required[0m
|
|
||||||
|
|
||||||
MISC:
|
|
||||||
[31m[38;5;34m SUCCESS expected_to exit_with_status `0`[0m
|
|
||||||
|
|
||||||
Total tests: 54
|
|
||||||
Total failed tests: 3
|
|
||||||
Total pending tests: 0
|
Total pending tests: 0
|
||||||
|
|
|
||||||
2501
42sh/42sh_error
2501
42sh/42sh_error
File diff suppressed because it is too large
Load diff
|
|
@ -6,14 +6,14 @@
|
||||||
# By: wescande <wescande@student.42.fr> +#+ +:+ +#+ #
|
# By: wescande <wescande@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2016/08/29 21:32:58 by wescande #+# #+# #
|
# Created: 2016/08/29 21:32:58 by wescande #+# #+# #
|
||||||
# Updated: 2017/03/26 22:15:25 by jhalford ### ########.fr #
|
# Updated: 2017/03/27 03:12:30 by ariard ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
NAME = 42sh
|
NAME = 42sh
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
FLAGS = -Wall -Wextra -Werror -fsanitize=address
|
FLAGS = -Wall -Wextra -Werror #-fsanitize=address
|
||||||
D_FLAGS = -g
|
D_FLAGS = -g
|
||||||
|
|
||||||
DELTA = $$(echo "$$(tput cols)-47"|bc)
|
DELTA = $$(echo "$$(tput cols)-47"|bc)
|
||||||
|
|
|
||||||
1
42sh/file
Normal file
1
42sh/file
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
GAGNE
|
||||||
20
42sh/file1
Normal file
20
42sh/file1
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
42ShellTester
|
||||||
|
42sh
|
||||||
|
Makefile
|
||||||
|
README.md
|
||||||
|
STDBUG
|
||||||
|
auteur
|
||||||
|
donovan_segaults_06-02
|
||||||
|
file1
|
||||||
|
includes
|
||||||
|
libft
|
||||||
|
minishell_error
|
||||||
|
objs
|
||||||
|
other
|
||||||
|
pdf
|
||||||
|
sample
|
||||||
|
scriptheader.sh
|
||||||
|
src
|
||||||
|
test
|
||||||
|
test.sh
|
||||||
|
update_makefile.sh
|
||||||
1
42sh/other
Normal file
1
42sh/other
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
cat: stdout: Bad file descriptor
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/07 19:02:23 by wescande #+# #+# */
|
/* Created: 2017/03/07 19:02:23 by wescande #+# #+# */
|
||||||
/* Updated: 2017/03/22 22:00:16 by ariard ### ########.fr */
|
/* Updated: 2017/03/27 03:47:36 by ariard ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -18,6 +18,8 @@ int plaunch_case(t_process *p)
|
||||||
|
|
||||||
exec = &data_singleton()->exec;
|
exec = &data_singleton()->exec;
|
||||||
exec->attrs &= ~EXEC_CASE_BRANCH;
|
exec->attrs &= ~EXEC_CASE_BRANCH;
|
||||||
|
if (exec->case_pattern && *exec->case_pattern)
|
||||||
|
ft_tabdel(&exec->case_pattern);
|
||||||
exec->case_pattern = token_to_argv(p->data.d_case.token, 1);
|
exec->case_pattern = token_to_argv(p->data.d_case.token, 1);
|
||||||
ft_exec(&p->data.d_case.content);
|
ft_exec(&p->data.d_case.content);
|
||||||
ft_tabdel(&exec->case_pattern);
|
ft_tabdel(&exec->case_pattern);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/07 20:36:04 by wescande #+# #+# */
|
/* Created: 2017/03/07 20:36:04 by wescande #+# #+# */
|
||||||
/* Updated: 2017/03/23 00:31:39 by ariard ### ########.fr */
|
/* Updated: 2017/03/27 03:42:29 by ariard ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
10
42sh/test.c
Normal file
10
42sh/test.c
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include "stdio.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
char str[10];
|
||||||
|
|
||||||
|
strcpy(str, "aaaaaaaaaaaaaaaaaaaaaaaa");
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
1
42sh/test.sh
Normal file
1
42sh/test.sh
Normal file
File diff suppressed because one or more lines are too long
0
42sh/test/fifi
Normal file
0
42sh/test/fifi
Normal file
24
42sh/test1
Normal file
24
42sh/test1
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
42ShellTester
|
||||||
|
42sh
|
||||||
|
Makefile
|
||||||
|
README.md
|
||||||
|
STDBUG
|
||||||
|
auteur
|
||||||
|
donovan_segaults_06-02
|
||||||
|
file
|
||||||
|
file1
|
||||||
|
includes
|
||||||
|
libft
|
||||||
|
minishell_error
|
||||||
|
objs
|
||||||
|
other
|
||||||
|
pdf
|
||||||
|
sample
|
||||||
|
scriptheader.sh
|
||||||
|
src
|
||||||
|
test
|
||||||
|
test.c
|
||||||
|
test.sh
|
||||||
|
test1
|
||||||
|
update_makefile.sh
|
||||||
|
/Users/ariard/Projects/42sh
|
||||||
Loading…
Reference in a new issue