diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-08-09 15:06:34 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-08-09 15:58:04 +0200 |
commit | 873d1c6d575345619fb2c8ed65b9742dec59a338 (patch) | |
tree | 23ace06f484edfc5fb717868cf6b9406b9dbedf3 | |
parent | 4f131c224817517b9c8e32bf0eb99bda79431d73 (diff) | |
download | forums-873d1c6d575345619fb2c8ed65b9742dec59a338.tar forums-873d1c6d575345619fb2c8ed65b9742dec59a338.tar.gz forums-873d1c6d575345619fb2c8ed65b9742dec59a338.tar.bz2 forums-873d1c6d575345619fb2c8ed65b9742dec59a338.tar.xz forums-873d1c6d575345619fb2c8ed65b9742dec59a338.zip |
[ticket/12941] Check for Sami parse errors on Travis CI.
PHPBB3-12941
-rw-r--r-- | .travis.yml | 1 | ||||
-rwxr-xr-x | travis/check-sami-parse-errors.sh | 33 | ||||
-rwxr-xr-x | travis/setup-phpbb.sh | 1 | ||||
-rwxr-xr-x | travis/setup-unbuffer.sh | 14 |
4 files changed, 49 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index a246590bb5..cbba07b16d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ before_script: script: - travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION + - travis/check-sami-parse-errors.sh $DB $TRAVIS_PHP_VERSION - travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION - travis/check-executable-files.sh $DB $TRAVIS_PHP_VERSION ./ - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml diff --git a/travis/check-sami-parse-errors.sh b/travis/check-sami-parse-errors.sh new file mode 100755 index 0000000000..847c54a61a --- /dev/null +++ b/travis/check-sami-parse-errors.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited <https://www.phpbb.com> +# @license GNU General Public License, version 2 (GPL-2.0) +# +# For full copyright and license information, please see +# the docs/CREDITS.txt file. +# +set -e + +DB=$1 +TRAVIS_PHP_VERSION=$2 + +if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ] +then + # Workarounds for + # https://github.com/fabpot/Sami/issues/116 + # and + # https://github.com/fabpot/Sami/issues/117 + errors=$( + unbuffer phpBB/vendor/bin/sami.php parse travis/sami.conf.php -v | \ + sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | \ + grep "ERROR: " | \ + tee /dev/tty | \ + wc -l + ) + if [ "$errors" != "0" ] + then + exit 1 + fi +fi diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index f065faf8e2..d829772196 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -17,6 +17,7 @@ TRAVIS_PHP_VERSION=$2 if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ] then travis/setup-exiftool.sh + travis/setup-unbuffer.sh fi if [ "$DB" == "mariadb" ] diff --git a/travis/setup-unbuffer.sh b/travis/setup-unbuffer.sh new file mode 100755 index 0000000000..4423d1b8b6 --- /dev/null +++ b/travis/setup-unbuffer.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited <https://www.phpbb.com> +# @license GNU General Public License, version 2 (GPL-2.0) +# +# For full copyright and license information, please see +# the docs/CREDITS.txt file. +# +set -e + +sudo apt-get update +sudo apt-get install -y expect-dev |