From a2a5525ccf8a8f82e064b9b9ecfdb4d6fc930cad Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Fri, 6 Mar 2020 10:41:40 -0800 Subject: [PATCH 1/2] Fix code coverage reporting during build process --- .yams/cpp_rules.min | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.yams/cpp_rules.min b/.yams/cpp_rules.min index 78cc1bdd28bbd3..e88878f8654a61 100644 --- a/.yams/cpp_rules.min +++ b/.yams/cpp_rules.min @@ -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_C_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 From 876bed9cd6ac93f29797ec7beb9d8dab56c89d8d Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Fri, 6 Mar 2020 10:54:20 -0800 Subject: [PATCH 2/2] Fix CPP file list in make rules --- .yams/cpp_rules.min | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yams/cpp_rules.min b/.yams/cpp_rules.min index e88878f8654a61..50ece4a0c9d620 100644 --- a/.yams/cpp_rules.min +++ b/.yams/cpp_rules.min @@ -71,7 +71,7 @@ ifneq ($(and $(GCOV),$(Tests_C_Files)),) @$(GCOV) $(notdir $(Tests_C_Files)) endif ifneq ($(and $(GCOV),$(Tests_CPP_Files)),) - @$(GCOV) $(notdir $(Tests_C_Files)) + @$(GCOV) $(notdir $(Tests_CPP_Files)) endif my_clean: