~jbicha/hud/build-depend-on-valac-not-gir

« back to all changes in this revision

Viewing changes to tests/Makefile.am

Merging the HUD into indicator-appmenu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DISTCLEANFILES =
 
2
EXTRA_DIST =
 
3
 
 
4
TESTS =
 
5
check_PROGRAMS =
 
6
XFAIL_TESTS =
 
7
 
 
8
DBUS_RUNNER=dbus-test-runner
 
9
 
 
10
######################
 
11
# Test Distance
 
12
######################
 
13
 
 
14
TESTS += \
 
15
        test-distance-test
 
16
 
 
17
check_PROGRAMS += \
 
18
        test-distance
 
19
 
 
20
DISTANCE_XML_REPORT = test-distance.xml
 
21
 
 
22
test-distance-test: test-distance Makefile.am
 
23
        @echo "#!/bin/bash" > $@
 
24
        @echo $(XVFB_RUN) >> $@
 
25
        @echo gtester --verbose -k -o $(DISTANCE_XML_REPORT) $(builddir)/test-distance >> $@
 
26
        @chmod +x $@
 
27
 
 
28
test_distance_SOURCES = \
 
29
        test-distance.c
 
30
 
 
31
test_distance_CFLAGS = \
 
32
        $(HUD_CFLAGS) \
 
33
        -Wall -Werror
 
34
 
 
35
test_distance_LDADD = \
 
36
        $(HUD_LIBS)
 
37
 
 
38
DISTCLEANFILES += $(DISTANCE_XML_REPORT)
 
39
 
 
40
######################
 
41
# Test Usage DB Simple
 
42
######################
 
43
 
 
44
TESTS += \
 
45
        test-usage-db-simple-test
 
46
 
 
47
check_PROGRAMS += \
 
48
        test-usage-db-simple
 
49
 
 
50
USAGE_DB_SIMPLE_XML_REPORT = test-usage-db-simple.xml
 
51
 
 
52
test-usage-db-simple-test: test-usage-db-simple test-usage-db-simple.sql Makefile.am
 
53
        @echo "#!/bin/bash -e" > $@
 
