ENDFOREACH(flag)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden")
+IF("${GCOV}" STREQUAL "1")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+ENDIF()
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
IF("${ARCH}" STREQUAL "arm")
%description test
A System Information library test tool
+%if 0%{?gcov:1}
+%package gcov
+Summary: A System Information gcov test file
+%description gcov
+gcno files for System-info line coverage test
+%endif
+
+
%prep
%setup -q
cp %{SOURCE1001} .
-DFULLVER=%{version} \
-DTIZEN_ID_PATH=%{tizen_id_path} \
-DDB_RO_PATH=%{db_ro_path} \
- -DDB_RW_PATH=%{db_rw_path}
+ -DDB_RW_PATH=%{db_rw_path} \
+ -DGCOV=%{?gcov:1}%{!?gcov:0}
%__make %{?_smp_mflags}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
+
%install
%make_install
mkdir -p %{buildroot}/etc
mkdir -p %{buildroot}/%{sysinfo_shared_path}
mkdir -p %{buildroot}/%{model_config_rw_dir}
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
+
%posttrans
/usr/bin/chsmack -a "System::Shared" -t %{sysinfo_shared_path}
/usr/bin/chsmack -a "System::Shared" -t %{model_config_rw_dir}
%files test
%{_bindir}/system_info_test
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif