Skip to content

Commit 229e472

Browse files
authored
Merge pull request #78 from phalcon/fix/coverage
Patch libtool to not remove gcno [skip appveyor]
2 parents 8e97f1e + cdb2bec commit 229e472

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
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 \

.travis.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ env:
3232

3333
matrix:
3434
fast_finish: true
35-
allow_failures:
36-
- php: '7.4snapshot'
3735

3836
cache:
3937
apt: true
@@ -45,18 +43,10 @@ cache:
4543
before_install:
4644
- phpenv config-rm xdebug.ini || true
4745
- ulimit -c unlimited -S || true
48-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" ]]; then export COVERAGE="OFF"; fi
4946

5047
install:
5148
- .ci/install-re2c.sh
5249
- phpize
53-
- |
54-
if [ $COVERAGE = "ON" ]; then
55-
aclocal
56-
libtoolize --copy --force
57-
autoheader
58-
autoconf
59-
fi
6050
- |
6151
./configure \
6252
--with-php-config=$(phpenv which php-config) \

parser.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ $(srcdir)/parser/parser.c: $(srcdir)/parser/zephir.c $(srcdir)/parser/base.c
4848
echo "#line 1 \"$(top_srcdir)/parser/base.c\"" >> $@
4949
cat $(top_srcdir)/parser/base.c >> $@
5050

51-
$(srcdir)/parser/zephir.c: $(srcdir)/parser/zephir.lemon $(srcdir)/parser/lemon
51+
$(srcdir)/parser/zephir.c: $(srcdir)/parser/zephir.lemon $(srcdir)/parser/lemon patch-libtool
5252
$(top_srcdir)/parser/lemon $<
5353

54+
# For more see: https://stackoverflow.com/q/49476206
55+
.PHONY: patch-libtool
56+
patch-libtool: $(srcdir)/libtool
57+
$(AWK) '/case \$$p in/{print;print "\t *.gcno)\n\t ;;";next}1' $^ > $^.tmp && mv $^.tmp $^
58+
chmod +x $^

0 commit comments

Comments
 (0)