0

There are a number of questions already on this subject, but despite that and the help on SourceForge, I cannot generate a .gcno or .gcda file.

sample question

2nd question

My make file compiles and runs my unit tests, but does not generate any output files. Is there something obviously wrong here? Commented out lines are things I have tried before.

CPP_PLATFORM = Gcc
#CPP_PLATFORM = Clang

#CPPUTEST_CPPFLAGS += -DSUPPRESS_PRINTING
#CPPUTEST_CPPFLAGS += -fprofile-arcs 
#CPPUTEST_CPPFLAGS += -ftest-coverage
#GCOVFLAGS = -fprofile-arcs -ftest-coverage

#CPPUTEST_LDFLAGS += -lssl  
#CPPUTEST_LDFLAGS += -lcrypto
#CPPUTEST_LDFLAGS += -fprofile-arcs

CPPUTEST_CPPFLAGS = -DSUPPRESS_PRINTING
CPPUTEST_CPPFLAGS = -fprofile-arcs:$(CPPUTEST_CPPFLAGS)
CPPUTEST_CPPFLAGS = -ftest-coverage:$(CPPUTEST_CPPFLAGS)
CPPUTEST_LDFLAGS = -lssl
CPPUTEST_LDFLAGS = -lcrypto:$(CPPUTEST_LDFLAGS)
CPPUTEST_LDFLAGS = -fprofile-arcs:$(CPPUTEST_LDFLAGS)
Community
  • 1
  • 1
MikeF
  • 764
  • 9
  • 26

1 Answers1

0
CPPUTEST_CPPFLAGS += -g -O0 --coverage
#CPPUTEST_CPPFLAGS += -fprofile-arcs 
#CPPUTEST_CPPFLAGS += -ftest-coverage

CPPUTEST_LDFLAGS += -lprofile_rt

Either the -g -O0 --coverage or -fprofile-arcs -ftest-coverage along with the link flag do the trick. The key was the link flag.

MikeF
  • 764
  • 9
  • 26