From de6cbac3c4e44de797bc2a4755fb765cf5a49f55 Mon Sep 17 00:00:00 2001 From: Paul Fagerburg Date: Tue, 11 May 2021 09:56:48 -0600 Subject: tests: improve code coverage support Fix the exclusion path for lcov; it should exclude the directory with source code, not object files. Use the COV environment variable to * control whether we build for coverage or not * select the output directory Add a separate target for generating the report, so we can get a report for all of the tests together or just a single test. Add documentation. Signed-off-by: Paul Fagerburg Change-Id: I2bd2bfdedfab291aabeaa968c10b17e9b61c9c0a Reviewed-on: https://review.coreboot.org/c/coreboot/+/54072 Tested-by: build bot (Jenkins) Reviewed-by: Jakub Czapiga --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e25c081ac8..ea196c961a 100644 --- a/Makefile +++ b/Makefile @@ -124,8 +124,8 @@ ifneq ($(filter help%, $(MAKECMDGOALS)), ) NOCOMPILE:=1 UNIT_TEST:=1 else -ifneq ($(filter %-test %-tests, $(MAKECMDGOALS)),) -ifneq ($(filter-out %-test %-tests, $(MAKECMDGOALS)),) +ifneq ($(filter %-test %-tests %coverage-report, $(MAKECMDGOALS)),) +ifneq ($(filter-out %-test %-tests %coverage-report, $(MAKECMDGOALS)),) $(error Cannot mix unit-tests targets with other targets) endif UNIT_TEST:=1 -- cgit v1.2.3