|
7 | 7 | # For the full copyright and license information, please view
|
8 | 8 | # the LICENSE file that was distributed with this source code.
|
9 | 9 |
|
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 |
14 | 11 |
|
| 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 |
15 | 18 | 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 |
17 | 21 | fi
|
18 | 22 |
|
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 )" |
21 | 25 |
|
22 | 26 | 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 |
25 | 30 | else
|
26 | 31 | >&2 echo "Skip check for memory leaks. Valgring does not exist"
|
27 | 32 | fi
|
28 | 33 | else
|
29 | 34 | >&2 echo "Skip check for memory leaks due to unstable PHP version"
|
30 | 35 | fi
|
31 | 36 |
|
32 |
| -${TEST_PHP_EXECUTABLE} ${PROJECT_ROOT}/run-tests.php \ |
| 37 | +${TEST_PHP_EXECUTABLE} "${PROJECT_ROOT}/run-tests.php" \ |
33 | 38 | -d extension=zephir_parser.so \
|
34 |
| - -d extension_dir=${PROJECT_ROOT}/modules \ |
| 39 | + -d extension_dir="${PROJECT_ROOT}/modules" \ |
35 | 40 | -d variables_order=EGPCS \
|
36 |
| - -n ${PROJECT_ROOT}/tests/*.phpt \ |
| 41 | + -n "${PROJECT_ROOT}/tests/*.phpt" \ |
37 | 42 | -g "FAIL,XFAIL,BORK,WARN,SKIP" \
|
38 | 43 | --offline \
|
39 | 44 | --show-diff \
|
|
0 commit comments