QGIS/tests/code_layout/test_sipfiles_uptodate.sh
Denis Rouzaud fa5bd491fc run code_layout build from top CMakeLists
instead of adding an extra CMakeLists in .ci/travis/code_layout to build API doc, astyle and run tests (indentation, spelling, sip, doc coverage), the top CMakeLists has been adapted to allow not building core libraries and possibly just the static code layout
* astyle has been moved from /src/astyle to /lib/astyle (I would propose to move all external libraries, and possibly add git submodules)
2017-06-05 22:19:20 +02:00

38 lines
961 B
Bash
Executable File

#!/usr/bin/env bash
DIR=$(git rev-parse --show-toplevel)
# GNU prefix command for mac os support (gsed, gsplit)
GP=
if [[ "$OSTYPE" =~ darwin* ]]; then
GP=g
fi
pushd ${DIR} > /dev/null
code=0
while read -r sipfile; do
if ! grep -Fxq "$sipfile" python/auto_sip.blacklist; then
header=$(sed -E 's/(.*)\.sip/src\/\1.h/' <<< $sipfile)
if [ ! -f $header ]; then
echo "*** Missing header: $header for sipfile $sipfile"
else
outdiff=$(./scripts/sipify.pl $header | diff python/$sipfile -)
if [[ -n $outdiff ]]; then
echo " *** SIP file not up to date: $sipfile"
code=1
fi
fi
fi
done < <(
sed -n -r 's/^%Include (.*\.sip)/core\/\1/p' python/core/core.sip
sed -n -r 's/^%Include (.*\.sip)/gui\/\1/p' python/gui/gui.sip
sed -n -r 's/^%Include (.*\.sip)/analysis\/\1/p' python/analysis/analysis.sip
sed -n -r 's/^%Include (.*\.sip)/server\/\1/p' python/server/server.sip
)
popd > /dev/null
exit $code