From: Yongjoo Ahn Date: Tue, 2 Aug 2022 04:49:44 +0000 (+0900) Subject: [spec] FIx lcov option to include missed files X-Git-Tag: accepted/tizen/unified/20220811.135945~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=915df51215e811593c8251f16d876862bd82532d;p=platform%2Fcore%2Fapi%2Fmachine-learning.git [spec] FIx lcov option to include missed files - Current lcov command misses ml-agent source files. - To include those files, remove --no-external option and exclude some external / genterated files in the coverage result. Signed-off-by: Yongjoo Ahn --- diff --git a/packaging/machine-learning-api.spec b/packaging/machine-learning-api.spec index e0666ff..00d4fe4 100644 --- a/packaging/machine-learning-api.spec +++ b/packaging/machine-learning-api.spec @@ -389,9 +389,12 @@ find . -name "*.gcno" -exec sh -c 'touch -a "${1%.gcno}.gcda"' _ {} \; find . -name "CMakeCCompilerId*.gcda" -delete find . -name "CMakeCXXCompilerId*.gcda" -delete # Generate report -lcov -t 'ML API unittest coverage' -o unittest.info -c -d . -b $(pwd) --no-external +# TODO: the --no-external option is removed to include machine-learning-agent related source files. +# Restore this option when there is proper way to include those source files. +lcov -t 'ML API unittest coverage' -o unittest.info -c -d . -b $(pwd) # Exclude generated files (e.g., Orc, Protobuf) and device-dependent files. -lcov -r unittest.info "*/tests/*" "*/meson*/*" "*/*@sha/*" "*/*.so.p/*" "*/*tizen*" -o unittest-filtered.info +# Exclude files which are generated by gdbus-codegen and external files in /usr/*. +lcov -r unittest.info "*/tests/*" "*/meson*/*" "*/*@sha/*" "*/*.so.p/*" "*/*tizen*" "*/*-dbus.c" "/usr/*" -o unittest-filtered.info # Visualize the report genhtml -o result unittest-filtered.info -t "ML API %{version}-%{release} ${VCS}" --ignore-errors source -p ${RPM_BUILD_DIR}