Skip to content

Commit

Permalink
[ticket/12941] Check for Sami parse errors on Travis CI.
Browse files Browse the repository at this point in the history
PHPBB3-12941
  • Loading branch information
bantu committed Aug 9, 2014
1 parent 4f131c2 commit 873d1c6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions travis/check-sami-parse-errors.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions travis/setup-phpbb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
14 changes: 14 additions & 0 deletions travis/setup-unbuffer.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 873d1c6

Please sign in to comment.