# Remove gcda for meaningless file (CMake's autogenerated)
find . -name "CMakeCCompilerId*.gcda" -delete
find . -name "CMakeCXXCompilerId*.gcda" -delete
-# Generate report
+# Generate report and exclude test files.
+# Set different lcov options for Tizen/lcov versions.
+%if 0%{tizen_version_major} >= 9
lcov -t 'NNStreamer-edge unittest coverage' -o unittest.info -c -d . -b $(pwd) --no-external --ignore-errors mismatch
-# Exclude test files.
lcov -r unittest.info "*/tests/*" -o unittest-filtered.info --ignore-errors graph,unused
+%else
+lcov -t 'NNStreamer-edge unittest coverage' -o unittest.info -c -d . -b $(pwd) --no-external
+lcov -r unittest.info "*/tests/*" -o unittest-filtered.info
+%endif # tizen_version_major >= 9
# Visualize the report
genhtml -o result unittest-filtered.info -t "NNStreamer-edge %{version}-%{release} ${VCS}" --ignore-errors source -p ${RPM_BUILD_DIR}