summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKarel Zak2019-04-24 18:02:39 +0200
committerKarel Zak2019-04-24 18:02:39 +0200
commit58354269eb9ab3b1963b2d56294393a3d02db712 (patch)
treedd4bd43ccef98c633c6ffb2078f2fbce265953f1 /tools
parentsu: make comment more friedly to 'make checkxalloc' (diff)
downloadkernel-qcow2-util-linux-58354269eb9ab3b1963b2d56294393a3d02db712.tar.gz
kernel-qcow2-util-linux-58354269eb9ab3b1963b2d56294393a3d02db712.tar.xz
kernel-qcow2-util-linux-58354269eb9ab3b1963b2d56294393a3d02db712.zip
build-sys: add 'make checklibdoc'
Let's to be sure that all libs API symbols are documented. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checklibdocs.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/checklibdocs.sh b/tools/checklibdocs.sh
new file mode 100755
index 000000000..094d2cbd5
--- /dev/null
+++ b/tools/checklibdocs.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+FILE_API_SYMBOLS="$1"
+FILE_API_DOCS="$2"
+
+if [ ! -f "$FILE_API_SYMBOLS" ]; then
+ echo "File $FILE_API_SYMBOLS is missing."
+ exit 1
+fi
+
+if [ ! -f "$FILE_API_DOCS" ]; then
+ echo "File $FILE_API_DOCS is missing."
+ exit 1
+fi
+
+fail_ct=0
+api_symbols=$(awk '/^([[:space:]]+)([[:alnum:]_]+);/ { gsub(";",""); print $1; }' "$FILE_API_SYMBOLS" | sort)
+doc_symbols=$(awk '/^([[:space:]])*$/ {next}; !/<.*>/ { print $1 }' "$FILE_API_DOCS" | sort)
+
+echo -n "Checking $FILE_API_SYMBOLS documentation ... "
+
+for sym in $api_symbols; do
+ case "$doc_symbols" in
+ *"$sym"*)
+ #echo -ne "\n '$sym'"
+ ;;
+ *)
+ echo -ne "\n '$sym' undocumented"
+ fail_ct=$(($fail_ct + 1))
+ ;;
+ esac
+done
+
+if [ $fail_ct -ne 0 ]; then
+ echo
+ echo "$fail_ct symbols is missing in ${FILE_API_DOCS}."
+ echo
+ exit 1
+else
+ echo "OK"
+fi
+
+exit 0