summaryrefslogtreecommitdiffstats
path: root/bin/find-unused-data.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /bin/find-unused-data.sh
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/find-unused-data.sh')
-rwxr-xr-xbin/find-unused-data.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/find-unused-data.sh b/bin/find-unused-data.sh
new file mode 100755
index 0000000000..e6e0217f03
--- /dev/null
+++ b/bin/find-unused-data.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+SCRIPT=$(realpath "$0")
+SCRIPTPATH=$(dirname "$SCRIPT")
+PATHS="$(find $SCRIPTPATH/.. \( -wholename '*/qa/*/testdocuments' -o -wholename '*/qa/*/testdocuments/*' -o -wholename '*/qa/*/data' -o -wholename '*/qa/*/data/*' \) -type d )"
+
+for path in $PATHS
+do
+ # Ignore pass/fail/indeterminate 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: