projects
/
platform
/
core
/
api
/
tethering.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the gcov build error
[platform/core/api/tethering.git]
/
packaging
/
capi-network-tethering.spec
diff --git
a/packaging/capi-network-tethering.spec
b/packaging/capi-network-tethering.spec
index
9d03489
..
b5924dd
100644
(file)
--- a/
packaging/capi-network-tethering.spec
+++ b/
packaging/capi-network-tethering.spec
@@
-1,6
+1,6
@@
Name: capi-network-tethering
Summary: Tethering Framework
Name: capi-network-tethering
Summary: Tethering Framework
-Version: 1.
0.57
+Version: 1.
2.2
Release: 1
Group: System/Network
License: Apache-2.0
Release: 1
Group: System/Network
License: Apache-2.0
@@
-14,9
+14,12
@@
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(key-manager)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(key-manager)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(gmock)
BuildRequires: cmake
%if 0%{?gcov:1}
BuildRequires: cmake
%if 0%{?gcov:1}
+BuildRequires: gtest-devel
BuildRequires: lcov
BuildRequires: lcov
+BuildRequires: tar
%endif
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%endif
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@
-44,6
+47,14
@@
Group: Network/Testing
gcov objects for coverage test
%endif
gcov objects for coverage test
%endif
+%if 0%{?asan} != 1
+%package unittests
+Summary: %{name} unittests binary
+
+%description unittests
+unittests binary
+%endif
+
%prep
%setup -q
%prep
%setup -q
@@
-53,24
+64,63
@@
gcov objects for coverage test
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
-export LDFLAGS+=" -lgcov"
%endif
%endif
-%cmake .
+%if "%{?tizen_profile_name}" == "tv"
+export CFLAGS+=" -DTIZEN_TV_EXT"
+export CXXFLAGS+=" -DTIZEN_TV_EXT"
+%endif
+%cmake -DLIB_INSTALL_DIR=%{_libdir} \
+ -DBUILD_UNITTEST=%{?asan:0}%{!?asan:1} \
+ .
make %{?_smp_mflags}
make %{?_smp_mflags}
+%install
+rm -rf %{buildroot}
+%make_install
+
%if 0%{?gcov:1}
%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' ! -iname "*client*" ! -name "*test*" -exec cp '{}' gcov-obj ';'
+builddir=$(basename $PWD)
+gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
+mkdir -p "$gcno_obj_dir"
+find . -name '*.gcno' ! -path '*/tools/*' -exec cp --parents '{}' "$gcno_obj_dir" ';'
%endif
%endif
-%install
-%make_install
-%make_install
+%if 0%{?asan} != 1
+cat << EOF > run-unittest.sh
+#!/bin/sh
+setup() {
+ echo "setup start"
+}
+
+test_main() {
+ echo "test_main start"
+ /usr/bin/tethering-gtest
+}
+
+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}/
+%endif
+
+%check
%if 0%{?gcov:1}
%if 0%{?gcov:1}
-mkdir -p %{buildroot}%{_datadir}/gcov/obj
-install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+tests/tethering-gtest
+lcov -c --ignore-errors mismatch,graph,unused --no-external -b . -d . -o %{name}.info
+genhtml %{name}.info -o out --legend --show-details
%endif
%post -p /sbin/ldconfig
%endif
%post -p /sbin/ldconfig
@@
-97,3
+147,9
@@
install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
%files gcov
%{_datadir}/gcov/obj/*
%endif
%files gcov
%{_datadir}/gcov/obj/*
%endif
+
+%if 0%{?asan} != 1
+%files unittests
+%{_bindir}/tethering-gtest
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
+%endif