aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: 03e20913e5995b6934b7a8842f6b6c3d734f6892 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

check_PROGRAMS = \
	test-libappindicator \
	test-libappindicator-dbus-client \
	test-libappindicator-dbus-server \
	test-libappindicator-status-client \
	test-libappindicator-status-server \
	test-libappindicator-fallback-watcher \
	test-libappindicator-fallback-item \
	test-simple-app

TESTS =
DISTCLEANFILES = $(TESTS)

EXTRA_DIST = run-xvfb.sh

#########################################
##  test-libappindicator
#########################################

test_libappindicator_SOURCES = \
	test-libappindicator.c

test_libappindicator_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

#########################################
##  test-libappindicator-dbus-client
#########################################

test_libappindicator_dbus_client_SOURCES = \
	test-defines.h \
	test-libappindicator-dbus-client.c

test_libappindicator_dbus_client_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_dbus_client_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

#########################################
##  test-libappindicator-dbus-server
#########################################

test_libappindicator_dbus_server_SOURCES = \
	test-defines.h \
	test-libappindicator-dbus-server.c

test_libappindicator_dbus_server_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_dbus_server_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

#########################################
##  test-libappindicator-status-client
#########################################

test_libappindicator_status_client_SOURCES = \
	test-defines.h \
	test-libappindicator-status-client.c

test_libappindicator_status_client_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_status_client_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

#########################################
##  test-libappindicator-status-server
#########################################

test_libappindicator_status_server_SOURCES = \
	test-defines.h \
	test-libappindicator-status-server.c

test_libappindicator_status_server_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_status_server_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

#########################################
##  test-libappindicator-fallback
#########################################

test_libappindicator_fallback_watcher_SOURCES = \
	test-libappindicator-fallback-watcher.c

test_libappindicator_fallback_watcher_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_fallback_watcher_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

test_libappindicator_fallback_item_SOURCES = \
	test-libappindicator-fallback-item.c

test_libappindicator_fallback_item_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_libappindicator_fallback_item_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la

test-libappindicator-fallback: test-libappindicator-fallback-watcher test-libappindicator-fallback-item Makefile.am
	@echo "#!/bin/bash" > $@
	@echo . $(srcdir)/run-xvfb.sh >> $@
	@echo $(DBUS_RUNNER) --task ./test-libappindicator-fallback-watcher --task-name Watcher --ignore-return --task ./test-libappindicator-fallback-item --task-name Item >> $@
	@chmod +x $@

TESTS += test-libappindicator-fallback

#########################################
##  Actual tests
#########################################

XML_REPORT   = libappindicator-check-results.xml
HTML_REPORT  = libappindicator-check-results.html

libappindicator-tests: libappindicator-tests-gtester Makefile.am
	@echo "#!/bin/sh" > $@
	@echo $(DBUS_RUNNER) --task ./libappindicator-tests-gtester >> $@
	@chmod +x $@

libappindicator-tests-gtester: test-libappindicator Makefile.am
	@echo "#!/bin/sh" > $@
	@echo gtester -k --verbose -o=$(XML_REPORT) ./test-libappindicator >> $@
	@chmod +x $@

TESTS += libappindicator-tests
DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) libappindicator-tests-gtester


DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf

test-libappindicator-dbus: test-libappindicator-dbus-client test-libappindicator-dbus-server Makefile.am
	@echo "#!/bin/sh" > test-libappindicator-dbus
	@echo $(DBUS_RUNNER) --task ./test-libappindicator-dbus-client --task-name Client --task ./test-libappindicator-dbus-server --task-name Server --ignore-return >> test-libappindicator-dbus
	@chmod +x test-libappindicator-dbus

TESTS += test-libappindicator-dbus

test-libappindicator-status: test-libappindicator-status-client test-libappindicator-status-server Makefile.am
	@echo "#!/bin/sh" > test-libappindicator-status
	@echo $(DBUS_RUNNER) --task ./test-libappindicator-status-client --task-name Client --task ./test-libappindicator-status-server --task-name Server --ignore-return >> test-libappindicator-status
	@chmod +x test-libappindicator-status

TESTS += test-libappindicator-status

#########################################
##  test-simple-app
#########################################

test_simple_app_SOURCES = \
	test-simple-app.c

test_simple_app_CFLAGS = \
	$(INDICATOR_CFLAGS) \
	-Wall -Werror \
	-I$(top_srcdir)/src

test_simple_app_LDADD = \
	$(INDICATOR_LIBS) \
	$(top_builddir)/src/libappindicator.la