summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/capi-network-bluetooth.spec41
1 files changed, 38 insertions, 3 deletions
diff --git a/packaging/capi-network-bluetooth.spec b/packaging/capi-network-bluetooth.spec
index b22cec2..20c170f 100644
--- a/packaging/capi-network-bluetooth.spec
+++ b/packaging/capi-network-bluetooth.spec
@@ -52,6 +52,12 @@ Summary: %{name} gcov data
gcov objects
%endif
+%package unittests
+Summary: %{name} unittests binary
+
+%description unittests
+unittests binary
+
%prep
%setup -q
cp %{SOURCE1001} %{SOURCE1002} .
@@ -113,6 +119,33 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
#mkdir -p %{buildroot}%{_unitdir}
#install -m 0644 tests/test/bt_infinite_spp_test_server.service %{buildroot}%{_unitdir}/bt_infinite_spp_test_server.service
+cat << EOF > run-unittest.sh
+#!/bin/bash
+setup() {
+ echo "setup start"
+}
+
+test_main() {
+ echo "test_main start"
+ LD_PRELOAD=/usr/lib/libbluetooth-mock.so /usr/bin/tct-bluetooth-core
+}
+
+teardown() {
+ echo "teardown start"
+}
+
+main() {
+ setup
+ test_main
+ teardown
+}
+
+main "$@"
+EOF
+
+mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
+install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}
+
%check
LD_LIBRARY_PATH=. LD_PRELOAD=tests/unittest/libbluetooth-mock.so tests/unittest/tct-bluetooth-core
%if 0%{?gcov:1}
@@ -139,9 +172,6 @@ genhtml %{name}.info -o out --legend --show-details
%{_bindir}/ble_mouse_with_error
%{_bindir}/hid_keyboard
%{_bindir}/bt_infinite_spp_test
-%exclude %{_bindir}/tct-bluetooth-core
-%exclude %{_libdir}/libbluetooth-mock.so
-%exclude %{_libdir}/debug/*
#%{_unitdir}/bt_infinite_spp_test_server.service
#/etc/smack/accesses.d/capi-network-bluetooth-test.efl
@@ -162,3 +192,8 @@ genhtml %{name}.info -o out --legend --show-details
%{_datadir}/gcov/obj/*
%exclude %{_datadir}/gcov/obj/*/*/tests/*
%endif
+
+%files unittests
+%{_libdir}/libbluetooth-mock.so
+%{_bindir}/tct-bluetooth-core
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh