aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
blob: 4c1b9b8b64fc8f0783d053dee9dc14f78d4cc4f6 (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
set(CMAKE_AUTOMOC ON)

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 --enable=all -USCHEMA_DIR --error-exitcode=2 --inline-suppr --library=qt -I${CMAKE_SOURCE_DIR} -i${CMAKE_SOURCE_DIR}/tests/utils/qmain.cpp -i${CMAKE_SOURCE_DIR}/tests/gmock ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests --suppress=missingIncludeSystem --suppress=uninitDerivedMemberVar --suppress=unmatchedSuppression --suppress=constParameter)

add_subdirectory(integration)
add_subdirectory(unit)
add_subdirectory(utils)

set(COVERAGE_TEST_TARGETS
  ${COVERAGE_TEST_TARGETS}
  PARENT_SCOPE
)