Skip to content

Commit 70680d9

Browse files
committed
Improved run-tests.sh script [skip appveyor]
1 parent 4062452 commit 70680d9

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.ci/run-tests.sh

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,38 @@
77
# For the full copyright and license information, please view
88
# the LICENSE file that was distributed with this source code.
99

10-
export NO_INTERACTION=1
11-
export REPORT_EXIT_STATUS=1
12-
export ZEND_DONT_UNLOAD_MODULES=1
13-
export USE_ZEND_ALLOC=0
10+
set -e
1411

12+
NO_INTERACTION=1
13+
REPORT_EXIT_STATUS=1
14+
ZEND_DONT_UNLOAD_MODULES=1
15+
USE_ZEND_ALLOC=0
16+
17+
export NO_INTERACTION REPORT_EXIT_STATUS ZEND_DONT_UNLOAD_MODULES USE_ZEND_ALLOC
1518
if [ -z "${TEST_PHP_EXECUTABLE}" ]; then
16-
export TEST_PHP_EXECUTABLE=$(phpenv which php)
19+
TEST_PHP_EXECUTABLE="$(phpenv which php)"
20+
export TEST_PHP_EXECUTABLE
1721
fi
1822

19-
PHP_VERNUM="$(`phpenv which php-config` --vernum)"
20-
PROJECT_ROOT=$(readlink -enq "$(dirname $0)/../")
23+
PHP_VERNUM="$($(phpenv which php-config) --vernum)"
24+
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )"
2125

2226
if [ "${PHP_VERNUM}" -lt 70300 ]; then
23-
if [ $(command -v valgrind 2>/dev/null) != "" ]; then
24-
export TEST_PHP_ARGS=-m
27+
if [ -n "$(command -v valgrind 2>/dev/null)" ]; then
28+
TEST_PHP_ARGS=-m
29+
export TEST_PHP_ARGS
2530
else
2631
>&2 echo "Skip check for memory leaks. Valgring does not exist"
2732
fi
2833
else
2934
>&2 echo "Skip check for memory leaks due to unstable PHP version"
3035
fi
3136

32-
${TEST_PHP_EXECUTABLE} ${PROJECT_ROOT}/run-tests.php \
37+
${TEST_PHP_EXECUTABLE} "${PROJECT_ROOT}/run-tests.php" \
3338
-d extension=zephir_parser.so \
34-
-d extension_dir=${PROJECT_ROOT}/modules \
39+
-d extension_dir="${PROJECT_ROOT}/modules" \
3540
-d variables_order=EGPCS \
36-
-n ${PROJECT_ROOT}/tests/*.phpt \
41+
-n "${PROJECT_ROOT}/tests/*.phpt" \
3742
-g "FAIL,XFAIL,BORK,WARN,SKIP" \
3843
--offline \
3944
--show-diff \

0 commit comments

Comments
 (0)