From: Jihoon Kim Date: Mon, 16 May 2022 10:57:23 +0000 (+0900) Subject: Apply new gcov policy X-Git-Tag: submit/tizen/20220524.051852~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F275079%2F2;p=platform%2Fcore%2Fuifw%2Fautofill.git Apply new gcov policy - Apply of tree type gcov structure - Create run-unittest.sh - Change the unittest path and name Change-Id: I9f2e55f2b4fb8c33bf56fdddd8449246859a1c8d Signed-off-by: Jihoon Kim --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 47fbe49..ba0c3fd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ ADD_SUBDIRECTORY(manager) ## Test IF(NOT DEFINED MINIMUM_BUILD) ENABLE_TESTING() -SET(UTC_AUTOFILL capi-ui-autofill_gtest) +SET(UTC_AUTOFILL capi-ui-autofill-unittests) ADD_TEST(NAME ${UTC_AUTOFILL} COMMAND ${UTC_AUTOFILL} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index d6a0e62..19e2a9b 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -148,11 +148,39 @@ rm -rf %{buildroot} find . -name '*_proxy.c.gcno' -exec rm {} \; find . -name '*_stub.c.gcno' -exec rm {} \; -find . -name '*.gcno' | tar cf %{name}-gcov.tar -T - -install -d -m 755 %{buildroot}%{_datadir}/gcov/obj/%{name} -tar xf %{name}-gcov.tar -C %{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' -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/capi-ui-autofill-unittests +} + +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 %if 0%{?gcov:1} ctest --output-on-failure %{?_smp_mflags} @@ -211,10 +239,10 @@ install -m 0644 %{name}.zip %{buildroot}%{_datadir}/gcov/ %{_libdir}/pkgconfig/capi-ui-autofill-manager.pc %files unittests -%{_libdir}/%{name}/unittest/* +%{_bindir}/* +%{_bindir}/tizen-unittests/%{name}/run-unittest.sh %if 0%{?gcov:1} %files gcov %{_datadir}/gcov/* - %endif diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a2599a0..c7d6ff6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -58,4 +58,4 @@ SET_TARGET_PROPERTIES(${UTC_AUTOFILL} PROPERTIES --wrap=cynara_session_from_pid,\ --wrap=cynara_check") -INSTALL(TARGETS ${UTC_AUTOFILL} DESTINATION ${LIBDIR}/capi-ui-autofill/unittest) +INSTALL(TARGETS ${UTC_AUTOFILL} DESTINATION /usr/bin)