summaryrefslogtreecommitdiff
path: root/tests/dbus/CMakeLists.txt
blob: 5b87a6c1587bbaf00df9f20b7ddb4aef8e793f2b (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_gen")

tpqt_setup_dbus_test_environment()

if(HAVE_TEST_PYTHON)
    tpqt_add_dbus_unit_test(DBusProperties dbus-properties "")
endif(HAVE_TEST_PYTHON)

if(ENABLE_TP_GLIB_TESTS)
    include_directories(${CMAKE_SOURCE_DIR}/tests/lib/glib
                        ${TELEPATHY_GLIB_INCLUDE_DIR}
                        ${GLIB2_INCLUDE_DIR}
                        ${DBUS_INCLUDE_DIR})

    add_definitions(-DQT_NO_KEYWORDS)

    if (${QT_VERSION_MAJOR} EQUAL 4)
        if (NOT ${QT_VERSION_MINOR} EQUAL 6)
            # >= qt 4.7
            # FIXME - Re-enable racy tests once https://bugs.freedesktop.org/show_bug.cgi?id=43356 is
            #         fixed
            SET(ENABLE_TESTS_WITH_RACES_IN_QT_4_6 TRUE)
            SET(ENABLE_TESTS_WITH_ISSUES_IN_QT_5 TRUE)
        endif (NOT ${QT_VERSION_MINOR} EQUAL 6)
    else (${QT_VERSION_MAJOR} EQUAL 4)
        # Currently none - this variable is here in case some issues arise
        SET(ENABLE_TESTS_WITH_ISSUES_IN_QT_5 FALSE)
        SET(ENABLE_TESTS_WITH_RACES_IN_QT_4_6 TRUE)
    endif (${QT_VERSION_MAJOR} EQUAL 4)

    if(HAVE_TEST_PYTHON)
        tpqt_add_dbus_unit_test(AccountBasics account-basics tp-glib-tests tp-qt-tests-glib-helpers)
        tpqt_add_dbus_unit_test(AccountSet account-set tp-glib-tests tp-qt-tests-glib-helpers)
        tpqt_add_dbus_unit_test(AccountChannelDispatcher account-channel-dispatcher tp-glib-tests tp-qt-tests-glib-helpers)
        tpqt_add_dbus_unit_test(Client client tp-glib-tests tp-qt-tests-glib-helpers)
        tpqt_add_dbus_unit_test(ClientFactories client-factories tp-glib-tests)
    endif(HAVE_TEST_PYTHON)

    tpqt_add_dbus_unit_test(AccountConnectionFactory account-connection-factory tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(CallChannel call-channel tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(CaptchaAuthentication captcha-authentication tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ChannelBasics chan-basics tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ChannelConference chan-conference tp-glib-tests future-example-cm-conference tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ChannelGroup chan-group tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ConnectionManagerBasics cm-basics tp-glib-tests)
    tpqt_add_dbus_unit_test(ConnectionAddressing conn-addressing tp-glib-tests future-example-conn-addressing tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ConnectionBasics conn-basics tp-glib-tests)
    tpqt_add_dbus_unit_test(ConnectionCapabilities conn-capabilities tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ConnectionIntrospectCornercases conn-introspect-cornercases tp-glib-tests)
    tpqt_add_dbus_unit_test(ConnectionRequests conn-requests tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ConnectionRosterLegacy conn-roster-legacy tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ConnectionRoster conn-roster example-cm-contactlist2 tp-qt-tests-glib-helpers
        ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES} ${DBUS_GLIB_LIBRARIES} ${TELEPATHY_GLIB_LIBRARIES})
    tpqt_add_dbus_unit_test(ConnectionRosterGroupsLegacy conn-roster-groups-legacy tp-glib-tests)
    tpqt_add_dbus_unit_test(ConnectionRosterGroups conn-roster-groups example-cm-contactlist2
        ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES} ${DBUS_GLIB_LIBRARIES} ${TELEPATHY_GLIB_LIBRARIES})
    tpqt_add_dbus_unit_test(ContactFactory contact-factory tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ContactMessenger contact-messenger tp-glib-tests)
    tpqt_add_dbus_unit_test(ContactSearchChannel contact-search-chan tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(Contacts contacts tp-glib-tests)
    tpqt_add_dbus_unit_test(ContactsAvatar contacts-avatar tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ContactsCapabilities contacts-capabilities tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ContactsInfo contacts-info tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(ContactsLocation contacts-location tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(DBusProxyFactory dbus-proxy-factory tp-glib-tests telepathy-qt-test-backdoors)
    tpqt_add_dbus_unit_test(Handles handles tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(Properties properties tp-glib-tests tp-qt-tests-glib-helpers)
    tpqt_add_dbus_unit_test(SimpleObserver simple-observer tp-glib-tests)
    tpqt_add_dbus_unit_test(StatefulProxy stateful-proxy tp-glib-tests)
    tpqt_add_dbus_unit_test(StreamedMediaChannel streamed-media-chan tp-glib-tests tp-qt-tests-glib-helpers)

    if (ENABLE_TESTS_WITH_RACES_IN_QT_4_6)
        tpqt_add_dbus_unit_test(TextChannel text-chan tp-glib-tests tp-qt-tests-glib-helpers)
        tpqt_add_dbus_unit_test(StreamTubeHandlers stream-tube-handlers tp-glib-tests tp-qt-tests-glib-helpers)
        if(ENABLE_TP_GLIB_GIO_TESTS)
            tpqt_add_dbus_unit_test(StreamTubeChannel stream-tube-chan tp-glib-tests tp-qt-tests-glib-helpers)
        endif(ENABLE_TP_GLIB_GIO_TESTS)
    endif (ENABLE_TESTS_WITH_RACES_IN_QT_4_6)

endif(ENABLE_TP_GLIB_TESTS)

tpqt_add_dbus_unit_test(CmProtocol cm-protocol)
tpqt_add_dbus_unit_test(ProfileManager profile-manager)
tpqt_add_dbus_unit_test(Types types)

if(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT)
    tpqt_add_dbus_unit_test(BaseConnectionManager base-cm telepathy-qt${QT_VERSION_MAJOR}-service)
endif(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT)

# Make check target. In case of check, output on failure and put it into a log
# This target has to stay here for catching all of the tests
add_custom_target(check ctest --output-on-failure -O test.log
                  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
add_dependencies(check check-local ${_telepathy_qt_test_cases})