Skip to content

Commit 62a2a61

Browse files
committed
Use pure php tests
1 parent 097253b commit 62a2a61

29 files changed

+134
-706
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ tests/*/*.exp
4343
tests/*/*.log
4444
tests/*/*.sh
4545

46+
php_test_results_*
47+
4648
# Parser files
4749
parser/lemon
4850
parser/scanner.c
@@ -54,8 +56,4 @@ parser/parser.php7.c
5456
parser/parser.php7.h
5557
parser/parser.php7.out
5658

57-
vendor
58-
composer.lock
59-
phpunit.xml
60-
6159
release

.travis.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ matrix:
4040
cache:
4141
apt: true
4242
timeout: 691200
43-
directories:
44-
- vendor
45-
- $HOME/.composer/cache
4643

4744
install:
4845
- phpenv config-rm xdebug.ini || true
49-
- bash ./unit-tests/ci/install-travis
50-
- composer install --quiet --no-interaction --no-ansi --no-progress --optimize-autoloader --dev --prefer-dist --no-suggest --ignore-platform-reqs
51-
52-
before_install:
53-
- if [[ ! -z "${GH_TOKEN}" ]]; then composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"; fi;
46+
- bash ./install-development
5447

5548
script:
56-
- php --ri "Zephir Parser"
57-
- valgrind --read-var-info=yes --error-exitcode=1 --fullpath-after= --track-origins=yes --leak-check=full --num-callers=20 --suppressions=unit-tests/ci/zephir_parser.3.7.0.sup $(phpenv which php) ./unit-tests/phpunit -c phpunit.xml.dist --debug unit-tests/
49+
- valgrind --read-var-info=yes --error-exitcode=1 --fullpath-after= --track-origins=yes --leak-check=full --num-callers=20 --suppressions=$(pwd)/tests/zephir_parser.3.7.0.sup $(phpenv which php) -d variables_order=EGPCS run-tests.php -p $(which php) -d extension=$(pwd)/modules/zephir_parser.so -d variables_order=EGPCS -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
5850

5951
notifications:
6052
email:

composer.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

install-development

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,5 @@ ${PHPIZE_BIN}
160160

161161
make -j"$(getconf _NPROCESSORS_ONLN)"
162162

163-
make test NO_INTERACTION=1
164-
165-
echo
166-
167-
make install || sudo make install
168-
169-
echo
170-
171-
# Clean current compilation
172-
if [ -f Makefile ]; then
173-
make clean
174-
${PHPIZE_BIN} --clean
175-
fi
176-
177-
cd ${CURRENT_DIR}/parser
178-
179-
rm -f *.o *.lo
180-
181163
echo -e "\nThanks for compiling Zephir Parser!\nBuild succeed: Please restart your web server to complete the installation\n"
182164

phpunit.xml.dist

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/base/001.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
zephir_parse_file() - Tests class variables
3+
--SKIPIF--
4+
<?php require(__DIR__ . "/../zephir_parser_skip.inc"); ?>
5+
--FILE--
6+
<?php require(__DIR__ . "/../zephir_parser_test.inc");
7+
8+
$ir = parse_file("base/class_variables.zep");
9+
10+
echo count($ir[1]["definition"]["properties"]) . "\n";
11+
12+
foreach ($ir[1]["definition"]["properties"] as $property) {
13+
printf("[1/%d] %s %s %s\n", count($property["visibility"]), $property["visibility"][0], $property["type"], $property["name"]);
14+
}
15+
--EXPECT--
16+
3
17+
[1/1] public property foo
18+
[1/1] protected property bar
19+
[1/1] private property baz

0 commit comments

Comments
 (0)