From db1834a620c1c4fc5f7583dc521e8defdcd2137b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Thu, 27 Mar 2025 16:10:41 +0100 Subject: [PATCH] inttests: run each test in a clean directory --- test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 03241b9..c4ca0ae 100755 --- a/test.sh +++ b/test.sh @@ -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 }