From 172b6c245ff6a2be2bcb0a46d48acbd62a439c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 24 Apr 2020 10:30:19 +0200 Subject: [PATCH] cmdlineTests.sh: Fix the script not removing all temporary files it creates in /tmp - The script was leaving hundreds of loose `tmp.XXXXXX` and `tmp.XXXXXX.bak` files in `/tmp` after each run - There's a trap handler that removes them but it's being registered multiple times in a loop and only the last one actually runs when the script exits. It's still useful because it removes the remaining files from the most recent iteration but on its own it's not enough to clean up everything. --- test/cmdlineTests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index e99969808..077aa5c19 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -126,7 +126,7 @@ function test_solc_behaviour() # Remove trailing empty lines. Needs a line break to make OSX sed happy. sed -i.bak -e '1{/^$/d }' "$stderr_path" - rm "$stderr_path.bak" + rm "$stderr_path.bak" "$stdout_path.bak" fi # Remove path to cpp file sed -i.bak -e 's/^\(Exception while assembling:\).*/\1/' "$stderr_path" @@ -175,6 +175,8 @@ function test_solc_behaviour() exit 1 fi fi + + rm -f "$stdout_path" "$stderr_path" }