Code coverage reporting utility
This commit is contained in:
parent
0eeb21c885
commit
c8acceb329
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.ccls-cache
|
||||
bin/*
|
||||
compile_commands.json
|
||||
coverage
|
||||
|
13
Makefile
13
Makefile
@ -1,6 +1,6 @@
|
||||
MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
|
||||
CXXFLAGS=-std=c++20 -Wall -Wextra -O2 -Werror=switch
|
||||
CPPFLAGS=-Ilib/expected/ -Ilib/ut/ -Isrc/
|
||||
CXXFLAGS:=$(CXXFLAGS) -std=c++20 -Wall -Wextra -Werror=switch
|
||||
CPPFLAGS:=$(CPPFLAGS) -Ilib/expected/ -Ilib/ut/ -Isrc/
|
||||
|
||||
Obj=bin/errors.o \
|
||||
bin/lexer.o \
|
||||
@ -9,7 +9,6 @@ Obj=bin/errors.o \
|
||||
|
||||
all: bin/musique bin/unit-tests
|
||||
|
||||
|
||||
bin/%.o: src/%.cc src/*.hh
|
||||
g++ $(CXXFLAGS) $(CPPFLAGS) -o $@ $< -c
|
||||
|
||||
@ -20,6 +19,14 @@ bin/musique: $(Obj) bin/main.o src/*.hh
|
||||
unit-tests: bin/unit-tests
|
||||
./$<
|
||||
|
||||
unit-test-coverage:
|
||||
CXXFLAGS=--coverage $(MAKE) bin/unit-tests -B
|
||||
bin/unit-tests
|
||||
rm -rf coverage
|
||||
mkdir coverage
|
||||
gcovr -e '.*\.hpp' --html --html-details -o coverage/index.html
|
||||
rm -rf bin
|
||||
|
||||
bin/unit-tests: src/tests/*.cc $(Obj)
|
||||
g++ $(CXXFLAGS) $(CPPFLAGS) -o $@ $^
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user