forked from Gaia-Interactive/gaia_core_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·32 lines (20 loc) · 801 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
hash prove 2>&- || { echo >&2 "prove executable not found. please install perl-Test-Harness."; exit 1; }
php_installed=`which php`
hash php 2>&- || { echo >&2 "php executable not found. please install php5.3 or greater."; exit 1; }
version=`/usr/bin/env php -r "echo phpversion();"`
versioncheck=`/usr/bin/env php -r "echo version_compare(phpversion(), '5.3');"`
if [ $versioncheck -lt 1 ]
then
echo "php5.3+ required. you are running $version. please upgrade."
exit 1;
fi
echo "gaia_core_php tests running php $version ..."
echo "-----------------------------------"
f=`dirname $0`
execsupported=`prove -? | grep "\--exec"`
if [ "$execsupported" ]; then
/usr/bin/env prove -r --exec=php $* $f
else
/usr/bin/env prove -r $* "$f/examples/" "$f/tests/"
fi