make spell test a proper test and not a standalone script

This commit is contained in:
Denis Rouzaud 2017-02-22 13:11:31 +01:00
parent 08c2e66b88
commit 4021490791
3 changed files with 11 additions and 5 deletions

View File

@ -79,7 +79,6 @@ before_script:
script:
- ./ci/travis/${TRAVIS_OS_NAME}/script.sh
- ./ci/travis/check_spelling.sh
after_script:
- ./ci/travis/${TRAVIS_OS_NAME}/after_script.sh

View File

@ -1,20 +1,25 @@
#!/bin/bash
set -e
export PATH=${HOME}/osgeo4travis/bin:${PATH}
echo "Spell check"
cd $(git rev-parse --show-toplevel)
if [[ ! -z $TRAVIS_PULL_REQUEST_BRANCH ]]; then
# if on a PR, just analyse the changed files
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH"
FILES=$(git diff --diff-filter=AM --name-only $(git merge-base HEAD master) | tr '\n' ' ' )
else
export PATH=${HOME}/osgeo4travis/bin:${PATH}
elif [[ ! -z $TRAVIS_COMMIT_RANGE ]]; then
echo "TRAVIS COMMIT RANGE: $TRAVIS_COMMIT_RANGE"
FILES=$(git diff --diff-filter=AM --name-only ${TRAVIS_COMMIT_RANGE/.../..} | tr '\n' ' ' )
export PATH=${HOME}/osgeo4travis/bin:${PATH}
else
echo "Runnng spell test on all files (might take a while)"
FILES=""
fi
if [[ ! -z $FILES ]]; then
./scripts/spell_check/check_spelling.sh -r $FILES
DIR=$(git rev-parse --show-toplevel)/scripts/spell_check
${DIR}/check_spelling.sh -r $FILES
fi

View File

@ -6,3 +6,5 @@ ENDIF (ENABLE_TESTS)
IF(WITH_ASTYLE)
ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/scripts/verify-indentation.sh)
ENDIF(WITH_ASTYLE)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/scripts/spell_check/spell_test.sh)