Add Makefile recipe for Valgrind builds
parent
9cf9f4235d
commit
c62e1ade6e
16
GNUmakefile
16
GNUmakefile
|
|
@ -444,6 +444,17 @@ CXXFLAGS += -coverage
|
|||
endif # -coverage
|
||||
endif # GCC code coverage
|
||||
|
||||
# Valgrind testing. Issue 'make valgrind'.
|
||||
ifneq ($(filter valgrind,$(MAKECMDGOALS)),)
|
||||
# Tune flags; see http://valgrind.org/docs/manual/quick-start.html
|
||||
CXXFLAGS := $(CXXFLAGS:-g%=-g3)
|
||||
CXXFLAGS := $(CXXFLAGS:-O%=-O1)
|
||||
CXXFLAGS := $(CXXFLAGS:-xO%=-xO1)
|
||||
ifeq ($(findstring -DCRYPTOPP_VALGRIND,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -DCRYPTOPP_VALGRIND
|
||||
endif # -DCRYPTOPP_VALGRIND
|
||||
endif # Valgrind
|
||||
|
||||
# Debug testing on GNU systems. Triggered by -DDEBUG.
|
||||
# Newlib test due to http://sourceware.org/bugzilla/show_bug.cgi?id=20268
|
||||
ifneq ($(filter -DDEBUG -DDEBUG=1,$(CXXFLAGS)),)
|
||||
|
|
@ -580,6 +591,11 @@ coverage: libcryptopp.a cryptest.exe
|
|||
lcov --remove cryptest.info "adhoc.cpp" "wait.*" "network.*" "socketft.*" "fips140.*" "*test.*" "bench*.cpp" "validat*.*" "/usr/*" -o cryptest.info
|
||||
genhtml -o ./TestCoverage/ -t "cryptest.exe test coverage" --num-spaces 4 cryptest.info
|
||||
|
||||
# SHould use CXXFLAGS="-g3 -O1"
|
||||
.PHONY: valgrind
|
||||
valgrind: libcryptopp.a cryptest.exe
|
||||
valgrind ./cryptest.exe v
|
||||
|
||||
.PHONY: test check
|
||||
test check: cryptest.exe
|
||||
./cryptest.exe v
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ bool ValidateHashDRBG();
|
|||
bool ValidateHmacDRBG();
|
||||
|
||||
// If CRYPTOPP_DEBUG or CRYPTOPP_COVERAGE is in effect, then perform additional tests
|
||||
#if (defined(CRYPTOPP_DEBUG) || defined(CRYPTOPP_COVERAGE)) && !defined(CRYPTOPP_IMPORTS)
|
||||
#if (defined(CRYPTOPP_DEBUG) || defined(CRYPTOPP_COVERAGE) || defined(CRYPTOPP_VALGRIND)) && !defined(CRYPTOPP_IMPORTS)
|
||||
# define CRYPTOPP_EXTENDED_VALIDATION 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue