aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: 327c8cc087f217934fd00b8c383c421b1aa8b70a (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

check_PROGRAMS = \
	test-libappindicator \
	test-libappindicator-dbus-client \
	test-libappindicator-dbus-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-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-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