Przeglądaj źródła

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

stefan 9 miesięcy temu
rodzic
commit
a78091f623
1 zmienionych plików z 14 dodań i 0 usunięć
  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)
 UNITTEST_OBJ_DIR := $(OBJ_DIR)test/unittest/
 
+define \n
+
+
+endef
+
 CC  := gcc
 CPP := g++
 LN  := ln
@@ -108,6 +113,15 @@ help:
 	@echo -----------------------------------------------
 
 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:
 	- @mkdir -p output/cppcheck/html