Do not build unittest when ASAN is enabled 90/276690/1 accepted/tizen/unified/20220627.133847 submit/tizen/20220623.044549
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 23 Jun 2022 02:28:09 +0000 (11:28 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 23 Jun 2022 02:28:16 +0000 (11:28 +0900)
Change-Id: I80060b2dc8919659a86898489f8bae3c735fc1cc

CMakeLists.txt
packaging/capi-network-connection.spec

index bc2e7c1be0c894cf5de10b643de60710d2901a52..f7b4f9850b667c5380958a95327b438de885d1d6 100755 (executable)
@@ -79,7 +79,9 @@ ADD_SUBDIRECTORY(test)
 IF(DEBUG_GCOV)
        ADD_DEFINITIONS(-DDEBUG_GCOV)
 ENDIF(DEBUG_GCOV)
-ADD_SUBDIRECTORY(unittest)
+IF(BUILD_UNITTEST)
+       ADD_SUBDIRECTORY(unittest)
+ENDIF(BUILD_UNITTEST)
 
 IF(UNIX)
 
index edbac2254f67ee9b43d228f1da08768edd089712..a53cc23197f4971cbf5c738d63d710b6bf352b69 100755 (executable)
@@ -40,11 +40,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
@@ -61,6 +63,7 @@ export CFLAGS+=' -Wno-unused-local-typedefs'
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 cmake -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
        -DLIB_PATH=%{_lib} -DDEBUG_GCOV=%{?debug_gcov:1}%{!?debug_gcov:0} \
+       -DBUILD_UNITTEST=%{?asan:0}%{!?asan:1} \
 %if 0%{?model_build_feature_network_dsds} == 1
        -DTIZEN_DUALSIM_ENABLE=1 \
 %endif
@@ -78,6 +81,7 @@ mkdir -p "$gcno_obj_dir"
 find . -name '*.gcno' ! -iname '*mptcp*' ! -path '*/test/*' -exec cp --parents '{}' "$gcno_obj_dir" ';'
 %endif
 
+%if 0%{?asan} != 1
 cat << EOF > run-unittest.sh
 #!/bin/sh
 setup() {
@@ -104,7 +108,7 @@ 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}
@@ -134,6 +138,8 @@ popd
 %{_datadir}/gcov/obj/*
 %endif
 
+%if 0%{?asan} != 1
 %files unittests
 %{_bindir}/tct-connection-core
 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh
+%endif