inttests: run each test in a clean directory

This commit is contained in:
Khaïs COLIN 2025-03-27 16:10:41 +01:00
parent d8bc528c5a
commit db1834a620
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -7,6 +7,7 @@ declare -i SUCCEDED=0
declare -i TODTODO=0
declare -i RAN=0
NAME=""
MINISHELL=$PWD/minishell
report_header()
{
@ -67,7 +68,11 @@ assert()
when_run()
{
cat > /tmp/input.minishell
./minishell &> /tmp/got.minishell < /tmp/input.minishell
rm -rf /tmp/dir.minishell
mkdir -p /tmp/dir.minishell
pushd /tmp/dir.minishell > /dev/null
$MINISHELL &> /tmp/got.minishell < /tmp/input.minishell
popd > /dev/null
RAN+=1
NAME=$1
}