54
        @echo cd \`mktemp -d $(abs_builddir)/test-usage-db-simple.dir.XXXXXX\` >> $@
 
55
        @echo mkdir -p hud >> $@
 
56
        @echo cat $(abs_srcdir)/test-usage-db-simple.sql \| sqlite3 hud/usage-log.sqlite >> $@
 
57
        @echo export HUD_CACHE_DIR=\`pwd\` >> $@
 
58
        @echo gtester --verbose -k -o $(USAGE_DB_SIMPLE_XML_REPORT) $(abs_builddir)/test-usage-db-simple >> $@
 
59
        @echo cd .. >> $@
 
60
        @echo rm -rf test-usage-db-simple.dir.\* >> $@
 
61
        @chmod +x $@
 
62
 
 
63
test_usage_db_simple_SOURCES = \
 
64
        test-usage-db-simple.c
 
65
 
 
66
test_usage_db_simple_CFLAGS = \
 
67
        $(HUD_CFLAGS) \
 
68
        -DDATADIR=\""$(datadir)"\" \
 
69
        -I$(top_srcdir)/service \
 
70
        -Wall -Werror
 
71
 
 
72
test_usage_db_simple_LDADD = \
 
73
        $(HUD_LIBS)
 
74
 
 
75
DISTCLEANFILES += $(USAGE_DB_SIMPLE_XML_REPORT)
 
76
EXTRA_DIST += test-usage-db-simple.sql
 
77
 
 
78
######################
 
79
# Test Usage DB Old
 
80
######################
 
81
 
 
82
TESTS += \
 
83
        test-usage-db-old-test
 
84
 
 
85
check_PROGRAMS += \
 
86
        test-usage-db-old
 
87
 
 
88
USAGE_DB_OLD_XML_REPORT = test-usage-db-old.xml
 
89
 
 
90
test-usage-db-old-test: test-usage-db-old test-usage-db-old.sql Makefile.am
 
91
        @echo "#!/bin/bash -e" > $@
 
92
        @echo cd \`mktemp -d $(abs_builddir)/test-usage-db-old.dir.XXXXXX\` >> $@
 
93
        @echo mkdir -p hud >> $@
 
94
        @echo cat $(abs_srcdir)/test-usage-db-old.sql \| sqlite3 hud/usage-log.sqlite >> $@
 
95
        @echo export HUD_CACHE_DIR=\`pwd\` >> $@
 
96
        @echo gtester --verbose -k -o $(USAGE_DB_SIMPLE_XML_REPORT) $(abs_builddir)/test-usage-db-old >> $@
 
97
        @echo cd .. >> $@
 
98
        @echo rm -rf test-usage-db-old.dir.\* >> $@
 
99
        @chmod +x $@
 
100
 
 
101
test_usage_db_old_SOURCES = \
 
102
        test-usage-db-old.c
 
103
 
 
104
test_usage_db_old_CFLAGS = \
 
105
        $(HUD_CFLAGS) \
 
106
        -DDATADIR=\""$(datadir)"\" \
 
107
        -I$(top_srcdir)/service \
 
108
        -Wall -Werror
 
109
 
 
110
test_usage_db_old_LDADD = \
 
111
        $(HUD_LIBS)
 
112
 
 
113
DISTCLEANFILES += $(USAGE_DB_OLD_XML_REPORT)
 
114
EXTRA_DIST += test-usage-db-old.sql
 
115
 
 
116
#######################
 
117
# Test Usage DB Ancient
 
118
#######################
 
119
 
 
120
TESTS += \
 
121
        test-usage-db-ancient-test
 
122
 
 
123
check_PROGRAMS += \
 
124
        test-usage-db-ancient
 
125
 
 
126
test-usage-db-ancient-test: test-usage-db-ancient test-usage-db-ancient.sql test-usage-dump-entries.sql Makefile.am
 
127
        @echo "#!/bin/bash -e" > $@
 
128
        @echo cd \`mktemp -d $(abs_builddir)/test-usage-db-ancient.dir.XXXXXX\` >> $@
 
129
        @echo mkdir -p hud >> $@
 
130
        @echo cat $(abs_srcdir)/test-usage-db-ancient.sql \| sqlite3 hud/usage-log.sqlite >> $@
 
131
        @echo export HUD_CACHE_DIR=\`pwd\` >> $@
 
132
        @echo $(abs_builddir)/test-usage-db-ancient >> $@
 
133
        @echo if test \`cat $(abs_srcdir)/test-usage-dump-entries.sql \| sqlite3 hud/usage-log.sqlite \| wc -l\` -gt 0\; then >> $@
 
134
        @echo echo Database has entries >> $@
 
135
        @echo exit 1 >> $@
 
136
        @echo fi >> $@
 
137
        @echo cd .. >> $@
 
138
        @echo rm -rf test-usage-db-ancient.dir.\* >> $@
 
139
        @chmod +x $@
 
140
 
 
141
test_usage_db_ancient_SOURCES = \
 
142
        test-usage-db-ancient.c
 
143
 
 
144
test_usage_db_ancient_CFLAGS = \
 
145
        $(HUD_CFLAGS) \
 
146
        -DDATADIR=\""$(datadir)"\" \
 
147
        -I$(top_srcdir)/service \
 
148
        -Wall -Werror
 
149
 
 
150
test_usage_db_ancient_LDADD = \
 
151
        $(HUD_LIBS)
 
152
 
 
153
EXTRA_DIST += \
 
154
        test-usage-db-ancient.sql \
 
155
        test-usage-dump-entries.sql
 
156
 
 
157
#######################
 
158
# Test Usage DB Testapp
 
159
#######################
 
160
 
 
161
TESTS += \
 
162
        test-usage-db-testapp-test
 
163
 
 
164
check_PROGRAMS += \
 
165
        test-usage-db-testapp
 
166
 
 
167
USAGE_TESTAPP_XML_REPORT = $(abs_builddir)/test-usage-db-testapp.xml
 
168
 
 
169
test-usage-db-testapp-test: test-usage-db-testapp good-app-info/testapp.desktop.hud-app-info good-app-info/testapp100.desktop.hud-app-info test-create-db.sql Makefile.am
 
170
        @echo "#!/bin/bash -e" > $@
 
171
        @echo cd \`mktemp -d $(abs_builddir)/test-usage-db-testapp.dir.XXXXXX\` >> $@
 
172
        @echo mkdir -p hud >> $@
 
173
        @echo cat $(abs_srcdir)/test-create-db.sql \| sqlite3 hud/usage-log.sqlite >> $@
 
174
        @echo export HUD_CACHE_DIR=\`pwd\` >> $@
 
175
        @echo export HUD_APP_INFO_DIR=$(abs_srcdir)/good-app-info >> $@
 
176
        @echo gtester --verbose -k -o $(USAGE_TESTAPP_XML_REPORT) $(abs_builddir)/test-usage-db-testapp >> $@
 
177
        @echo cd .. >> $@
 
178
        @echo rm -rf test-usage-db-testapp.dir.\* >> $@
 
179
        @chmod +x $@
 
180
 
 
181
test_usage_db_testapp_SOURCES = \
 
182
        test-usage-db-testapp.c
 
183
 
 
184
test_usage_db_testapp_CFLAGS = \
 
185
        $(HUD_CFLAGS) \
 
186
        -DDATADIR=\""$(datadir)"\" \
 
187
        -I$(top_srcdir)/service \
 
188
        -Wall -Werror
 
189
 
 
190
test_usage_db_testapp_LDADD = \
 
191
        $(HUD_LIBS)
 
192
 
 
193
EXTRA_DIST += \
 
194
        test-create-db.sql \
 
195
        good-app-info/testapp100.desktop.hud-app-info \
 
196
        good-app-info/testapp.desktop.hud-app-info
 
197
 
 
198
DISTCLEANFILES += $(USAGE_TESTAPP_XML_REPORT)
 
199
 
 
200
#########################
 
201
# Test Indicator Tracker
 
202
#########################
 
203
 
 
204
TESTS += \
 
205
        test-indicator-tracker-test
 
206
 
 
207
check_PROGRAMS += \
 
208
        test-indicator-tracker \
 
209
        test-indicator-tracker-owner
 
210
 
 
211
test-indicator-tracker-test: test-indicator-tracker test-indicator-tracker-owner Makefile.am
 
212
        @echo "#!/bin/bash -e" > $@
 
213
        @echo $(XVFB_RUN) >> $@
 
214
        @echo $(DBUS_RUNNER) --task $(builddir)/test-indicator-tracker --task-name Tracker --task $(builddir)/test-indicator-tracker-owner --parameter com.canonical.indicator.messages --task-name Messages --ignore-return --task $(builddir)/test-indicator-tracker-owner --parameter com.canonical.indicators.sound --task-name Sound --ignore-return >> $@
 
215
        @chmod +x $@
 
216
 
 
217
test_indicator_tracker_SOURCES = \
 
218
        test-indicator-tracker.c
 
219
 
 
220
test_indicator_tracker_CFLAGS = \
 
221
        $(HUD_CFLAGS) \
 
222
        -Wall -Werror
 
223
 
 
224
test_indicator_tracker_LDADD = \
 
225
        $(HUD_LIBS)
 
226
 
 
227
test_indicator_tracker_owner_SOURCES = \
 
228
        test-indicator-tracker-owner.c
 
229
 
 
230
test_indicator_tracker_owner_CFLAGS = \
 
231
        $(HUD_CFLAGS) \
 
232
        -Wall -Werror
 
233
 
 
234
test_indicator_tracker_owner_LDADD = \
 
235
        $(HUD_LIBS)
 
236
 
 
237
#########################
 
238
# Test Bad App Info
 
239
#########################
 
240
 
 
241
TESTS += \
 
242
        test-bad-app-info-dual-header \
 
243
        test-bad-app-info-item-no-count \
 
244
        test-bad-app-info-item-no-name \
 
245
        test-bad-app-info-menu-no-name \
 
246
        test-bad-app-info-missing-desktop \
 
247
        test-bad-app-info-missing-menus \
 
248
        test-bad-app-info-multiple-menus
 
249
 
 
250
test-bad-app-info-dual-header: bad-app-info/dual-headers.hud-app-info test-bad-app-info Makefile.am
 
251
        @echo "#!/bin/bash -e" > $@
 
252
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/dual-headers.hud-app-info >> $@
 
253
        @chmod +x $@
 
254
 
 
255
test-bad-app-info-item-no-count: bad-app-info/item-no-count.hud-app-info test-bad-app-info Makefile.am
 
256
        @echo "#!/bin/bash -e" > $@
 
257
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/item-no-count.hud-app-info >> $@
 
258
        @chmod +x $@
 
259
 
 
260
test-bad-app-info-item-no-name: bad-app-info/item-no-name.hud-app-info test-bad-app-info Makefile.am
 
261
        @echo "#!/bin/bash -e" > $@
 
262
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/item-no-name.hud-app-info >> $@
 
263
        @chmod +x $@
 
264
 
 
265
test-bad-app-info-menu-no-name: bad-app-info/menu-no-name.hud-app-info test-bad-app-info Makefile.am
 
266
        @echo "#!/bin/bash -e" > $@
 
267
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/menu-no-name.hud-app-info >> $@
 
268
        @chmod +x $@
 
269
 
 
270
test-bad-app-info-missing-menus: bad-app-info/missing-menus.hud-app-info test-bad-app-info Makefile.am
 
271
        @echo "#!/bin/bash -e" > $@
 
272
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/missing-menus.hud-app-info >> $@
 
273
        @chmod +x $@
 
274
 
 
275
test-bad-app-info-missing-desktop: bad-app-info/missing-desktop.hud-app-info test-bad-app-info Makefile.am
 
276
        @echo "#!/bin/bash -e" > $@
 
277
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/missing-desktop.hud-app-info >> $@
 
278
        @chmod +x $@
 
279
 
 
280
test-bad-app-info-multiple-menus: bad-app-info/multiple-menus.hud-app-info test-bad-app-info Makefile.am
 
281
        @echo "#!/bin/bash -e" > $@
 
282
        @echo $(builddir)/test-bad-app-info $(srcdir)/bad-app-info/multiple-menus.hud-app-info >> $@
 
283
        @chmod +x $@
 
284
 
 
285
EXTRA_DIST += \
 
286
        bad-app-info/dual-headers.hud-app-info \
 
287
        bad-app-info/item-no-count.hud-app-info \
 
288
        bad-app-info/item-no-name.hud-app-info \
 
289
        bad-app-info/menu-no-name.hud-app-info \
 
290
        bad-app-info/missing-desktop.hud-app-info \
 
291
        bad-app-info/missing-menus.hud-app-info \
 
292
        bad-app-info/multiple-menus.hud-app-info
 
293
 
 
294
check_PROGRAMS += \
 
295
        test-bad-app-info
 
296
 
 
297
test_bad_app_info_SOURCES = \
 
298
        test-bad-app-info.c
 
299
 
 
300
test_bad_app_info_CFLAGS = \
 
301
        $(HUD_CFLAGS) \
 
302
        -I$(top_srcdir)/service \
 
303
        -Wall -Werror
 
304
 
 
305
test_bad_app_info_LDADD = \
 
306
        $(HUD_LIBS)
 
307
 
 
308
#########################
 
309
# Test Good App Info
 
310
#########################
 
311
 
 
312
TESTS += \
 
313
        test-good-app-info-tons-of-entries
 
314
 
 
315
check_PROGRAMS += \
 
316
        test-load-app-info
 
317
 
 
318
test_load_app_info_SOURCES = \
 
319
        test-load-app-info.c
 
320
 
 
321
test_load_app_info_CFLAGS = \
 
322
        $(HUD_CFLAGS) \
 
323
        -I$(top_srcdir)/service \
 
324
        -Wall -Werror
 
325
 
 
326
test_load_app_info_LDADD = \
 
327
        $(HUD_LIBS)
 
328
 
 
329
test-good-app-info-tons-of-entries: good-app-info/tons-of-entries.hud-app-info test-load-app-info test-usage-dump-entries.sql Makefile.am
 
330
        @echo "#!/bin/bash -e" > $@
 
331
        @echo cd \`mktemp -d $(abs_builddir)/test-good-app-info-tons-of-entries.dir.XXXXXX\` >> $@
 
332
        @echo mkdir -p hud >> $@
 
333
        @echo $(abs_builddir)/test-load-app-info hud/usage-log.sqlite $(abs_srcdir)/good-app-info/tons-of-entries.hud-app-info >> $@
 
334
        @echo export HUD_CACHE_DIR=\`pwd\` >> $@
 
335
        @echo if test \`cat $(abs_srcdir)/test-usage-dump-entries.sql \| sqlite3 hud/usage-log.sqlite \| wc -l\` -ne 540\; then >> $@
 
336
        @echo echo Database has wrong number of entries >> $@
 
337
        @echo exit 1 >> $@
 
338
        @echo fi >> $@
 
339
        @echo cd .. >> $@
 
340
        @echo rm -rf test-good-app-info-tons-of-entries.dir.\* >> $@
 
341
        @chmod +x $@
 
342
 
 
343
EXTRA_DIST += \
 
344
        good-app-info/tons-of-entries.hud-app-info \
 
345
        test-usage-dump-entries.sql
 
346
 
 
347
#########################
 
348
# Footer
 
349
#########################
 
350
 
 
351
DISTCLEANFILES += $(TESTS)