Skip to content

Commit

Permalink
Add gcov support
Browse files Browse the repository at this point in the history
  • Loading branch information
Austinpayne committed Apr 3, 2017
1 parent acc11d9 commit a070265
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ language: c
compiler:
- clang
- gcc
before_install:
- pip install --user urllib3[secure] cpp-coveralls
script: make test
after_success:
- coveralls --exclude unity --exclude json_unit_tests.c --gcov-options '\-lp'
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
CC=gcc
CFLAGS=-Wall -O2
CFLAGS=-Wall

json: json.c
$(CC) $(CFLAGS) -o json json.c

test_json: unity json.c json_unit_tests.c
$(CC) $(CFLAGS) -DTEST -o json_unit_tests ./unity/src/unity.c json.c json_unit_tests.c
$(CC) $(CFLAGS) -fprofile-arcs -ftest-coverage -DTEST -o json_unit_tests ./unity/src/unity.c json.c json_unit_tests.c
./json_unit_tests
gcov -lp json_unit_tests.c

unity:
wget https://github.com/ThrowTheSwitch/Unity/archive/master.zip
Expand All @@ -16,5 +17,5 @@ unity:
test: test_json

clean:
rm -r json_unit_tests json unity master.zip *~
rm -r json_unit_tests json unity master.zip *.gcov *.gcno *.gcda *~

0 comments on commit a070265

Please sign in to comment.