diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2022-06-09 14:24:51 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2022-06-09 14:24:54 +0900 |
commit | 63cb63f886cc3c49ff00dc67eecbc80b057e44e4 (patch) | |
tree | 884134c19b2afb2fc1cefb8ef925e7f851dc3981 | |
parent | 0e4bfe518f721f00e15456bbbd259a4c2ee8b987 (diff) | |
download | wifi-aware-accepted/tizen_8.0_unified.tar.gz wifi-aware-accepted/tizen_8.0_unified.tar.bz2 wifi-aware-accepted/tizen_8.0_unified.zip |
Apply gcov automationtizen_8.0_m2_releasetizen_7.0_m2_releasesubmit/tizen/20220610.003743accepted/tizen/unified/20220614.134755accepted/tizen/8.0/unified/20231005.092937accepted/tizen/7.0/unified/hotfix/20221116.104922accepted/tizen/7.0/unified/20221110.061959tizen_8.0tizen_7.0_hotfixtizen_7.0accepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
Change-Id: I5e7a3b79203d2fbf4f0bc72a2e0ec9d5b2a0c740
-rw-r--r-- | packaging/capi-network-wifi-aware.spec | 54 | ||||
-rw-r--r-- | tests/unittest/CMakeLists.txt | 2 |
2 files changed, 46 insertions, 10 deletions
diff --git a/packaging/capi-network-wifi-aware.spec b/packaging/capi-network-wifi-aware.spec index b114f1a..9193913 100644 --- a/packaging/capi-network-wifi-aware.spec +++ b/packaging/capi-network-wifi-aware.spec @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(gmock) %if 0%{?gcov:1} +BuildRequires: gtest-devel BuildRequires: lcov %endif @@ -55,6 +56,12 @@ Summary: Coverage Data of %{name} The %{name}-gcov package contains gcov objects %endif +%package unittests +Summary: %{name} unittests binary + +%description unittests +unittests binary + %prep %setup -q chmod 644 %{SOURCE0} @@ -71,7 +78,6 @@ export ARCH=i586 export CFLAGS+=" -fprofile-arcs -ftest-coverage" export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" export FFLAGS+=" -fprofile-arcs -ftest-coverage" -export LDFLAGS+=" -lgcov" %endif %if 0%{?sec_build_binary_debug_enable} @@ -93,24 +99,48 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} -%if 0%{?gcov:1} -mkdir -p gcov-obj -find . -name '*.gcno' -exec cp '{}' gcov-obj ';' -%endif - %install rm -rf %{buildroot} %make_install %if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name} -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} +builddir=$(basename $PWD) +gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir" +mkdir -p "$gcno_obj_dir" +find . -name '*.gcno' ! -path '*/cts-verifier/*' ! -path '*/nan-test/*' -exec cp --parents '{}' "$gcno_obj_dir" ';' %endif +cat << EOF > run-unittest.sh +#!/bin/sh +setup() { + echo "setup start" +} + +test_main() { + echo "test_main start" + /usr/bin/wifi-aware-unittest +} + +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 export LD_LIBRARY_PATH=./src/:./tests/unittest/mocks/ LD_PRELOAD=./tests/unittest/mocks/libwifi-aware-mock.so ./tests/unittest/wifi-aware-unittest - %if 0%{?gcov:1} lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info genhtml %{name}.info -o out --legend --show-details @@ -146,5 +176,9 @@ genhtml %{name}.info -o out --legend --show-details %if 0%{?gcov:1} %files gcov -%{_datadir}/gcov/obj/%{name}/* +%{_datadir}/gcov/obj/* %endif + +%files unittests +%{_bindir}/wifi-aware-unittest +%{_bindir}/tizen-unittests/%{name}/run-unittest.sh diff --git a/tests/unittest/CMakeLists.txt b/tests/unittest/CMakeLists.txt index f9d470e..8bd41f1 100644 --- a/tests/unittest/CMakeLists.txt +++ b/tests/unittest/CMakeLists.txt @@ -41,3 +41,5 @@ TARGET_LINK_LIBRARIES(${WIFI_AWARE_UNITTEST} ${TARGET_WIFI_AWARE_MOCK_INTERFACE} ${TARGET_WIFI_AWARE_UNITTEST_LIBRARIES} ) + +INSTALL(TARGETS ${WIFI_AWARE_UNITTEST} DESTINATION bin/) |