0

I'm working on some tests and I'm using lcov In order to correctly manage the coverage of all tests, my makefile:

  1. compile each test
  2. launch the test
  3. generate the .info file using geninfo
  4. delete *.gcda, *.gcno

When this is made for all tests, I want to generate the whole coverage by calling: lccov --add-tracefile <name>.info -o global_coverage.info

However, it seems that I need to indicate all .info file by --add-tracefile <name>.info

Ex: if I've file1.info and file2.info, I need to call: lccov --add-tracefile file1.info --add-tracefile file2.info -o global_coverage.info

I can retrieve the list of all .info file by

# Get all .info file for coverag
INFO_FILES = $(wildcard $(TEST_BUILD_DIR)/*.info)

Is there a generic way to call this lcov tool by indicating all .info file ?

Thanks

Fred74
  • 3
  • 1

1 Answers1

0

You can use this:

# Get all .info file for coverag
INFO_FILES := $(wildcard $(TEST_BUILD_DIR)/*.info)

global_coverage.info: $(INFO_FILES)
        lccov $(addprefix --add-tracefile ,$^) -o $@
MadScientist
  • 92,819
  • 9
  • 109
  • 136