diff --git a/test/pc/.gitignore b/test/pc/.gitignore index b408773..78a9397 100644 --- a/test/pc/.gitignore +++ b/test/pc/.gitignore @@ -1,3 +1,5 @@ *.d *.o test +coverage.info +lcov/ diff --git a/test/pc/Makefile b/test/pc/Makefile index 013d670..b3a670f 100644 --- a/test/pc/Makefile +++ b/test/pc/Makefile @@ -6,11 +6,11 @@ OFILES := $(addprefix build/,$(CXXFILES:.cpp=.o)) \ $(patsubst ../../source/maths/%,build/%,$(CFILES:.c=.o)) DFILES := $(wildcard build/*.d) -CFLAGS := -Wall -g -pipe -I../../include +CFLAGS := -Wall -g -pipe -I../../include --coverage CXXFLAGS := $(CFLAGS) -std=gnu++11 -DGLM_FORCE_RADIANS -LDFLAGS := $(ARCH) -pipe -lm +LDFLAGS := $(ARCH) -pipe -lm --coverage -.PHONY: all clean +.PHONY: all clean lcov all: $(TARGET) @@ -18,6 +18,11 @@ $(TARGET): $(OFILES) @echo "Linking $@" $(CXX) -o $@ $^ $(LDFLAGS) +lcov: all + @./$(TARGET) + @lcov --capture --no-external --directory ../../include --directory ../../source --directory ../../test/pc --output-file coverage.info + @genhtml coverage.info --output-directory lcov + $(OFILES): | build build: @@ -32,6 +37,6 @@ build/%.o : ../../source/maths/%.c $(wildcard *.h) @$(CC) -o $@ -c $< $(CFLAGS) -MMD -MP -MF build/$*.d clean: - $(RM) -r $(TARGET) build/ + $(RM) -r $(TARGET) build/ coverage.info lcov/ -include $(DFILES)