X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=packaging%2Fcapi-network-tethering.spec;h=b5924ddd21adb3f7361f874076e80c10723c98df;hb=HEAD;hp=87d546f9e6406a5e3d26707f7cd3ccfaf7c9700f;hpb=6862cb8762eefc26638d420e2e15f840470ff875;p=platform%2Fcore%2Fapi%2Ftethering.git diff --git a/packaging/capi-network-tethering.spec b/packaging/capi-network-tethering.spec index 87d546f..b5924dd 100644 --- a/packaging/capi-network-tethering.spec +++ b/packaging/capi-network-tethering.spec @@ -1,6 +1,6 @@ Name: capi-network-tethering Summary: Tethering Framework -Version: 1.1.7 +Version: 1.2.2 Release: 1 Group: System/Network License: Apache-2.0 @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(gmock) BuildRequires: cmake %if 0%{?gcov:1} +BuildRequires: gtest-devel BuildRequires: lcov BuildRequires: tar %endif @@ -46,6 +47,14 @@ Group: Network/Testing gcov objects for coverage test %endif +%if 0%{?asan} != 1 +%package unittests +Summary: %{name} unittests binary + +%description unittests +unittests binary +%endif + %prep %setup -q @@ -55,7 +64,6 @@ gcov objects for coverage test export CFLAGS+=" -fprofile-arcs -ftest-coverage" export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" export FFLAGS+=" -fprofile-arcs -ftest-coverage" -export LDFLAGS+=" -lgcov" %endif %if "%{?tizen_profile_name}" == "tv" @@ -63,26 +71,55 @@ export CFLAGS+=" -DTIZEN_TV_EXT" export CXXFLAGS+=" -DTIZEN_TV_EXT" %endif -%cmake -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \ +%cmake -DLIB_INSTALL_DIR=%{_libdir} \ + -DBUILD_UNITTEST=%{?asan:0}%{!?asan:1} \ . make %{?_smp_mflags} %install +rm -rf %{buildroot} %make_install %if 0%{?gcov:1} -find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T - -install -d -m 755 %{buildroot}%{_datadir}/gcov/obj -tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/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 -%check -%if 0%{?gcov:1} -tests/tethering-gtest +%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} -lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info +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 @@ -110,3 +147,9 @@ genhtml %{name}.info -o out --legend --show-details %files gcov %{_datadir}/gcov/obj/* %endif + +%if 0%{?asan} != 1 +%files unittests +%{_bindir}/tethering-gtest +%{_bindir}/tizen-unittests/%{name}/run-unittest.sh +%endif