From 3718279e3b86ecb1dcd8fedcdc0388e16522c760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 08:17:05 +0200 Subject: [PATCH 1/8] FIX coverage_functional_test target to work with all tests --- CMakeLists.txt | 4 ++-- makefile | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7632d895d..47997bc75d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,12 +305,12 @@ link_directories("/usr/lib/x86_64-linux-gnu") # # Enabling test harness # -if (UNIT_TEST) +if (UNIT_TEST OR COVERAGE) ENABLE_TESTING() INCLUDE(Dart) SET (CMAKE_TEST_TIMEOUT 60) SET (DART_TIMEOUT 60) - #ADD_SUBDIRECTORY(test/harness) + ADD_SUBDIRECTORY(test/functionalTest/cases) endif (UNIT_TEST) # diff --git a/makefile b/makefile index 8e940023ae..172fcc3a80 100644 --- a/makefile +++ b/makefile @@ -74,7 +74,7 @@ prepare_debug: compile_info prepare_coverage: compile_info mkdir -p BUILD_COVERAGE || true - cd BUILD_COVERAGE && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DUNIT_TEST=True -DCOVERAGE=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) + cd BUILD_COVERAGE && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DCOVERAGE=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) prepare_unit_test: compile_info @echo '------------------------------- prepare_unit_test starts ---------------------------------' @@ -234,7 +234,6 @@ ftd: functional_test_debug test: unit_test functional_test coverage: install_coverage - # FIXME #4418: the functional test part of this target is not working properly. Check issue for details. # Init coverage echo "Initializing coverage files" mkdir -p coverage @@ -292,7 +291,6 @@ coverage_unit_test: build_unit_test genhtml -o coverage coverage/broker.info coverage_functional_test: install_coverage - # FIXME #4418: this target is not working properly. Check issue for details. # Init coverage echo "Initializing coverage files" mkdir -p coverage From 4c3e2f7ea0e3a42a5c1c78bc2d31846d04d9579b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 08:19:34 +0200 Subject: [PATCH 2/8] FIX rename .test file to avoid duplicated namefiles --- ...e_value.test => create_entity_with_empty_attribute_value.test} | 0 .../{restrict_chars_attr.test => restrict_chars_attr_in_ids.test} | 0 ...ct_chars_metadata.test => restrict_chars_metadata_in_ids.test} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/functionalTest/cases/0970_create_entity/{empty_attribute_value.test => create_entity_with_empty_attribute_value.test} (100%) rename test/functionalTest/cases/1601_restrict_chars_in_ids/{restrict_chars_attr.test => restrict_chars_attr_in_ids.test} (100%) rename test/functionalTest/cases/1601_restrict_chars_in_ids/{restrict_chars_metadata.test => restrict_chars_metadata_in_ids.test} (100%) diff --git a/test/functionalTest/cases/0970_create_entity/empty_attribute_value.test b/test/functionalTest/cases/0970_create_entity/create_entity_with_empty_attribute_value.test similarity index 100% rename from test/functionalTest/cases/0970_create_entity/empty_attribute_value.test rename to test/functionalTest/cases/0970_create_entity/create_entity_with_empty_attribute_value.test diff --git a/test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_attr.test b/test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_attr_in_ids.test similarity index 100% rename from test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_attr.test rename to test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_attr_in_ids.test diff --git a/test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_metadata.test b/test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_metadata_in_ids.test similarity index 100% rename from test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_metadata.test rename to test/functionalTest/cases/1601_restrict_chars_in_ids/restrict_chars_metadata_in_ids.test From 81a20a650fd1557a3291fa3702b83c800bc7adbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 09:15:38 +0200 Subject: [PATCH 3/8] FIX makefile and CMakeLists.txt --- CMakeLists.txt | 4 ++-- makefile | 15 ++++++++------- .../AppendContextElementRequest_test.cpp | 1 - .../ngsi10/UpdateContextResponse_test.cpp | 1 - .../DiscoverContextAvailabilityResponse_test.cpp | 1 - 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47997bc75d..9c922231cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,13 +305,13 @@ link_directories("/usr/lib/x86_64-linux-gnu") # # Enabling test harness # -if (UNIT_TEST OR COVERAGE) +if (COVERAGE AND NOT UNIT_TEST) ENABLE_TESTING() INCLUDE(Dart) SET (CMAKE_TEST_TIMEOUT 60) SET (DART_TIMEOUT 60) ADD_SUBDIRECTORY(test/functionalTest/cases) -endif (UNIT_TEST) +endif (COVERAGE AND NOT UNIT_TEST) # # Continuing if OK diff --git a/makefile b/makefile index 172fcc3a80..22e2bd9c25 100644 --- a/makefile +++ b/makefile @@ -77,10 +77,12 @@ prepare_coverage: compile_info cd BUILD_COVERAGE && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DCOVERAGE=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) prepare_unit_test: compile_info - @echo '------------------------------- prepare_unit_test starts ---------------------------------' + mkdir -p BUILD_UNITTEST || true + cd BUILD_UNITTEST && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DUNIT_TEST=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) + +prepare_unit_test_coverage: compile_info mkdir -p BUILD_UNITTEST || true cd BUILD_UNITTEST && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DUNIT_TEST=True -DCOVERAGE=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) - @echo '------------------------------- prepare_unit_test ended ---------------------------------' release: prepare_release cd BUILD_RELEASE && make -j$(CPU_COUNT) @@ -209,18 +211,17 @@ uncrustify_changed: git diff --name-only | grep "\.cpp\|\.h" | xargs uncrustify --no-backup -c scripts/uncrustify.cfg build_unit_test: prepare_unit_test - @echo '------------------------------- build_unit_test starts ---------------------------------' cd BUILD_UNITTEST && make -j$(CPU_COUNT) - @echo '------------------------------- build_unit_test ended ---------------------------------' + +build_unit_test_coverage: prepare_unit_test_coverage + cd BUILD_UNITTEST && make -j$(CPU_COUNT) unit_test: build_unit_test - @echo '------------------------------- unit_test starts ---------------------------------' if [ -z "${TEST_FILTER}" ]; then \ BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml; \ else \ BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml --gtest_filter=${TEST_FILTER}; \ fi - @echo '------------------------------- unit_test ended ---------------------------------' functional_test: install ./test/functionalTest/testHarness.sh @@ -266,7 +267,7 @@ coverage: install_coverage lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info genhtml -o coverage coverage/broker.info -coverage_unit_test: build_unit_test +coverage_unit_test: build_unit_test_coverage # Init coverage echo "Initializing coverage files" mkdir -p coverage diff --git a/test/unittests/convenience/AppendContextElementRequest_test.cpp b/test/unittests/convenience/AppendContextElementRequest_test.cpp index 88140f1c9f..fc7cc9fe5f 100644 --- a/test/unittests/convenience/AppendContextElementRequest_test.cpp +++ b/test/unittests/convenience/AppendContextElementRequest_test.cpp @@ -110,7 +110,6 @@ TEST(AppendContextElementRequest, release) AppendContextElementRequest acer; std::string out; ContextAttribute* caP = new ContextAttribute("caName", "caType", "121"); - Metadata* mdP = new Metadata("mdName", "mdType", "122"); acer.contextAttributeVector.push_back(caP); diff --git a/test/unittests/ngsi10/UpdateContextResponse_test.cpp b/test/unittests/ngsi10/UpdateContextResponse_test.cpp index d0613d01c4..1544fbdc9e 100644 --- a/test/unittests/ngsi10/UpdateContextResponse_test.cpp +++ b/test/unittests/ngsi10/UpdateContextResponse_test.cpp @@ -44,7 +44,6 @@ TEST(UpdateContextResponse, jsonRender) UpdateContextResponse* ucrP; ContextElementResponse* cerP; - Metadata* mdP; ContextAttribute* caP; std::string out; diff --git a/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp b/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp index 35b987f713..8fb0b75c38 100644 --- a/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp +++ b/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp @@ -95,7 +95,6 @@ TEST(DiscoverContextAvailabilityResponse, jsonRender) ContextRegistrationResponse* crrP; EntityId* eidP; ContextRegistrationAttribute* attrP; - Metadata* mdP; utInit(); From 0fb4368d1c1dd26b7e684d1fb55dfdd4b19acef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 13:46:35 +0200 Subject: [PATCH 4/8] REMOVE coverage (unit_test+fuctional_test) target in makefile --- doc/manuals/admin/build_source.md | 10 +++++++-- makefile | 35 +------------------------------ 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index e86a146047..526698a18e 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -145,6 +145,12 @@ You can generate coverage reports for the Orion Context Broker using the followi * Do first a successful pass for unit_test and functional_test, to check that everything is ok (see above) -* Run coverage +* Run coverage (based in functionalt tests execution, the recommented one): - make coverage INSTALL_DIR=~ + make coverage_functional_test INSTALL_DIR=~ + +* Run coverage (based in unit tests execution, not so good): + + make coverage_unit_test INSTALL_DIR=~ + +*NOTE*: In the past we have a `make coverage` target. But it has maintainability problems (as the one described [in this issue](https://github.com/telefonicaid/fiware-orion/issues/4418)) so we remove it. Note that the unit test are not so important in the current days (it was in the early Context Broker days), in favour of functional test, so it's contributo to coverage is not very signficative. \ No newline at end of file diff --git a/makefile b/makefile index 22e2bd9c25..4faa074143 100644 --- a/makefile +++ b/makefile @@ -234,39 +234,6 @@ ftd: functional_test_debug test: unit_test functional_test -coverage: install_coverage - # Init coverage - echo "Initializing coverage files" - mkdir -p coverage - lcov -i --zerocounters --directory BUILD_COVERAGE/ - lcov --capture --initial --directory BUILD_COVERAGE -b BUILD_COVERAGE --output-file coverage/broker.init.info - # Execute test for coverage - echo "Executing coverage test" - BUILD_COVERAGE/test/unittests/unitTest -t 0-255 --gtest_output=xml:BUILD_COVERAGE/unit_test.xml - if [ -z "${CONTEXTBROKER_TESTENV_SOURCED}" ]; then \ - echo "Execute '. scripts/testEnv.sh' before executing the tests"; \ - exit 1; \ - fi - make test -C BUILD_COVERAGE ARGS="-D ExperimentalTest" TEST_VERBOSE=1 || true - @if [ -e test/functionalTest/cases/*.diff ]; then \ - echo "A .diff file was found in test/functionalTest/cases, which means that ctest failed running the test. This can happen if a \"Ok\""; \ - echo "token is used in the tests specification. Run \"test/functionalTest/testHarness.sh test/functionalTest/cases\" manually to find the problem."; \ - exit 1; \ - fi - @xsltproc scripts/cmake2junit.xsl BUILD_COVERAGE/Testing/`cat BUILD_COVERAGE/Testing/TAG| head -n1`/Test.xml > BUILD_COVERAGE/functional_test.xml - # Generate test report - echo "Generating coverage report" - lcov --directory BUILD_COVERAGE --capture -b BUILD_COVERAGE --output-file coverage/broker.test.info - lcov --add-tracefile coverage/broker.init.info --add-tracefile coverage/broker.test.info --output-file coverage/broker.info - lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info - # Remove unit test libraries and libraries developed before contextBroker project init - lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info - genhtml -o coverage coverage/broker.info - coverage_unit_test: build_unit_test_coverage # Init coverage echo "Initializing coverage files" @@ -275,7 +242,7 @@ coverage_unit_test: build_unit_test_coverage lcov --capture --initial --directory BUILD_UNITTEST -b BUILD_UNITTEST --output-file coverage/broker.init.info # Execute test for coverage echo "Executing coverage test" - BUILD_UNITTEST/test/unittests/unitTest -t 0-255 --gtest_output=xml:BUILD_UNITTEST/unit_test.xml + BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml # Generate test report echo "Generating coverage report" lcov --directory BUILD_UNITTEST --capture -b BUILD_UNITTEST --output-file coverage/broker.test.info From 8f46ec108694f23613e72b47a1a80e72087f5c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 14:31:03 +0200 Subject: [PATCH 5/8] ADD recovered coverage makefile target --- doc/manuals/admin/build_source.md | 10 ++-------- makefile | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index 526698a18e..e86a146047 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -145,12 +145,6 @@ You can generate coverage reports for the Orion Context Broker using the followi * Do first a successful pass for unit_test and functional_test, to check that everything is ok (see above) -* Run coverage (based in functionalt tests execution, the recommented one): +* Run coverage - make coverage_functional_test INSTALL_DIR=~ - -* Run coverage (based in unit tests execution, not so good): - - make coverage_unit_test INSTALL_DIR=~ - -*NOTE*: In the past we have a `make coverage` target. But it has maintainability problems (as the one described [in this issue](https://github.com/telefonicaid/fiware-orion/issues/4418)) so we remove it. Note that the unit test are not so important in the current days (it was in the early Context Broker days), in favour of functional test, so it's contributo to coverage is not very signficative. \ No newline at end of file + make coverage INSTALL_DIR=~ diff --git a/makefile b/makefile index 4faa074143..2fa3581a2f 100644 --- a/makefile +++ b/makefile @@ -234,6 +234,25 @@ ftd: functional_test_debug test: unit_test functional_test +coverage: coverage_functional_test coverage_unit_test + rm -rf coverage + lcov --capture --directory BUILD_UNITTEST --output-file BUILD_UNITTEST/coverage.info + lcov --capture --directory BUILD_COVERAGE --output-file BUILD_COVERAGE/coverage.info + mkdir coverage + # Generate test report + echo "Generating coverage report" + lcov --add-tracefile BUILD_UNITTEST/coverage.info --add-tracefile BUILD_COVERAGE/coverage.info --output-file coverage/broker.info + lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info + lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info + lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info + # Remove unit test libraries and libraries developed before contextBroker project init + lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info + lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info + lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info + # app/ contains application itself, not libraries which make sense to measure unit_test coverage + lcov -r coverage/broker.info "*/src/app/*" -o coverage/broker.info + genhtml -o coverage coverage/broker.info + coverage_unit_test: build_unit_test_coverage # Init coverage echo "Initializing coverage files" From abe12d27f30d3fddd4d70bad3b3e76776a5a6be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 15:00:18 +0200 Subject: [PATCH 6/8] ADD CLEAN_COVERAGE_MACRO in makefile --- doc/manuals/admin/build_source.md | 2 ++ makefile | 41 ++++++++++++------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index e86a146047..e4ac040750 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -148,3 +148,5 @@ You can generate coverage reports for the Orion Context Broker using the followi * Run coverage make coverage INSTALL_DIR=~ + +*NOTE*: note that functional test relying in debug traces are expected to fail under coverage execution (this is due to the LM_T macros used by the debug traces are disabled in the coverage code building, due to they add "noise" in condition coverage, thus making coverage reports more useful). \ No newline at end of file diff --git a/makefile b/makefile index 2fa3581a2f..1ac77aca62 100644 --- a/makefile +++ b/makefile @@ -54,6 +54,19 @@ ifndef MONGO_HOST MONGO_HOST=localhost endif +# Macros +define CLEAN_COVERAGE_REPORT + lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info + lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info + lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info + # Remove unit test libraries and libraries developed before contextBroker project init + lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info + lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info + lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info + # app/ contains application itself, not libraries which make sense to measure unit_test coverage + lcov -r coverage/broker.info "*/src/app/*" -o coverage/broker.info +endef + all: prepare_release release di: install_debug @@ -242,15 +255,7 @@ coverage: coverage_functional_test coverage_unit_test # Generate test report echo "Generating coverage report" lcov --add-tracefile BUILD_UNITTEST/coverage.info --add-tracefile BUILD_COVERAGE/coverage.info --output-file coverage/broker.info - lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info - # Remove unit test libraries and libraries developed before contextBroker project init - lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info - # app/ contains application itself, not libraries which make sense to measure unit_test coverage - lcov -r coverage/broker.info "*/src/app/*" -o coverage/broker.info + $(CLEAN_COVERAGE_REPORT) genhtml -o coverage coverage/broker.info coverage_unit_test: build_unit_test_coverage @@ -266,15 +271,7 @@ coverage_unit_test: build_unit_test_coverage echo "Generating coverage report" lcov --directory BUILD_UNITTEST --capture -b BUILD_UNITTEST --output-file coverage/broker.test.info lcov --add-tracefile coverage/broker.init.info --add-tracefile coverage/broker.test.info --output-file coverage/broker.info - lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info - # Remove unit test libraries and libraries developed before contextBroker project init - lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info - # app/ contains application itself, not libraries which make sense to measure unit_test coverage - lcov -r coverage/broker.info "*/src/app/*" -o coverage/broker.info + $(CLEAN_COVERAGE_REPORT) genhtml -o coverage coverage/broker.info coverage_functional_test: install_coverage @@ -300,13 +297,7 @@ coverage_functional_test: install_coverage echo "Generating coverage report" lcov --directory BUILD_COVERAGE --capture -b BUILD_COVERAGE --output-file coverage/broker.test.info lcov --add-tracefile coverage/broker.init.info --add-tracefile coverage/broker.test.info --output-file coverage/broker.info - lcov -r coverage/broker.info "/usr/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/usr/local/include/*" -o coverage/broker.info - lcov -r coverage/broker.info "/opt/local/include/google/*" -o coverage/broker.info - # Remove unit test libraries and libraries developed before contextBroker project init - lcov -r coverage/broker.info "*/test/unittests/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/logMsg/*" -o coverage/broker.info - lcov -r coverage/broker.info "*/src/lib/parseArgs/*" -o coverage/broker.info + $(CLEAN_COVERAGE_REPORT) genhtml -o coverage coverage/broker.info valgrind: install_debug From 38e27409d36efe4d31ec393eedc732de461ae7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 15:05:28 +0200 Subject: [PATCH 7/8] FIX cleanup --- doc/manuals/admin/build_source.md | 2 +- makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index e4ac040750..b4bf9499f0 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -149,4 +149,4 @@ You can generate coverage reports for the Orion Context Broker using the followi make coverage INSTALL_DIR=~ -*NOTE*: note that functional test relying in debug traces are expected to fail under coverage execution (this is due to the LM_T macros used by the debug traces are disabled in the coverage code building, due to they add "noise" in condition coverage, thus making coverage reports more useful). \ No newline at end of file +*NOTE*: Functional tests relying in debug traces are expected to fail under coverage execution. This is due to the LM_T macros used by the debug traces are disabled in the coverage code build, as they add "noise" in condition coverage. This way coverage reports are more useful. \ No newline at end of file diff --git a/makefile b/makefile index 1ac77aca62..6116537f90 100644 --- a/makefile +++ b/makefile @@ -86,6 +86,7 @@ prepare_debug: compile_info cd BUILD_DEBUG && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DDEBUG=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) prepare_coverage: compile_info + # FIXME: should we use BUILD_COVERAGE for this or use BUILD_DEBUG? (note that for unit test we don't have BUILT_UNITTEST_COVERAGE....) mkdir -p BUILD_COVERAGE || true cd BUILD_COVERAGE && cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_ARCH=$(BUILD_ARCH) -DCOVERAGE=True -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) From 799f73aac93382fc7ca8399bbe4f8eea43f8b3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 23 Aug 2024 16:25:50 +0200 Subject: [PATCH 8/8] FIX improve doc --- doc/manuals/admin/build_source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index b4bf9499f0..8d35154db3 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -149,4 +149,4 @@ You can generate coverage reports for the Orion Context Broker using the followi make coverage INSTALL_DIR=~ -*NOTE*: Functional tests relying in debug traces are expected to fail under coverage execution. This is due to the LM_T macros used by the debug traces are disabled in the coverage code build, as they add "noise" in condition coverage. This way coverage reports are more useful. \ No newline at end of file +*NOTE*: Functional tests relying in debug traces are expected to fail under coverage execution (e.g. notification_different_sizes or not_posix_regex_idpattern.test). This is due to the LM_T macros used by the debug traces are disabled in the coverage code build, as they add "noise" in condition coverage. This way coverage reports are more useful. \ No newline at end of file