Skip to content

Commit 5e5317a

Browse files
anyj0527jaeyun-jung
authored andcommitted
[spec] Fix lcov options for different Tizen/lcov versions
- Set proper lcov options w.r.t. Tizen/lcov versions. Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
1 parent 74ee1c3 commit 5e5317a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packaging/mlops-agent.spec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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)
206206
find . -name "CMakeCCompilerId*.gcda" -delete
207207
find . -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.
211211
pushd %{builddir}
212+
# Set different lcov options for Tizen/lcov versions.
213+
%if 0%{tizen_version_major} >= 9
212214
lcov -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/*.
215215
lcov -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
217221
genhtml -o result unittest-filtered.info -t "ML-Agent %{version}-%{release} ${VCS}" --ignore-errors source -p ${RPM_BUILD_DIR}
218222

0 commit comments

Comments
 (0)