File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,14 +205,18 @@ find . -name "*.gcno" -exec sh -c 'touch -a "${1%.gcno}.gcda"' _ {} \;
205205# Remove gcda for meaningless file (CMake's autogenerated)
206206find . -name "CMakeCCompilerId*.gcda" -delete
207207find . -name "CMakeCXXCompilerId*.gcda" -delete
208- # Generate report
208+ # Generate report and exclude files which are generated by gdbus-codegen and external files in /usr/*.
209209# TODO: the --no-external option is removed to include machine-learning-agent related source files.
210210# Restore this option when there is proper way to include those source files.
211211pushd %{builddir }
212+ # Set different lcov options for Tizen/lcov versions.
213+ %if 0%{tizen_version_major } >= 9
212214lcov -t 'ML-Agent unittest coverage' -o unittest.info -c -d . -b $(pwd) --ignore-errors mismatch
213- # Exclude generated files (e.g., Orc, Protobuf) and device-dependent files.
214- # Exclude files which are generated by gdbus-codegen and external files in /usr/*.
215215lcov -r unittest.info "*/tests/*" "*/meson*/*" "*/*@sha/*" "*/*.so.p/*" "*/*tizen*" "*/*-dbus.c" "/usr/*" -o unittest-filtered.info --ignore-errors graph,unused
216+ %else
217+ lcov -t 'ML-Agent unittest coverage' -o unittest.info -c -d . -b $(pwd)
218+ lcov -r unittest.info "*/tests/*" "*/meson*/*" "*/*@sha/*" "*/*.so.p/*" "*/*tizen*" "*/*-dbus.c" "/usr/*" -o unittest-filtered.info
219+ %endif # tizen_version_major >= 9
216220# Visualize the report
217221genhtml -o result unittest-filtered.info -t "ML-Agent %{version }-%{release } ${VCS}" --ignore-errors source -p ${RPM_BUILD_DIR}
218222
You can’t perform that action at this time.
0 commit comments