Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code coverage reporting during build process #14

Merged
merged 2 commits into from
Mar 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions .yams/cpp_rules.min
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,34 @@ $(Test_Dir)/%_q: $(Test_Dir)/%.c
ifdef CLANG_FORMAT
@$(CLANG_FORMAT) $<
endif
@$(CC) $< -o $@ $(Module_Test_C_Flags) -L/usr/local/lib $($(*F)_FLAGS) -fprofile-arcs -ftest-coverage -fprofile-dir="$(Test_Dir)"
@$(CC) $< -o $@ $(Module_Test_C_Flags) -L/usr/local/lib $($(*F)_FLAGS) -fprofile-arcs -ftest-coverage
ifdef CPPCHECK
@$(CPPCHECK) $(Module_Test_Includes) $($(*F)_Inc_FLAGS) $<
endif
@mv $(*F).gc* $(Test_Dir)
@echo "Building tests <= $<"

$(Test_Dir)/%_q: $(Test_Dir)/%.cpp
ifdef CLANG_FORMAT
@$(CLANG_FORMAT) $<
endif
@$(CXX) $< -o $@ $(Module_Test_C_Flags) -L/usr/local/lib $($(*F)_FLAGS) -fprofile-arcs -ftest-coverage -fprofile-dir="$(Test_Dir)"
@$(CXX) $< -o $@ $(Module_Test_C_Flags) -L/usr/local/lib $($(*F)_FLAGS) -fprofile-arcs -ftest-coverage
ifdef CPPCHECK
@$(CPPCHECK) $(Module_Test_Includes) $($(*F)_Inc_FLAGS) $<
endif
@mv $(*F).gc* $(Test_Dir)
@echo "Building tests <= $<"

run_tests: $(Tests_C_Exe) $(Tests_CPP_Exe)
@echo "Running tests <= $<"
@$(foreach f,$^,$(VALGRIND) ./$(f);)
ifneq ($(and $(GCOV),$(Tests_C_Files)),)
@$(GCOV) $(Tests_C_Files)
@$(GCOV) $(notdir $(Tests_C_Files))
endif
ifneq ($(and $(GCOV),$(Tests_CPP_Files)),)
@$(GCOV) $(Tests_CPP_Files)
@$(GCOV) $(notdir $(Tests_CPP_Files))
endif

my_clean:
@rm -f $(C_Objects) $(CPP_Objects)
@rm -f *.gcda *.gcno *.gcov
@rm -f $(Tests_C_Exe) $(Tests_CPP_Exe) $(Test_Dir)/*.gcda $(Test_Dir)/*.gcno $(Test_Dir)/*.gcov
@rm -rf $(Test_Dir)/*.dSYM