Modify the package configuration for coverage 90/230590/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 13 Apr 2020 02:24:27 +0000 (11:24 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 13 Apr 2020 02:24:27 +0000 (11:24 +0900)
Change-Id: I3564e4abfef61c6d4893560720084eb95ab4ec9d
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
packaging/bluetooth-agent.spec

index 6e57d59..a1cf824 100644 (file)
@@ -47,6 +47,7 @@ BuildRequires:  cmake
 Requires: security-config
 %if 0%{?gcov:1}
 BuildRequires:  pkgconfig(gmock)
+BuildRequires:  lcov
 %endif
 
 #Requires:     %{name}-compat = %{version}-%{release}
@@ -98,12 +99,12 @@ Group:      Network & Connectivity/Bluetooth
 Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
 
 %if 0%{?gcov:1}
-%package test
+%package gcov
 Summary: Test package for bluetooth-agent
 Group:   TO_BE/FILLED
 Requires: %{name} = %{version}-%{release}
 
-%description test
+%description gcov
 This package is C-API test application.
 %endif
 
@@ -148,10 +149,20 @@ export LDFLAGS+=" -lgcov"
 
 make VERBOSE=1
 
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
 %install
 rm -rf %{buildroot}
 %make_install
 
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
 # This usage of profile macro does NOT conflict 4.0 configurability.
 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
 # Original: wearable, ivi. Added: common, "undefined"
@@ -226,8 +237,9 @@ install -D -m 0644 packaging/bluetooth-hid-agent.service %{buildroot}%{_libdir}/
 %{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
 
 %if 0%{?gcov:1}
-%files test
+%files gcov
 %manifest %{name}.manifest
 %{_bindir}/gtest-bluetooth-agent
 %{_libdir}/lib*
+%{_datadir}/gcov/obj/*
 %endif