Skip to content

Commit fc68552

Browse files
committed
Created valgrind suppression file for PHP >= 7.2
1 parent 5380b1b commit fc68552

File tree

6 files changed

+1069
-27
lines changed

6 files changed

+1069
-27
lines changed

.travis.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,7 @@ install:
5858
- bash ./install-development --phpize $(phpenv which phpize) --php-config $(phpenv which php-config)
5959

6060
script:
61-
- |
62-
valgrind \
63-
--read-var-info=yes \
64-
--error-exitcode=1 \
65-
--fullpath-after= \
66-
--track-origins=yes \
67-
--leak-check=full \
68-
--num-callers=20 \
69-
--run-libc-freeres=no \
70-
--suppressions=$(pwd)/tests/php-leaks.supp \
71-
$(phpenv which php) \
72-
-d variables_order=EGPCS \
73-
run-tests.php \
74-
-p $(which php) \
75-
-d extension=$(pwd)/modules/zephir_parser.so \
76-
-d variables_order=EGPCS \
77-
-g "FAIL,XFAIL,BORK,WARN,SKIP" \
78-
--offline \
79-
--show-diff \
80-
--set-timeout 120
61+
- bash ${TRAVIS_BUILD_DIR}/tests/ci/run-tests.sh
8162

8263
addons:
8364
apt:

tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.sh
2+
!ci/run-tests.sh
23
*.out
34
*.exp
45
*.diff

tests/ci/install-travis

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Zephir Parser
44
#
5-
# Copyright (c) 2013-2017 Zephir Team and contributors
5+
# Copyright (c) 2013-present Zephir Team and contributors
66
#
77
# This source file is subject the MIT license, that is bundled with
88
# this package in the file LICENSE, and is available through the
@@ -15,12 +15,6 @@
1515

1616
set -e
1717

18-
# Ensure that this is being run inside a CI container
19-
#if [ "${CI}" != "true" ]; then
20-
#echo "This script is designed to run inside a CI container only. Exiting"
21-
#exit 1
22-
#fi
23-
2418
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
2519

2620
CC=${CC:-gcc}

tests/ci/run-tests.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Zephir Parser
4+
#
5+
# Copyright (c) 2013-present Zephir Team and contributors
6+
#
7+
# This source file is subject the MIT license, that is bundled with
8+
# this package in the file LICENSE, and is available through the
9+
# world-wide-web at the following url:
10+
# http://zephir-lang.com/license.html
11+
#
12+
# If you did not receive a copy of the MIT license and are unable
13+
# to obtain it through the world-wide-web, please send a note to
14+
# [email protected] so we can mail you a copy immediately.
15+
16+
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
17+
18+
PHP_MAJOR="$(`phpenv which php` -r 'echo phpversion();' | cut -d '.' -f 1)"
19+
PHP_MINOR="$(`phpenv which php` -r 'echo phpversion();' | cut -d '.' -f 2)"
20+
21+
if [ "${PHP_MAJOR}.${PHP_MINOR}" = "7.2" ] || [ "${PHP_MAJOR}.${PHP_MINOR}" = "7.3" ]; then
22+
export PHP_LEAKS_SUPPRESSION_FILE=${CURRENT_DIR}/../php-travis-leaks.supp
23+
else
24+
export PHP_LEAKS_SUPPRESSION_FILE=${CURRENT_DIR}/../php-leaks.supp
25+
fi
26+
27+
valgrind \
28+
--read-var-info=yes \
29+
--error-exitcode=1 \
30+
--fullpath-after= \
31+
--track-origins=yes \
32+
--leak-check=full \
33+
--num-callers=20 \
34+
--run-libc-freeres=no \
35+
--suppressions=${PHP_LEAKS_SUPPRESSION_FILE} \
36+
$(phpenv which php) \
37+
-d variables_order=EGPCS \
38+
run-tests.php \
39+
-p $(phpenv which php) \
40+
-d extension=${CURRENT_DIR}/../../modules/zephir_parser.so \
41+
-d variables_order=EGPCS \
42+
-g "FAIL,XFAIL,BORK,WARN,SKIP" \
43+
--offline \
44+
--show-diff \
45+
--set-timeout 120

tests/php-ng-leaks.supp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
<insert_a_suppression_name_here>
3+
Memcheck:Cond
4+
obj:*
5+
obj:*
6+
obj:*
7+
obj:*
8+
obj:*
9+
obj:*
10+
}
11+
{
12+
<insert_a_suppression_name_here>
13+
Memcheck:Leak
14+
match-leak-kinds: definite
15+
fun:malloc
16+
fun:__zend_malloc
17+
fun:zend_string_alloc
18+
fun:zend_string_init
19+
fun:cli_register_file_handles
20+
fun:do_cli
21+
fun:main
22+
}
23+
{
24+
<insert_a_suppression_name_here>
25+
Memcheck:Leak
26+
match-leak-kinds: definite
27+
fun:malloc
28+
fun:__zend_malloc
29+
fun:zend_string_alloc
30+
fun:zend_string_init
31+
fun:cli_register_file_handles
32+
fun:do_cli
33+
fun:main
34+
}
35+
{
36+
<insert_a_suppression_name_here>
37+
Memcheck:Leak
38+
match-leak-kinds: definite
39+
fun:malloc
40+
fun:__zend_malloc
41+
fun:zend_string_alloc
42+
fun:zend_string_init
43+
fun:cli_register_file_handles
44+
fun:do_cli
45+
fun:main
46+
}

0 commit comments

Comments
 (0)