mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-27 10:54:55 +01:00
coverage: Enable compilation with --coverage
Setting the environment variable `COVERAGE=1` allows us to turn coverage measurements on. This produces a number of auxiliary gcno and gcda files which can then be converted into coverage reports. I know line coverage and branch coverage is not a perfect metric, but it might get us some more visibility into where more tests might be needed.
This commit is contained in:
committed by
Rusty Russell
parent
af43cc5e2c
commit
bd6b9c377e
8
Makefile
8
Makefile
@@ -19,6 +19,10 @@ VALGRIND=valgrind -q --error-exitcode=7
|
||||
VALGRIND_TEST_ARGS = --track-origins=yes --leak-check=full --show-reachable=yes
|
||||
endif
|
||||
|
||||
ifeq ($(COVERAGE),1)
|
||||
COVFLAGS = --coverage
|
||||
endif
|
||||
|
||||
# This is where we add new features as bitcoin adds them.
|
||||
FEATURES :=
|
||||
|
||||
@@ -194,9 +198,9 @@ PROGRAMS := $(TEST_PROGRAMS)
|
||||
|
||||
CWARNFLAGS := -Werror -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition
|
||||
CDEBUGFLAGS := -g -fstack-protector
|
||||
CFLAGS := $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) -I secp256k1/include/ -I . $(FEATURES)
|
||||
CFLAGS := $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) -I secp256k1/include/ -I . $(FEATURES) $(COVFLAGS)
|
||||
|
||||
LDLIBS := -lprotobuf-c -lgmp -lsodium -lsqlite3
|
||||
LDLIBS := -lprotobuf-c -lgmp -lsodium -lsqlite3 $(COVFLAGS)
|
||||
$(PROGRAMS): CFLAGS+=-I.
|
||||
|
||||
default: $(PROGRAMS) $(MANPAGES) daemon-all
|
||||
|
||||
Reference in New Issue
Block a user