find-unused-data.sh: move script to bin and adapt it

to check the whole repository

Change-Id: Ic2df1248604e6e0053a8eeda50869eb5a3b1db0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151942
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2023-05-18 20:45:57 +02:00
parent 00e2e3210d
commit 1b9702920d
2 changed files with 24 additions and 11 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
PATHES="$(find $SCRIPTPATH/.. \( -wholename '*/qa/*/testdocuments' -o -wholename '*/qa/*/testdocuments/*' -o -wholename '*/qa/*/data' -o -wholename '*/qa/*/data/*' \) -type d )"
for path in $PATHES
do
# Ignore pass/fail/inderterminate folders, functions test in sc, workdir folder and xml in sd
if [[ "$path" != */pass* ]] && [[ "$path" != */fail* ]] && [[ "$path" != */indeterminate* ]] \
&& [[ "$path" != */functions* ]] && [[ "$path" != */workdir* ]] && [[ "$path" != */xml* ]]; then
for i in $path/*
do
if [ -f "$i" ]; then
file=$(basename "$i")
if ! git grep -q "$file"; then
echo "WARNING: $i is not used, write a testcase for it!"
fi
fi
done
fi
done
# vi:set shiftwidth=4 expandtab:
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
for i in */data/*
do
file=$(basename "$i")
if ! git grep -q "$file"; then
echo "WARNING: $i is not used, write a testcase for it!"
fi
done
# vi:set shiftwidth=4 expandtab: