[spec] FIx lcov option to include missed files
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Tue, 2 Aug 2022 04:49:44 +0000 (13:49 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 2 Aug 2022 07:58:50 +0000 (16:58 +0900)
- 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 <yongjoo1.ahn@samsung.com>
packaging/machine-learning-api.spec

index e0666ff..00d4fe4 100644 (file)
@@ -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}