Add the base code for gtest verification
[platform/core/connectivity/bluetooth-agent.git] / packaging / bluetooth-agent.spec
index 9c80b8e..df66624 100644 (file)
@@ -45,6 +45,10 @@ BuildRequires:  pkgconfig(libexif)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  cmake
 Requires: security-config
+%if 0%{?gcov:1}
+BuildRequires:  pkgconfig(gmock)
+%endif
+
 #Requires:     %{name}-compat = %{version}-%{release}
 #Recommends:   %{name}-profile_common = %{version}-%{release}
 
@@ -93,6 +97,16 @@ Group:      Network & Connectivity/Bluetooth
 %description ipsp
 Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
 
+%if 0%{?gcov:1}
+%package test
+Summary: Test package for bluetooth-agent
+Group:   TO_BE/FILLED
+Requires: %{name} = %{version}-%{release}
+
+%description test
+This package is C-API test application.
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -127,7 +141,11 @@ export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=
 export CFLAGS_DEFAULT="$CFLAGS"
 
 # Build All (wearalbe/ivi/common/tv/mobile)
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_FEATURE_BT_HFP_AG=1
+cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+       -DTIZEN_FEATURE_BT_HFP_AG=1 \
+       -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \
+       -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
+
 make VERBOSE=1
 
 %install
@@ -204,3 +222,11 @@ ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/sys
 %{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service
 %{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
 
+%if 0%{?gcov:1}
+%files test
+%manifest %{name}.manifest
+%{_bindir}/gtest-bluetooth-agent
+%{_libdir}/lib*
+%exclude %{_libdir}/debug/*
+%exclude %{_libdir}/debug/.build-id/*
+%endif