[spec] Fix lcov options for different Tizen/lcov versions accepted/tizen_7.0_unified accepted/tizen_8.0_unified accepted/tizen_unified_toolchain accepted/tizen_unified_x_asan tizen_7.0 tizen_8.0 accepted/tizen/7.0/unified/20240509.012443 accepted/tizen/8.0/unified/20240507.165652 accepted/tizen/unified/20240503.115753 accepted/tizen/unified/dev/20240620.000140 accepted/tizen/unified/toolchain/20240508.012334 accepted/tizen/unified/x/20240507.050941 accepted/tizen/unified/x/asan/20240625.091637
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Tue, 30 Apr 2024 05:37:01 +0000 (14:37 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Tue, 30 Apr 2024 09:08:14 +0000 (18:08 +0900)
- Set proper lcov options w.r.t. Tizen/lcov versions.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
packaging/mlops-agent.spec

index 0e03c47..75d5e56 100644 (file)
@@ -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}