mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00

The broxygen-generated files now live in the git repo, have tests that check that they are up-to-date, and a script to re-generate them on-demand.
33 lines
880 B
Bash
33 lines
880 B
Bash
# This script checks whether the reST docs generated by broxygen are stale.
|
|
# If this test fails, then simply run:
|
|
#
|
|
# testing/scripts/gen-broxygen-docs.sh
|
|
#
|
|
# and then include the changes in your commit.
|
|
#
|
|
# @TEST-EXEC: bash $SCRIPTS/gen-broxygen-docs.sh ./doc
|
|
# @TEST-EXEC: bash %INPUT
|
|
|
|
function check_diff
|
|
{
|
|
local file=$1
|
|
echo "Checking $file for differences"
|
|
diff -Nru $file $DIST/$file 1>&2
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "============================" 1>&2
|
|
echo "$DIST/$file is outdated" 1>&2
|
|
echo "Re-run the following command:" 1>&2
|
|
echo "" 1>&2
|
|
echo " $SCRIPTS/gen-broxygen-docs.sh" 1>&2
|
|
echo "" 1>&2
|
|
echo "And then include the changes in your commit" 1>&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
for file in $(find ./doc -name autogenerated-*); do
|
|
check_diff $file
|
|
done
|
|
|
|
check_diff ./doc/scripts
|