Skip to content
Permalink
Browse files

[sipify] complete test to check the __init__.py core files are up to …

…date
  • Loading branch information
3nids committed May 18, 2018
1 parent f267adc commit 7440220e05a36fe8085e52a81c0c4581d0bec999
Showing with 23 additions and 15 deletions.
  1. +23 −15 tests/code_layout/test_sipfiles_uptodate.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
#set -e

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

@@ -15,22 +15,30 @@ pushd ${DIR} > /dev/null
modules=(core gui analysis server)

code=0
while read -r sipfile; do
header=$(${GP}sed -E 's@(.*)\.sip@src/\1.h@; s@auto_generated/@@' <<< $sipfile)
if [ ! -f $header ]; then
echo "*** Missing header: $header for sipfile $sipfile"
else
outdiff=$(./scripts/sipify.pl $header | diff python/$sipfile.in -)
if [[ -n $outdiff ]]; then
echo " *** SIP file not up to date: $sipfile"
code=1
fi
fi
done < <(
for module in "${modules[@]}"; do
${GP}sed -n -r "s@^%Include auto_generated/(.*\.sip)@${module}/auto_generated/\1@p" python/${module}/${module}_auto.sip
done
module_init=${DIR}/python/${module}/__init__.py
cp ${module_init} ${DIR}/${module}.temp
while read -r sipfile; do
header=$(${GP}sed -E 's@(.*)\.sip@src/\1.h@; s@auto_generated/@@' <<< $sipfile)
if [ ! -f $header ]; then
echo "*** Missing header: $header for sipfile $sipfile"
else
outdiff=$(./scripts/sipify.pl -p ${DIR}/${module}.temp $header | diff python/$sipfile.in -)
if [[ -n "$outdiff" ]]; then
echo " *** SIP file not up to date: $sipfile"
code=1
fi
fi
done < <(
${GP}sed -n -r "s@^%Include auto_generated/(.*\.sip)@${module}/auto_generated/\1@p" python/${module}/${module}_auto.sip
)
outdiff=$(diff ${module_init} ${DIR}/${module}.temp)
if [[ -n "$outdiff" ]]; then
echo " *** Python ${module} (${module_init}) init not up to date: run sipify with -p argument"
code=1
fi
rm ${DIR}/${module}.temp
done


popd > /dev/null

0 comments on commit 7440220

Please sign in to comment.
You can’t perform that action at this time.