mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
add test to check that header has a corresponding sip file
This commit is contained in:
parent
e3dedbd74a
commit
1d7ace1d51
@ -5,6 +5,7 @@ ENDIF(WITH_ASTYLE)
|
||||
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/scripts/spell_check/spell_test.sh)
|
||||
|
||||
ADD_TEST(qgis_sipify ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipify.sh)
|
||||
ADD_TEST(qgis_sip_include ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sip_include.sh)
|
||||
ADD_TEST(qgis_sip_uptodate ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipfiles_uptodate.sh)
|
||||
|
||||
IF (WITH_APIDOC)
|
||||
|
41
tests/code_layout/test_sip_include.sh
Executable file
41
tests/code_layout/test_sip_include.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR=$(git rev-parse --show-toplevel)
|
||||
REV=$(git log -n1 --pretty=%H)
|
||||
|
||||
# GNU prefix command for mac os support (gsed, gsplit)
|
||||
GP=
|
||||
if [[ "$OSTYPE" =~ darwin* ]]; then
|
||||
GP=g
|
||||
fi
|
||||
|
||||
pushd ${DIR} > /dev/null
|
||||
|
||||
code=0
|
||||
modules=(core gui analysis server)
|
||||
for module in "${modules[@]}"; do
|
||||
cp python/${module}/${module}_auto.sip python/${module}/${module}_auto.sip.$REV.bak
|
||||
done
|
||||
|
||||
./scripts/sip_include.sh
|
||||
|
||||
for module in "${modules[@]}"; do
|
||||
outdiff=$(diff python/${module}/${module}_auto.sip python/${module}/${module}_auto.sip.$REV.bak)
|
||||
if [[ -n $outdiff ]]; then
|
||||
echo -e " *** SIP include file for \x1B[33m${module}\x1B[0m not up to date."
|
||||
echo "$outdiff"
|
||||
code=1
|
||||
mv python/${module}/${module}_auto.sip.$REV.bak python/${module}/${module}_auto.sip
|
||||
else
|
||||
rm python/${module}/${module}_auto.sip.$REV.bak
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ code -eq 1 ]]; then
|
||||
echo -e " Run \x1B[33m./scripts/sip_include.sh\x1B[0m to add to fix this."
|
||||
echo -e " If a header should not have a sip file created, add \x1B[33m#define SIP_NO_FILE\x1B[0m."
|
||||
fi
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
exit $code
|
Loading…
x
Reference in New Issue
Block a user