BuildRequires: pkgconfig(gmock)
BuildRequires: pkgconfig(uuid)
+%if 0%{?gcov:1}
+BuildRequires: lcov
+BuildRequires: zip
+%endif
+
BuildRequires: cmake
Requires(post): /sbin/ldconfig
Requires(post): %{TZ_SYS_BIN}/sqlite3
%check
ctest --output-on-failure %{?_smp_mflags}
+%if 0%{?gcov:1}
+lcov -c --ignore-errors graph --no-external -q -d . -o notification-ex.info
+genhtml notification-ex.info -o notification-ex.out
+zip -r notification-ex.zip notification-ex.out
+install -m 0644 notification-ex.zip %{buildroot}%{_datadir}/gcov/notification-ex.zip
+%endif
%install
rm -rf %{buildroot}
%{_libdir}/pkgconfig/notification.pc
%{_libdir}/libnotification.so
-
-
#################################################
# notification-ex
#################################################
%{_libdir}/pkgconfig/notification-ex.pc
%attr(0644,root,root) %{_libdir}/libnotification-ex.so
-
#################################################
# notification-ex_unittests
#################################################
%if 0%{?gcov:1}
%files gcov
-%{_datadir}/gcov/obj/*
+%{_datadir}/gcov/*
%endif
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex
- ${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex/api
- ${CMAKE_CURRENT_SOURCE_DIR}/../mock
- ${CMAKE_CURRENT_SOURCE_DIR}/../
+ ${CMAKE_SOURCE_DIR}/notification-ex
+ ${CMAKE_SOURCE_DIR}/notification-ex/api
+ ${CMAKE_SOURCE_DIR}/mock
+ ${CMAKE_SOURCE_DIR}/
)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES)
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES)
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex NOTIFICATION_EX_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/mock MOCK_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification-ex NOTIFICATION_EX_SOURCES)
ADD_EXECUTABLE(${PROJECT_NAME}
${SOURCES}
${NOTIFICATION_EX_SOURCES}
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-int main(int argc, char** argv){
+int main(int argc, char** argv) {
int ret = -1;
- setenv("GCOV_PREFIX", "/tmp/", 1);
+
try {
testing::InitGoogleTest(&argc, argv);
} catch(...) {