diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 15 | ||||
-rw-r--r-- | tests/backend-dbus/CMakeLists.txt | 21 |
2 files changed, 11 insertions, 25 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4bd5a8a..1e81bc2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,10 +1,12 @@ +find_package(GMock) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie") + # build the necessary schemas set_directory_properties (PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled) set_source_files_properties (gschemas.compiled GENERATED) -SET(COVERAGE_TEST_TARGETS "") - # GSettings: # compile the schemas our tests use (ayatana-indicator-session's, lockdown, media-keys) # into a gschemas.compiled file in this directory, and help the tests to find @@ -33,7 +35,7 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR} ${SERVICE_INCLUDE_DIRS}) # backendmock add_library (backendmock STATIC - backend-mock-actions.c + backend-mock-actions.c backend-mock-actions.h backend-mock.c backend-mock.h @@ -41,7 +43,6 @@ add_library (backendmock STATIC backend-mock-guest.h backend-mock-users.c backend-mock-users.h) -set_target_properties (backendmock PROPERTIES COMPILE_FLAGS " ${CC_WARNING_ARGS} -g") add_custom_target( gschemas-compiled ALL DEPENDS gschemas.compiled @@ -50,11 +51,9 @@ add_custom_target( # test-service add_executable (test-service test-service.cc) -set_target_properties (test-service PROPERTIES COMPILE_FLAGS " ${CC_WARNING_ARGS} -std=c++0x -g") +set_target_properties (test-service PROPERTIES COMPILE_FLAGS " -std=c++0x") add_test (test-service test-service) add_dependencies (test-service libayatanaindicatorsessionservice backendmock gschemas-compiled) -target_link_libraries (test-service libayatanaindicatorsessionservice backendmock gtest ${SERVICE_LIBRARIES} ${GTEST_LIBS}) - -SET(COVERAGE_TEST_TARGETS "${COVERAGE_TEST_TARGETS} test-service") +target_link_libraries (test-service libayatanaindicatorsessionservice backendmock ${SERVICE_LIBRARIES} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES}) add_subdirectory (backend-dbus) diff --git a/tests/backend-dbus/CMakeLists.txt b/tests/backend-dbus/CMakeLists.txt index 83c0886..0589487 100644 --- a/tests/backend-dbus/CMakeLists.txt +++ b/tests/backend-dbus/CMakeLists.txt @@ -1,11 +1,4 @@ -# build libgtest -add_library (gtest STATIC - ${GTEST_SOURCE_DIR}/gtest-all.cc - ${GTEST_SOURCE_DIR}/gtest_main.cc) -set_target_properties (gtest PROPERTIES INCLUDE_DIRECTORIES - ${GTEST_INCLUDE_DIR}) - -SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g ${CC_WARNING_ARGS}") +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") # build desktopmock add_library (desktopmock STATIC @@ -43,22 +36,16 @@ include_directories (${CMAKE_SOURCE_DIR}/tests) add_executable (test-actions test-actions.cc) add_test (test-actions test-actions) -set_tests_properties (test-actions PROPERTIES COMPILE_FLAGS "${SERVICE_CFLAGS}") -target_link_libraries (test-actions desktopmock backenddbus libayatanaindicatorsessionservice gtest ${SERVICE_LDFLAGS} ${GTEST_LIBS} ${GCOV_LIBS}) -SET(COVERAGE_TEST_TARGETS "${COVERAGE_TEST_TARGETS} test-actions") +target_link_libraries (test-actions desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES}) # test the Guest class add_executable (test-guest test-guest.cc) add_test (test-guest test-guest) -set_tests_properties (test-guest PROPERTIES COMPILE_FLAGS "${SERVICE_CFLAGS}") -target_link_libraries (test-guest desktopmock backenddbus libayatanaindicatorsessionservice gtest ${SERVICE_LDFLAGS} ${GTEST_LIBS} ${GCOV_LIBS}) -SET(COVERAGE_TEST_TARGETS "${COVERAGE_TEST_TARGETS} test-guest") +target_link_libraries (test-guest desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES}) # test the Users class add_executable (test-users test-users.cc) add_test (test-users test-users) -set_tests_properties (test-users PROPERTIES COMPILE_FLAGS "${SERVICE_CFLAGS}") -target_link_libraries (test-users desktopmock backenddbus libayatanaindicatorsessionservice gtest ${SERVICE_LDFLAGS} ${GTEST_LIBS} ${GCOV_LIBS}) -SET(COVERAGE_TEST_TARGETS "${COVERAGE_TEST_TARGETS} test-users") +target_link_libraries (test-users desktopmock backenddbus libayatanaindicatorsessionservice ${SERVICE_LDFLAGS} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES}) |