Fix the gcov build error
[platform/core/api/tethering.git] / packaging / capi-network-tethering.spec
index 5bba20d..b5924dd 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.2.0
+Version:       1.2.2
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
@@ -47,11 +47,13 @@ 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
@@ -70,6 +72,7 @@ export CXXFLAGS+=" -DTIZEN_TV_EXT"
 %endif
 
 %cmake -DLIB_INSTALL_DIR=%{_libdir} \
+       -DBUILD_UNITTEST=%{?asan:0}%{!?asan:1} \
        .
 make %{?_smp_mflags}
 
@@ -78,13 +81,13 @@ rm -rf %{buildroot}
 %make_install
 
 %if 0%{?gcov:1}
-# 컴파일시 gcno 파일이 생성됨 해당 파일을 gcov.rpm 에 추가할수 있게 복사
 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
 
+%if 0%{?asan} != 1
 cat << EOF > run-unittest.sh
 #!/bin/sh
 setup() {
@@ -111,11 +114,12 @@ 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}
 tests/tethering-gtest
-lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
+lcov -c --ignore-errors mismatch,graph,unused --no-external -b . -d . -o %{name}.info
 genhtml %{name}.info -o out --legend --show-details
 %endif
 
@@ -144,6 +148,8 @@ genhtml %{name}.info -o out --legend --show-details
 %{_datadir}/gcov/obj/*
 %endif
 
+%if 0%{?asan} != 1
 %files unittests
 %{_bindir}/tethering-gtest
 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh
+%endif