Browse Source

running all tests in the end to get a combined coverage report

stefan 9 months ago
parent
commit
a78091f623
1 changed files with 14 additions and 0 deletions
  1. 14 0
      makefile

+ 14 - 0
makefile

@@ -14,6 +14,11 @@ INTEGRATIONTEST_C_OBJ_DIR := $(INTEGRATIONTEST_CPP_OBJ_DIR)
 INTEGRATIONTEST_AUTH_C_OBJ_DIR := $(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)
 INTEGRATIONTEST_AUTH_C_OBJ_DIR := $(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)
 UNITTEST_OBJ_DIR := $(OBJ_DIR)test/unittest/
 UNITTEST_OBJ_DIR := $(OBJ_DIR)test/unittest/
 
 
+define \n
+
+
+endef
+
 CC  := gcc
 CC  := gcc
 CPP := g++
 CPP := g++
 LN  := ln
 LN  := ln
@@ -108,6 +113,15 @@ help:
 	@echo -----------------------------------------------
 	@echo -----------------------------------------------
 
 
 test: $(TEST_RUN_TARGETS)
 test: $(TEST_RUN_TARGETS)
+	- @mkdir -p output/test/report
+# run the test alltogether to get coverage from all combined tests
+#	remove coverage from former run
+	@-find . -name "*.gcda" -type f -delete
+	$(foreach TEST_RUN_TARGET,$(TEST_RUN_TARGETS),./$(OBJ_DIR)test/$(TEST_RUN_TARGET)/$(TEST_RUN_TARGET)${\n})
+
+#	remove report from former run
+	-rm -rf $(OBJ_DIR)test/report/*
+	gcovr --html-details --output $(OBJ_DIR)test/report/report.html -f src -f api -d
 
 
 cppcheck:
 cppcheck:
 	- @mkdir -p output/cppcheck/html
 	- @mkdir -p output/cppcheck/html