Change-Id: I956470ed08a0c4283e0983d8c8b7860f6f490601
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB}/pkgconfig)
ADD_SUBDIRECTORY(test)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB}/pkgconfig)
ADD_SUBDIRECTORY(test)
IF(DEBUG_GCOV)
ADD_DEFINITIONS(-DDEBUG_GCOV)
ENDIF(DEBUG_GCOV)
IF(DEBUG_GCOV)
ADD_DEFINITIONS(-DDEBUG_GCOV)
ENDIF(DEBUG_GCOV)
- ADD_SUBDIRECTORY(unittest)
-ENDIF(BUILD_GCOV)
+ADD_SUBDIRECTORY(unittest)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: gtest-devel
BuildRequires: gtest-devel
BuildRequires: lcov
%endif
BuildRequires: lcov
%endif
gcov objects for coverage test
%endif
gcov objects for coverage test
%endif
+%package unittests
+Summary: %{name} unittests binary
+
+%description unittests
+unittests binary
+
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
-export LDFLAGS+=" -lgcov"
%endif
export CFLAGS+=' -Wno-unused-local-typedefs'
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
cmake -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
%endif
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} -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
- -DDEBUG_GCOV=%{?debug_gcov:1}%{!?debug_gcov:0} \
+ -DLIB_PATH=%{_lib} -DDEBUG_GCOV=%{?debug_gcov:1}%{!?debug_gcov:0} \
%if 0%{?model_build_feature_network_dsds} == 1
-DTIZEN_DUALSIM_ENABLE=1 \
%endif
%if 0%{?model_build_feature_network_dsds} == 1
-DTIZEN_DUALSIM_ENABLE=1 \
%endif
-%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' ! -iname "*mptcp*" -exec cp '{}' gcov-obj ';'
-%endif
-
%install
%make_install
%if 0%{?gcov:1}
%install
%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' ! -iname '*mptcp*' ! -path '*/test/*' -exec cp --parents '{}' "$gcno_obj_dir" ';'
+cat << EOF > run-unittest.sh
+#!/bin/sh
+setup() {
+ echo "setup start"
+}
+
+test_main() {
+ echo "test_main start"
+ /usr/bin/tct-connection-core
+}
+
+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}
pushd unittest
%check
%if 0%{?gcov:1}
pushd unittest
%if 0%{?gcov:1}
%files gcov
%if 0%{?gcov:1}
%files gcov
-%{_datadir}/gcov/obj/%{name}/*
+
+%files unittests
+%{_bindir}/tct-connection-core
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
capi-network-connection
)
capi-network-connection
)
-# INSTALL(PROGRAMS ${UNITTEST_NAME} DESTINATION ${BIN_INSTALL_DIR})
+INSTALL(PROGRAMS ${UNITTEST_NAME} DESTINATION bin/)