From 40a9b739c640b4944289ec19d5efaee5b30f995c Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Thu, 16 May 2019 14:38:25 +1200 Subject: Makefile: add lcov command A helper cmd to generate .info file from .gcno and .gcda file, and then generate html report from .info file. Usage: ./configure --enable-coverage make -j make test TESTS=mytest make lcov Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d456a410050..07b928e4f01 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,19 @@ subunit-test: testenv: $(WAF) test --testenv $(TEST_OPTIONS) +lcov: + @echo usage: + @echo "" + @echo ./configure --enable-coverage + @echo make -j + @echo make test TESTS=mytest + @echo make lcov + @echo "" + rm -f lcov.info + lcov --capture --directory . --output-file lcov.info && \ + genhtml lcov.info --output-directory public --prefix=$$(pwd) && \ + echo Please open public/index.html in browser to view the coverage report + gdbtestenv: $(WAF) test --testenv --gdbtest $(TEST_OPTIONS) -- cgit v1.2.1