Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit 4e0fa77

Browse files
committed
Add gcov target that sets up for gcov
1 parent 2e0a618 commit 4e0fa77

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.travis.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@
2222

2323
language: cpp
2424

25+
before_install:
26+
- sudo pip install cpp-coveralls
27+
2528
compiler:
2629
- clang
2730
- gcc
2831

29-
script: make && make test
32+
script:
33+
make && make test && make gcov
34+
35+
after_success:
36+
- coveralls --exclude lib --exclude tests --gcov-options '\-lp'

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ SOURCES := $(shell find $(SRCDIR) -type f -name "*.$(SRCEXT)")
3333
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
3434
TESTSOURCES := $(shell find $(TESTDIR) -type f -name "*.$(SRCEXT)")
3535
TESTOBJECTS := $(patsubst $(TESTDIR)/%,$(BUILDDIR)/$(TESTDIR)/%,$(TESTSOURCES:.$(SRCEXT)=.o))
36-
CFLAGS := -g -Wall -pedantic -std=c++11
37-
CXXFLAGS := $(CFLAGS)
36+
CFLAGS := -g -Wall -pedantic -std=c1x
37+
CXXFLAGS := -g -Wall -pedantic -std=c++0x
3838
LDFLAGS :=
3939
INC := -I include
4040

@@ -61,6 +61,9 @@ $(BUILDDIR)/$(TESTDIR)/%.o: $(TESTDIR)/%.$(SRCEXT)
6161
@mkdir -p $(dir $@)
6262
$(CXX) $(CXXFLAGS) $(INC) -c -o $@ $<
6363

64+
gcov: clean
65+
$(MAKE) CXXFLAGS="$(CXXFLAGS) -g -O0 --coverage" LDFLAGS="-lgcov" all test
66+
6467
# make clean
6568
.PHONY: clean
6669
clean:

0 commit comments

Comments
 (0)