aboutsummaryrefslogtreecommitdiffstats
path: root/travis/check-sami-parse-errors.sh
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-08-10 01:02:38 +0200
committerTristan Darricau <github@nicofuma.fr>2014-08-10 01:02:38 +0200
commit59b5ab4866e4c687c9157898110fd0e556f6c6ac (patch)
tree2e58406d62e19ffaaf9670cf80740df445a81699 /travis/check-sami-parse-errors.sh
parent1c98b46625518a7b398f7f81536ade01be2e937d (diff)
parentb000d10ef8000bba3a029872a47318a2177e9ab2 (diff)
downloadforums-59b5ab4866e4c687c9157898110fd0e556f6c6ac.tar
forums-59b5ab4866e4c687c9157898110fd0e556f6c6ac.tar.gz
forums-59b5ab4866e4c687c9157898110fd0e556f6c6ac.tar.bz2
forums-59b5ab4866e4c687c9157898110fd0e556f6c6ac.tar.xz
forums-59b5ab4866e4c687c9157898110fd0e556f6c6ac.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12941] Fix remaining Sami complaints. [ticket/12941] Check for Sami parse errors on Travis CI. [ticket/12941] Add sami.conf.php for Travis CI.
Diffstat (limited to 'travis/check-sami-parse-errors.sh')
-rwxr-xr-xtravis/check-sami-parse-errors.sh33
1 files changed, 33 insertions, 0 deletions
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