aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-08-10 01:02:27 +0200
committerTristan Darricau <github@nicofuma.fr>2014-08-10 01:02:27 +0200
commitb000d10ef8000bba3a029872a47318a2177e9ab2 (patch)
treee13a2781137b2b6578c6d94c60a73e32e7498e06 /travis
parent6a8413f064a0a8ade332634c2a891e8ca9038a8b (diff)
parent076d4ddd7f146092ce79b4ea1d11b5731ed2e695 (diff)
downloadforums-b000d10ef8000bba3a029872a47318a2177e9ab2.tar
forums-b000d10ef8000bba3a029872a47318a2177e9ab2.tar.gz
forums-b000d10ef8000bba3a029872a47318a2177e9ab2.tar.bz2
forums-b000d10ef8000bba3a029872a47318a2177e9ab2.tar.xz
forums-b000d10ef8000bba3a029872a47318a2177e9ab2.zip
Merge pull request #2849 from bantu/ticket/12941
[ticket/12941] Check for Sami parse errors on Travis CI. * bantu/ticket/12941: [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')
-rwxr-xr-xtravis/check-sami-parse-errors.sh33
-rw-r--r--travis/sami.conf.php19
-rwxr-xr-xtravis/setup-phpbb.sh1
-rwxr-xr-xtravis/setup-unbuffer.sh14
4 files changed, 67 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
diff --git a/travis/sami.conf.php b/travis/sami.conf.php
new file mode 100644
index 0000000000..8e7cfa42e9
--- /dev/null
+++ b/travis/sami.conf.php
@@ -0,0 +1,19 @@
+<?php
+/**
+*
+* 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.
+*
+*/
+
+require __DIR__ . '/../build/' . basename(__FILE__);
+
+// Removing the versions array key will make Sami use the current branch.
+unset($config['versions']);
+
+return new Sami\Sami($iterator, $config);
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