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}