blob: e2ea0e6c5f7258114e75e21172830fd2b4473bda (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
set(CMAKE_AUTOMOC ON)
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -no-pie")
find_package(GMock REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Qt5DBus COMPONENTS Qt5DBusMacros REQUIRED)
pkg_check_modules(TEST_DEPS
libqtdbustest-1 REQUIRED
libqtdbusmock-1 REQUIRED
)
include_directories(SYSTEM
${DBUSTEST_INCLUDE_DIRS}
${TEST_DEPS_INCLUDE_DIRS}
${GTEST_INCLUDE_DIRS}
${GMOCK_INCLUDE_DIRS}
)
list(APPEND CTEST_ENVIRONMENT
G_MESSAGES_DEBUG=all
G_DBUS_DEBUG=call,signal,return,message
)
# turn off the warnings that break Google Test
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
list(APPEND CXX_WARNING_ARGS -Wno-global-constructors -Wno-weak-vtables)
endif()
add_compile_options(${CXX_WARNING_ARGS})
add_test(cppcheck cppcheck --force --enable=all -USCHEMA_DIR --error-exitcode=2 --suppress=missingInclude --suppress=unusedFunction --library=qt --inline-suppr -I${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
add_subdirectory(integration)
add_subdirectory(unit)
add_subdirectory(utils)
set(COVERAGE_TEST_TARGETS
${COVERAGE_TEST_TARGETS}
PARENT_SCOPE
)
|