From 9d77448a2538c4bb5bda1ca6b8c9064bc9c1daaf Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 5 Apr 2023 23:04:22 +0200 Subject: [PATCH] Reduce optimization level to 0 Otherwise the coverage results are not reliable: * some uncovered lines are not reported as uncovered * some covered lines are reported as uncovered (!) --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 3f2637e6..4e14b2ee 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -68,7 +68,7 @@ all: awk ' printit { print } /END_COVERAGE/ { printit=1}' $< > $<.end.c $(CC) $(CPPFLAGS) -E -DNDEBUG -DWITHIN_COVERAGE $< |grep -v '^#' |awk ' /END_COVERAGE/ { printit=0} printit { print } /START_COVERAGE/ { printit=1 }' |perl -p -e "s/;(?![\"'])/;\n/g ; s/}(?![\"'])/}\n/g ; s/{(?![\"'])/{\n/g" > $<.middle.c cat $<.first.c $<.middle.c $<.end.c > $<.c - $(CC) $(CPPFLAGS) -DBUILD_COVERAGE -ftest-coverage -fprofile-arcs -O -g $<.c -o $<.exe $(LDFLAGS) + $(CC) $(CPPFLAGS) -DBUILD_COVERAGE -ftest-coverage -fprofile-arcs -O0 -g $<.c -o $<.exe $(LDFLAGS) $(LOG_COMPILER) ./$<.exe LANG=C gcov -b $<.gcno > `basename $< .c`.synt cat `basename $< .c`.synt