aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
blob: 4c2432125e574ae4a647213e51ed4a5b1cf1f33e (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
if (FLAVOUR_GTK3)
    # libayatana-indicator3.so
    set (ayatana_indicator_gtkver "ayatana-indicator3")
else()
    # libayatana-indicator.so
    set (ayatana_indicator_gtkver "ayatana-indicator")
endif()

function(add_test_helper_by_name name)
  set (TEST_HELPER_NAME ${name})
  set_source_files_properties(${TEST_HELPER_NAME}.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
  add_library("${TEST_HELPER_NAME}" SHARED ${TEST_HELPER_NAME}.c)
  target_include_directories("${TEST_HELPER_NAME}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
  target_include_directories("${TEST_HELPER_NAME}" PUBLIC "${CMAKE_SOURCE_DIR}/src")
  target_link_libraries("${TEST_HELPER_NAME}" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver})
  target_link_directories("${TEST_HELPER_NAME}" PUBLIC "${CMAKE_BINARY_DIR}/src")
  add_dependencies("${TEST_HELPER_NAME}" "${ayatana_indicator_gtkver}")
endfunction()

add_test_helper_by_name(dummy-indicator-blank)
add_test_helper_by_name(dummy-indicator-entry-func)
add_test_helper_by_name(dummy-indicator-null)
add_test_helper_by_name(dummy-indicator-signaler)
add_test_helper_by_name(dummy-indicator-simple)
add_test_helper_by_name(dummy-indicator-visible)
add_test_helper_by_name(service-manager-connect)
add_test_helper_by_name(service-manager-connect-service)
add_test_helper_by_name(service-manager-no-connect)
add_test_helper_by_name(service-manager-nostart-connect)
add_test_helper_by_name(service-shutdown-timeout)
add_test_helper_by_name(service-version-bad-service)
add_test_helper_by_name(service-version-good-service)
add_test_helper_by_name(service-version-manager)
add_test_helper_by_name(service-version-multiwatch-manager)
add_test_helper_by_name(service-version-multiwatch-manager-impolite)
add_test_helper_by_name(service-version-multiwatch-service)

# test-desktop-shortcuts

set_source_files_properties(test-desktop-shortcuts.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_executable("test-desktop-shortcuts" test-desktop-shortcuts.c)
target_compile_definitions("test-desktop-shortcuts" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}")
target_compile_definitions("test-desktop-shortcuts" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories("test-desktop-shortcuts" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_include_directories("test-desktop-shortcuts" PUBLIC "${CMAKE_SOURCE_DIR}/src")
target_link_libraries("test-desktop-shortcuts" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver})
target_link_directories("test-desktop-shortcuts" PUBLIC "${CMAKE_BINARY_DIR}/src")
add_dependencies("test-desktop-shortcuts" "${ayatana_indicator_gtkver}")
add_test("test-desktop-shortcuts" "test-desktop-shortcuts")

# test-loader

set_source_files_properties(test-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_executable("test-loader" test-loader.c)
target_compile_definitions("test-loader" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}")
target_include_directories("test-loader" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_include_directories("test-loader" PUBLIC "${CMAKE_SOURCE_DIR}/src")
target_link_libraries("test-loader" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver})
target_link_directories("test-loader" PUBLIC "${CMAKE_BINARY_DIR}/src")
add_dependencies("test-loader" "${ayatana_indicator_gtkver}")
add_test("test-loader" "test-loader")

# test-indicator-ng

if (FLAVOUR_GTK3)
    set_source_files_properties(test-indicator-ng.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
    add_executable("test-indicator-ng" test-indicator-ng.c)
    target_compile_definitions("test-indicator-ng" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}")
    target_compile_definitions("test-indicator-ng" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
    target_include_directories("test-indicator-ng" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
    target_include_directories("test-indicator-ng" PUBLIC "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries("test-indicator-ng" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver})
    target_link_directories("test-indicator-ng" PUBLIC "${CMAKE_BINARY_DIR}/src")
    add_dependencies("test-indicator-ng" "${ayatana_indicator_gtkver}")
    add_test("test-indicator-ng" "test-indicator-ng")
endif()