From 5e5317a5236a1a1d4e145627418a26f7f66b0e3e Mon Sep 17 00:00:00 2001 From: Yongjoo Ahn Date: Tue, 30 Apr 2024 14:37:01 +0900 Subject: [PATCH] [spec] Fix lcov options for different Tizen/lcov versions - Set proper lcov options w.r.t. Tizen/lcov versions. Signed-off-by: Yongjoo Ahn --- packaging/mlops-agent.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packaging/mlops-agent.spec b/packaging/mlops-agent.spec index 0e03c47..75d5e56 100644 --- a/packaging/mlops-agent.spec +++ b/packaging/mlops-agent.spec @@ -205,14 +205,18 @@ find . -name "*.gcno" -exec sh -c 'touch -a "${1%.gcno}.gcda"' _ {} \; # Remove gcda for meaningless file (CMake's autogenerated) find . -name "CMakeCCompilerId*.gcda" -delete find . -name "CMakeCXXCompilerId*.gcda" -delete -# Generate report +# Generate report and exclude files which are generated by gdbus-codegen and external files in /usr/*. # 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. pushd %{builddir} +# Set different lcov options for Tizen/lcov versions. +%if 0%{tizen_version_major} >= 9 lcov -t 'ML-Agent unittest coverage' -o unittest.info -c -d . -b $(pwd) --ignore-errors mismatch -# Exclude generated files (e.g., Orc, Protobuf) and device-dependent files. -# 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 --ignore-errors graph,unused +%else +lcov -t 'ML-Agent unittest coverage' -o unittest.info -c -d . -b $(pwd) +lcov -r unittest.info "*/tests/*" "*/meson*/*" "*/*@sha/*" "*/*.so.p/*" "*/*tizen*" "*/*-dbus.c" "/usr/*" -o unittest-filtered.info +%endif # tizen_version_major >= 9 # Visualize the report genhtml -o result unittest-filtered.info -t "ML-Agent %{version}-%{release} ${VCS}" --ignore-errors source -p ${RPM_BUILD_DIR} -- 2.7.4