Skip to content

Commit 9bae50c

Browse files
author
Sebastiano Merlino
committed
Including shared lib in gcov analysis
1 parent e1e0312 commit 9bae50c

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ script:
2424
- mkdir build
2525
- cd build
2626
- if [ $DEBUG = "debug" ]; then ../configure --enable-debug; else ../configure; fi
27-
- make
28-
- make check
27+
- if [ $DEBUG = "debug" ]; then make check; else make; make check; fi
2928
after_success:
30-
- cp -R ../src/* ./src/
31-
- cp -R ../src/details/* ./src/details/
32-
- cp -R ../src/httpserver/* ./src/httpserver/
33-
- cp -R ../test/* ./test/
34-
- cp -R ../test/integ/* ./test/integ/
35-
- cp -R ../test/unit/* ./test/unit/
3629
- if [ $DEBUG = "debug" ]; then ../ci-report-coverage; fi
3730
matrix:
3831
exclude:

ci-report-coverage

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,15 @@
33
export EXCLUDE_COVERAGE="--exclude .libs"
44

55
find ../ -name *.gcda
6+
7+
echo "Copying files to the correct locations for correct gcov analysis"
8+
cp -R ../src/* ./src/
9+
cp -R ../src/details/* ./src/details/
10+
cp -R ../src/httpserver/* ./src/httpserver/
11+
cp -R ./src/.libs/*.gcda ./src/
12+
cp -R ../test/* ./test/
13+
cp -R ../test/integ/* ./test/integ/
14+
cp -R ../test/unit/* ./test/unit/
15+
616
echo "Sending coveralls json report"
717
coveralls $EXCLUDE_COVERAGE --gcov-options '\-lp'

src/Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ nobase_include_HEADERS = httpserver.hpp httpserver/create_webserver.hpp httpserv
2525

2626
AM_CXXFLAGS += -fPIC -Wall
2727

28+
if COND_GCOV
29+
AM_CFLAGS += -O0 --coverage
30+
AM_CXXFLAGS += -O0 --coverage
31+
AM_LDFLAGS += -O0 --coverage -lgcov
32+
endif
33+
2834
libhttpserver_la_LIBADD = -lmicrohttpd
2935
libhttpserver_la_CFLAGS = $(AM_CFLAGS)
3036
libhttpserver_la_CXXFLAGS = $(AM_CXXFLAGS)

0 commit comments

Comments
 (0)