Skip to content

Commit

Permalink
test auto-generated sip files on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Mar 30, 2017
1 parent 77d7236 commit 988c504
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions ci/travis/code_layout/CMakeLists.txt
Expand Up @@ -8,3 +8,4 @@ ENABLE_TESTING()

ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/../../../scripts/verify-indentation.sh)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/../../../scripts/spell_check/spell_test.sh)
ADD_TEST(qgis_sip ${CMAKE_SOURCE_DIR}/../../../tests/scripts/test_auto_sipfiles.sh)
20 changes: 20 additions & 0 deletions tests/scripts/test_auto_sipfiles.sh
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

DIR=$(git rev-parse --show-toplevel)

code=0

while read -r line; do
header="src/$line"
sipfile=$(sed -E 's/(.*)\.h/python\/\1.sip/' <<< $line)
outdiff=$(${DIR}/scripts/sipify.pl ${DIR}/$header | diff ${DIR}/$sipfile -)
if [[ -n $outdiff ]]; then
if [[ $code == 0 ]]; then
echo "some sip files are not up to date:"
code=1
fi
echo "$sipfile"
fi
done < ${DIR}/python/auto_sipfiles.txt

exit $code

0 comments on commit 988c504

Please sign in to comment.