diff --git a/export_test.txt b/tests/export_test.txt similarity index 100% rename from export_test.txt rename to tests/export_test.txt diff --git a/test.txt b/tests/test.txt similarity index 100% rename from test.txt rename to tests/test.txt diff --git a/tests/test_exit.txt b/tests/test_exit.txt new file mode 100644 index 0000000..39e3906 --- /dev/null +++ b/tests/test_exit.txt @@ -0,0 +1,2 @@ +echo "yeah" +exit diff --git a/test_minishell.sh b/tests/test_minishell.sh similarity index 86% rename from test_minishell.sh rename to tests/test_minishell.sh index 48a9bbb..ce50ce4 100755 --- a/test_minishell.sh +++ b/tests/test_minishell.sh @@ -9,16 +9,16 @@ fi TEXT_FILE=$1 # Step 2: make fclean -make fclean +make -C ../ fclean # Step 3: make with FLAGS -make -j4 FLAGS="-DNOCOLORS -DNOBANNER -DNOPROMPT" +make -j4 -C ../ FLAGS="-DNOCOLORS -DNOBANNER -DNOPROMPT" # Add 'export PS1=">"' to the start of the TEXT_FILE sed -i '1i export PS1="$"' "$TEXT_FILE" # Step 4: Run ./minishell with the text file as input and redirect output to a temp file -./minishell < "$TEXT_FILE" > minishell_output.txt 2>&1 +../minishell < "$TEXT_FILE" > minishell_output.txt 2>&1 # Step 5: Run bash with the text file as input and redirect output to a temp file export PS1=">"; bash -i < "$TEXT_FILE" > bash_output.txt 2>&1