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:
Executable
+24
@@ -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:
|
||||
@@ -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:
|
||||
Reference in New Issue
Block a user