Skip to content

Commit

Permalink
[utils] Add script to remove all empty test directories
Browse files Browse the repository at this point in the history
After having checked out an older commit, e.g. during bisect, and then
checking out another commit, test directories that are deleted still
exists since they might contain leftover files (output, log, ...)

These cause "make tests" to fail, since it cannot run that test.
  • Loading branch information
thoni56 committed Jun 21, 2024
1 parent 954b205 commit 3f900e2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/clean-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

cd `dirname $(readlink -f $0)`/../src

# Hitta alla mappar som börjar med "test_"
for dir in test_*; do
# Kontrollera om det finns några git-kontrollerade filer, Makefile eller .suspended
# för då är de antingen äkta test-mappar eller en som inte ännu inte fungerar
# annars kan vi ta bort den
if [ -z "$(git ls-files "$dir")" ] && [ ! -f "$dir/Makefile" ] && [ ! -f "$dir/.suspended" ]; then
rm -rf $dir
echo "Removed $dir"
fi
done

0 comments on commit 3f900e2

Please sign in to comment.