11
13
message(STATUS "Executing test suite under dbus-test-runner")
12
14
endif (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
16
# Build mongoose as static library to leverage in location reporter testing
17
add_library(mongoose mongoose.c)
14
19
# Build with system gmock and embedded gtest
15
20
set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
16
21
set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
17
22
set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
19
24
add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
26
macro(LOCATION_SERVICE_ADD_TEST test_name src)
31
target_link_libraries(
34
ubuntu-location-service
35
ubuntu-location-service-connectivity
36
ubuntu-location-service-daemon
41
${CMAKE_THREAD_LIBS_INIT}
43
${PROCESS_CPP_LIBRARIES}
52
add_test(${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name} --gtest_filter=*-*requires_hardware)
54
# Address android's limit on cmdline length and distill ubuntu-location-service into uls
57
DESTINATION ${CMAKE_INSTALL_BINDIR}/uls-tests
59
endmacro(LOCATION_SERVICE_ADD_TEST)
20
61
include_directories (
21
62
${CMAKE_SOURCE_DIR}/src/location_service
24
65
${GTEST_INCLUDE_DIR}
46
default_permission_manager_test
47
default_permission_manager_test.cpp
53
dummy_provider_tests.cpp
70
provider_selection_policy_test
71
provider_selection_policy_test.cpp
100
provider_factory_test
101
provider_factory_test.cpp
105
target_link_libraries(
106
default_permission_manager_test
108
ubuntu-location-service
110
${CMAKE_THREAD_LIBS_INIT}
117
target_link_libraries(
120
ubuntu-location-service
122
${CMAKE_THREAD_LIBS_INIT}
129
target_link_libraries(
132
ubuntu-location-service
134
${CMAKE_THREAD_LIBS_INIT}
142
target_link_libraries(
145
ubuntu-location-service
147
${CMAKE_THREAD_LIBS_INIT}
154
target_link_libraries(
155
provider_selection_policy_test
157
ubuntu-location-service
159
${CMAKE_THREAD_LIBS_INIT}
167
target_link_libraries(
170
ubuntu-location-service
172
${CMAKE_THREAD_LIBS_INIT}
179
target_link_libraries(
182
ubuntu-location-service
184
${CMAKE_THREAD_LIBS_INIT}
191
target_link_libraries(
194
ubuntu-location-service
196
${CMAKE_THREAD_LIBS_INIT}
203
target_link_libraries(
206
ubuntu-location-service
208
${CMAKE_THREAD_LIBS_INIT}
216
target_link_libraries(
217
provider_factory_test
219
ubuntu-location-service
221
${CMAKE_THREAD_LIBS_INIT}
229
target_link_libraries(
232
ubuntu-location-service
234
${CMAKE_THREAD_LIBS_INIT}
240
target_link_libraries(
243
ubuntu-location-service
245
${CMAKE_THREAD_LIBS_INIT}
251
target_link_libraries(
254
ubuntu-location-service
256
${CMAKE_THREAD_LIBS_INIT}
264
if (LOCATION_SERVICE_ENABLE_GPS_PROVIDERS)
265
add_executable(gps_provider_test gps_provider_test.cpp)
266
target_link_libraries(
269
ubuntu-location-service
271
${CMAKE_THREAD_LIBS_INIT}
274
ubuntu_application_api
278
add_test(gps_provider_test gps_provider_test)
279
endif(LOCATION_SERVICE_ENABLE_GPS_PROVIDERS)
68
LOCATION_SERVICE_ADD_TEST(acceptance_tests acceptance_tests.cpp)
69
LOCATION_SERVICE_ADD_TEST(connectivity_manager_test connectivity_manager_test.cpp)
70
LOCATION_SERVICE_ADD_TEST(controller_test controller_test.cpp)
71
LOCATION_SERVICE_ADD_TEST(criteria_test criteria_test.cpp)
72
LOCATION_SERVICE_ADD_TEST(daemon_and_cli_tests daemon_and_cli_tests.cpp)
73
LOCATION_SERVICE_ADD_TEST(default_permission_manager_test default_permission_manager_test.cpp)
74
LOCATION_SERVICE_ADD_TEST(engine_test engine_test.cpp)
75
LOCATION_SERVICE_ADD_TEST(harvester_test harvester_test.cpp)
77
if (NET_CPP_FOUND AND JSONCPP_FOUND)
78
LOCATION_SERVICE_ADD_TEST(ichnaea_reporter_test ichnaea_reporter_test.cpp)
81
LOCATION_SERVICE_ADD_TEST(position_test position_test.cpp)
82
LOCATION_SERVICE_ADD_TEST(provider_selection_policy_test provider_selection_policy_test.cpp)
83
LOCATION_SERVICE_ADD_TEST(provider_factory_test provider_factory_test.cpp)
84
LOCATION_SERVICE_ADD_TEST(provider_test provider_test.cpp)
85
LOCATION_SERVICE_ADD_TEST(wgs84_test wgs84_test.cpp)
87
# Provider-specific test-cases go here.
88
if (LOCATION_SERVICE_ENABLE_GPS_PROVIDER)
89
include_directories(${CMAKE_SOURCE_DIR}/src/location_service)
90
LOCATION_SERVICE_ADD_TEST(gps_provider_test gps_provider_test.cpp)
91
endif(LOCATION_SERVICE_ENABLE_GPS_PROVIDER)
281
93
if (LOCATION_SERVICE_ENABLE_GEOCLUE_PROVIDERS)
282
94
add_executable(geoclue_provider_test geoclue_provider_test.cpp)
297
110
add_test(geoclue_provider_test ${CMAKE_CURRENT_BINARY_DIR}/geoclue_provider_test)
298
111
endif (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
299
112
endif (LOCATION_SERVICE_ENABLE_GEOCLUE_PROVIDERS)
301
if (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
302
add_test(acceptance_tests ${DBUS_TEST_RUNNER_EXECUTABLE} --task=${CMAKE_CURRENT_BINARY_DIR}/acceptance_tests)
303
else (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
304
add_test(acceptance_tests ${CMAKE_CURRENT_BINARY_DIR}/acceptance_tests)
305
endif (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
307
add_test(provider_test provider_test)
308
add_test(accuracy_tests accuracy_tests)
309
add_test(controller_test controller_test)
310
add_test(default_permission_manager_test default_permission_manager_test)
311
add_test(engine_test engine_test)
312
add_test(position_test position_test)
313
add_test(provider_factory_test provider_factory_test)
314
add_test(provider_selection_policy_test provider_selection_policy_test)
315
add_test(heading_test heading_test)
316
add_test(velocity_test velocity_test)
317
add_test(wgs84_test wgs84_test)
318
add_test(dummy_provider_tests dummy_provider_tests)