Skip to content

Commit 1a4ba72

Browse files
committed
Add travis and coveralls support
Also include a lcov-local target that uses "gethtml" to generate the reports
1 parent d2245c7 commit 1a4ba72

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.llvm-cov.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
#
3+
4+
# Stupid stuff
5+
# first executed with -v to get the version number - which xcodes gcov doesn't support
6+
# then executed normally
7+
if [ "$1" = "-v" ]; then
8+
echo "llvm-cov-wrapper 4.2.1"
9+
exit 0
10+
else
11+
gcov $*
12+
fi
13+

.travis.scripts/compile.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
sudo apt-get install gdb
3+
phpize
4+
./configure --enable-developer-flags --enable-coverage --quiet
5+
make all install
6+
7+
if [ $? -ne 0 ]; then
8+
exit 42
9+
fi
10+
11+
echo "extension=phongo" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
12+
13+
MONGO=`which mongo`
14+
mongod --version
15+
ls $MONGO*
16+
pwd

.travis.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: php
2+
php:
3+
- '5.6'
4+
- '5.5'
5+
- '5.4'
6+
- '5.3'
7+
8+
services:
9+
- mongodb
10+
11+
env:
12+
global:
13+
- TEST_PHP_ARGS="-q -g XFAIL,FAIL,BORK,WARN,LEAK,SKIP -x --show-diff"
14+
- REPORT_EXIT_STATUS=1
15+
- secure: uOPk40++5SqPwsvENvQXKy3sJmOYFoPxTSPpoafbus9teEqe3S0mXAv6leSUSH4K/vk1OoPFp2xjKRVkdBTeqTElna1DDWOuYlvli9PLSvyZ+b1bV+8Ap18BxqlYhd3tHrY7tIliOsh6dZplWF9GyUm9DWBZ/80uKUidh/Brg/Y=
16+
17+
before_install:
18+
- sudo pip install cpp-coveralls
19+
20+
before_script:
21+
- "./.travis.scripts/compile.sh"
22+
23+
notifications:
24+
email:
25+
26+
27+
script:
28+
- make test coveralls

Makefile.frag

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: coverage
2+
3+
DATE=`date +%Y-%m-%d--%H-%M-%S`
4+
5+
mv-coverage:
6+
@if test -e $(top_srcdir)/coverage; then \
7+
echo "Moving previous coverage run to coverage-$(DATE)"; \
8+
mv coverage coverage-$(DATE); \
9+
fi
10+
11+
lcov-coveralls:
12+
lcov --gcov-tool $(top_srcdir)/.llvm-cov.sh --capture --directory . --output-file .coverage.lcov --no-external
13+
14+
lcov-local:
15+
lcov --gcov-tool $(top_srcdir)/.llvm-cov.sh --capture --derive-func-data --directory . --output-file .coverage.lcov --no-external
16+
17+
coverage: mv-coverage lcov-local
18+
genhtml .coverage.lcov --legend --title "phongo code coverage" --output-directory coverage
19+
20+
21+
coveralls: mv-coverage lcov-coveralls
22+
coveralls --exclude lib --exclude tests
23+

0 commit comments

Comments
 (0)