]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update 'check.doc' target to save the input as parameter
authorJorge Pereira <jpereira@freeradius.org>
Wed, 28 Aug 2019 17:13:27 +0000 (14:13 -0300)
committerAlan DeKok <aland@freeradius.org>
Wed, 28 Aug 2019 18:51:37 +0000 (14:51 -0400)
The list of expected missing xlat's calls should be versioned
in scripts/checks/missing-xlat-doc.txt

doc/all.mk
scripts/checks/missing-xlat-doc.sh
scripts/checks/missing-xlat-doc.txt [new file with mode: 0644]

index e20223c84c3110ca05dcdd5a225c9ea77953dee8..14c7845d334174808b1369f62374ddd3d3c31c0e 100644 (file)
@@ -121,7 +121,14 @@ clean.doc:
 #      Sanity checks
 #
 check.doc:
-       ${Q}./scripts/checks/missing-xlat-doc.sh
+       ${Q}echo "TEST-DOC XLAT CHECK";                                           \
+       check_xlatA="${top_srcdir}/scripts/checks/missing-xlat-doc.txt";          \
+       check_xlatB="${BUILD_DIR}/tests/missing-xlat-doc.txt";                    \
+       ./scripts/checks/missing-xlat-doc.sh > $${check_xlatB};                   \
+       if ! diff $${check_xlatA} $${check_xlatB}; then                           \
+               echo "FAILED: XLAT'S MISSING CHECKS: $$check_xlatA != $$check_xlatB"; \
+               exit 1;                                                               \
+       fi
 
 .PHONY: tests.doc
 tests.doc:
index 752816e4690439d942607920540d3c323df224b2..d51575ffe818e62c73a35c16ba0b075ad522cd61 100755 (executable)
@@ -1,37 +1,15 @@
 #!/bin/bash
 # Script used to verify the xlat funcs vs documentation
 
-# everything here will be ignored.
-ignore_funcs="trigger|test"
-
-# ignore rlm_dict xlat's
-ignore_funcs="$ignore_funcs|attr|attr_by_num|attr_by_oid|attr_num|vendor|vendor"
-
 # main()
+xlat_api_funcs="xlat_register|xlat_async_register"
 src_dir="src/"
 doc_xlat="doc/"
-tmp_file="/tmp/missing-xlat-doc.$$"
-ret=0
 
-grep --include "*.c" -E '(xlat_register|xlat_async_register).*"' -r $src_dir 2>&1 | \
-       grep -vE "($ignore_funcs)" | perl -lpe 's/^.*"(.*)".*$/\1/' | sort | uniq | \
+grep --include "*.c" -E "($xlat_api_funcs).*\"" -r $src_dir 2>&1 | \
+       perl -lpe 's/^.*"(.*)".*$/\1/' | sort | uniq | \
 while read _d; do
        if ! grep -q "%{$_d:" --include "*.adoc" -r $doc_xlat 2>&1; then
-               echo "%{$_d:...}" >> $tmp_file
+               echo "%{$_d:...}"
        fi
 done
-
-echo "****************************************************************"
-echo " WARNING: Ignoring documentation for the xlat's: $ignore_funcs"
-echo "****************************************************************"
-
-if [ -s "$tmp_file" ]; then
-       echo "****************************************************************"
-       echo " ERROR: The below xlat's functions are not documented in $doc_xlat"
-       echo "****************************************************************"
-       cat $tmp_file
-       ret=1
-fi
-
-rm -f $tmp_file
-exit $ret
diff --git a/scripts/checks/missing-xlat-doc.txt b/scripts/checks/missing-xlat-doc.txt
new file mode 100644 (file)
index 0000000..c29b055
--- /dev/null
@@ -0,0 +1,8 @@
+%{attr:...}
+%{attr_by_num:...}
+%{attr_by_oid:...}
+%{attr_num:...}
+%{test:...}
+%{trigger:...}
+%{vendor:...}
+%{vendor_num:...}