Skip to content

Commit 650335b

Browse files
committed
Merge pull request #736
2 parents 687c359 + 82516b3 commit 650335b

15 files changed

+638
-131
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
acinclude.m4
77
aclocal.m4
88
autom4te.cache
9-
build
9+
/build
1010
config.guess
1111
config.h
1212
config.h.in
@@ -49,7 +49,7 @@ php.ini
4949
!.github/
5050
!tests/utils/*.php
5151
!.travis.yml
52-
!.travis.scripts/*
52+
!.travis.scripts/
5353

5454

5555
!scripts

.travis.scripts/before_install.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
4+
# https://github.com/eddyxu/cpp-coveralls#linux
5+
pip install --user cpp-coveralls
6+
fi
7+
8+
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
9+
brew update
10+
brew upgrade
11+
12+
brew tap homebrew/homebrew-php
13+
brew install "${PHP_VERSION}"
14+
15+
# http://brewformulas.org/Lcov
16+
brew install lcov
17+
18+
# https://github.com/eddyxu/cpp-coveralls#os-x
19+
brew install pyenv
20+
eval "$(pyenv init -)"
21+
pyenv install 2.7.6
22+
pyenv global 2.7.6
23+
pyenv rehash
24+
pip install cpp-coveralls
25+
pyenv rehash
26+
fi

.travis.scripts/before_script.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
CONFIGURE_OPTS="--enable-developer-flags --enable-coverage"
4+
5+
if [ -n "${SSL_VERSION}" ]; then
6+
CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-mongodb-ssl=${SSL_VERSION}"
7+
fi
8+
9+
phpize
10+
./configure ${CONFIGURE_OPTS}
11+
make all -j4
12+
make install
13+
14+
# Add the extension to php.ini
15+
echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
16+
17+
# Predefine the test server
18+
echo '{"STANDALONE": "mongodb:\/\/127.0.0.1:27017"}' > /tmp/PHONGO-SERVERS.json

.travis.scripts/compile.sh

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

.travis.scripts/debug-core.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/sh
22

3-
PHP=/home/travis/.phpenv/versions/`php -r 'echo PHP_VERSION;'`/bin/php
4-
echo "backtrace full" | gdb $PHP $1
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
58

9+
PHP_BINARY=`which php`
10+
gdb -batch -ex "bt full" -ex "quit" "${PHP_BINARY}" "${1}"

.travis.scripts/debug-diff.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
EXP=`echo $1 | sed 's/.diff$/.exp/'`
4+
OUT=`echo $1 | sed 's/.diff$/.out/'`
5+
SEP="--------------------------------------------------------------------------------"
6+
7+
echo $EXP
8+
echo $SEP
9+
cat $EXP; echo
10+
echo $SEP; echo
11+
12+
echo $OUT
13+
echo $SEP
14+
cat $OUT; echo
15+
echo $SEP; echo

.travis.scripts/debug-script.sh

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

.travis.yml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
language: php
2-
php:
3-
- 7.2
4-
- 7.1
5-
- 7.0
6-
- 5.6
7-
- 5.5
2+
3+
addons:
4+
apt:
5+
packages:
6+
- gdb
7+
- lcov
8+
9+
matrix:
10+
include:
11+
- os: linux
12+
dist: trusty
13+
sudo: false
14+
php: 5.5
15+
- os: linux
16+
dist: trusty
17+
sudo: false
18+
php: 5.6
19+
- os: linux
20+
dist: trusty
21+
sudo: false
22+
php: 7.0
23+
- os: linux
24+
dist: trusty
25+
sudo: false
26+
php: 7.1
27+
- os: linux
28+
dist: trusty
29+
sudo: false
30+
php: 7.2
831

932
services:
1033
- mongodb
@@ -13,24 +36,15 @@ env:
1336
global:
1437
- TEST_PHP_ARGS="-q -s output.txt -g XFAIL,FAIL,BORK,WARN,LEAK,SKIP -x --show-diff"
1538
- REPORT_EXIT_STATUS=1
16-
- MONGODB_ORCHESTRATION="http://localhost:8889"
17-
- MONGODB_ORCHESTRATION_REPO="git+git://github.com/mongodb/mongo-orchestration@master"
18-
- MONGODB_ORCHESTRATION_PRESETS_ROOT=`pwd`
19-
- secure: "Dofd9NvXIKEat1PMiia3RQgNsJLaKtzZRf9rM4MsqFaBQPbJmVWPANJkayJPcK+l8pLxHyzzH7WqxML+SlBhBTHdJB++1woXxoVwm+sDdwSye6e+eXc3/zRUxb7zyItBZcvVp2tIJpx5kXJb+CoUQakbfWEQQFk4xrOF0R56+8Y="
20-
- secure: "pfGVPucvgcgcefhtzAVeejlpOtn4TnAqJSTM8mJkBl36KdU9P7hMuD3czQ4drWgzZ373/VT5UVhLu/HNsdbW0YBTeqPKJ4YNjqVVLytI8xT7y2Lw9l+I7o93j98TMgAoo8nVRmp/E4D6yutbKK1eddrcmf899R1iJbw8v8d1Ht8="
2139

2240
before_install:
23-
- sudo pip install --upgrade cpp-coveralls
24-
- sudo pip install ${MONGODB_ORCHESTRATION_REPO}
25-
- sudo apt-get update
26-
- sudo apt-get install gdb valgrind
27-
- sudo apt-get install cdbs debhelper build-essential python-lxml
41+
- .travis.scripts/before_install.sh
2842
- php -r 'if ( ! ($f = php_ini_loaded_file())) { $f = PHP_CONFIG_FILE_PATH . "/php.ini"; } file_put_contents($f, "variables_order=EGPCS\n", FILE_APPEND); $a = file($f, FILE_IGNORE_NEW_LINES); var_dump($a[count($a)-1]);'
2943

3044
before_script:
3145
- ulimit -a
3246
- ulimit -c unlimited || true
33-
- "./.travis.scripts/compile.sh"
47+
- .travis.scripts/before_script.sh
3448

3549
script:
3650
- make test
@@ -39,5 +53,5 @@ after_success:
3953
- make coveralls
4054

4155
after_failure:
42-
- find . -name \*core\* -exec ./.travis.scripts/debug-core.sh {} \;
43-
- find . -name \*diff -exec ./.travis.scripts/debug-script.sh {} \;
56+
- find . -name 'core*' -exec .travis.scripts/debug-core.sh {} \;
57+
- find . -name '*.diff' -exec .travis.scripts/debug-diff.sh {} \;

0 commit comments

Comments
 (0)