Skip to content

Commit 7f165f5

Browse files
committed
Limit PHPUnit output and use PHPC script to print core dumps
1 parent 8151219 commit 7f165f5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ before_script:
6262
- ulimit -c unlimited -S
6363

6464
script:
65-
- ./vendor/bin/phpunit --debug || RESULT=$?
66-
- for i in $(find ./ -maxdepth 1 -name 'core*' -print); do gdb `php -r 'echo PHP_BINARY;'` core* -ex "thread apply all bt" -ex "set pagination 0" -batch; done;
67-
- if [[ ${RESULT} != 0 ]]; then exit $RESULT ; fi;
65+
- vendor/bin/phpunit -v
66+
67+
after_failure:
68+
- find . -name 'core*' -exec ${TRAVIS_BUILD_DIR}/.travis/debug-core.sh {} \;

.travis/debug-core.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
if [ "${TRAVIS_OS_NAME}" != "osx" ]; then
4+
# https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html
5+
echo "Cannot debug core files on macOS: ${1}"
6+
exit 1
7+
fi
8+
9+
PHP_BINARY=`which php`
10+
gdb -batch -ex "bt full" -ex "quit" "${PHP_BINARY}" "${1}"

0 commit comments

Comments
 (0)