summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: 280845af8eb13cd90aeb29d26845d1f966f4d3ad (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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
include $(top_srcdir)/common.am

AUTOMAKE_OPTIONS = subdir-objects

#check_PROGRAMS = rygel-http-item-uri-test \
#		 rygel-http-response-test \
#		 rygel-http-byte-seek-test \
#		 rygel-http-time-seek-test \
#		 rygel-http-get-test \
#		 rygel-http-post-test \
#		 rygel-user-config-test \
#		 rygel-media-engine-test

check_PROGRAMS = rygel-regression \
				 rygel-user-config-test \
				 rygel-searchable-container-test \
				 rygel-object-creator-test \
				 rygel-database-test

TESTS = $(check_PROGRAMS)

EXTRA_DIST = $(srcdir)/data/test-data.dat

# Define the most commonly-used flags,
# to avoid repetition:
test_valaflags = \
	$(TEST_DEPS_VALAFLAGS) \
	$(RYGEL_COMMON_VALAFLAGS)
test_cflags = \
	$(TEST_DEPS_CFLAGS) \
	$(RYGEL_COMMON_DEFINES_CFLAGS)
test_libs = \
	$(TEST_DEPS_LIBS) \
	$(COVERAGE_LIBS)

# This is for tests that link to librygel-server,
# instead of compiling its source files directly:
test_server_valaflags = \
	$(test_valaflags) \
	$(RYGEL_COMMON_LIBRYGEL_SERVER_VALAFLAGS)
test_server_cflags = \
	$(test_cflags) \
	$(LIBRYGEL_SERVER_DEPS_CFLAGS) \
	$(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS)
test_server_libs = \
	$(test_libs) \
	$(LIBRYGEL_SERVER_DEPS_LIBS) \
	$(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
	
# Note that the non-test sources here are symlinked from their
# various source directories.
# TODO: Mention their relative paths instead, to make this clearer?
#rygel_http_item_uri_test_SOURCES = rygel-http-item-uri-test.vala \
#                                   rygel-http-item-uri.vala
#rygel_http_item_uri_test_VALAFLAGS = \
#	$(test_valaflags)
#rygel_http_item_uri_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_item_uri_test_LDADD = \
#	$(test_libs)
#
#rygel_http_response_test_SOURCES = rygel-http-response-test.vala \
#				   rygel-http-response.vala \
#				   rygel-state-machine_http-response.vala \
#				   rygel-data-source_http-response.vala \
#				   rygel-data-sink_http-response.vala
#rygel_http_response_test_VALAFLAGS = \
#	$(test_valaflags)
#rygel_http_response_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_response_test_LDADD = \
#	$(test_libs)
#
#rygel_http_byte_seek_test_SOURCES = rygel-http-byte-seek-test.vala \
#				    rygel-http-byte-seek.vala \
#				    rygel-http-seek.vala
#rygel_http_byte_seek_test_VALAFLAGS = \
#	$(test_valaflags)
#rygel_http_byte_seek_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_byte_seek_test_LDADD = $(test_libs)
#
#rygel_http_time_seek_test_SOURCES = rygel-http-time-seek-test.vala \
#				    rygel-http-time-seek.vala \
#				    rygel-http-seek_time-seek.vala
#rygel_http_time_seek_test_VALAFLAGS = \
#	$(test_valaflags)
#rygel_http_time_seek_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_time_seek_test_LDADD = \
#	$(test_libs)
#
#rygel_http_get_test_SOURCES = rygel-http-get-test.vala \
#			      rygel-http-get.vala \
#			      rygel-http-request_http-get.vala \
#			      rygel-http-item-uri_http-get.vala \
#			      rygel-state-machine_http-get.vala \
#			      rygel-http-time-seek_http-get.vala \
#			      rygel-http-byte-seek_http-get.vala \
#			      rygel-http-seek_http-get.vala
#rygel_http_get_test_VALAFLAGS = \
#	$(test_valaflags)
#rygel_http_get_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_get_test_LDADD = \
#	$(test_libs)
#
#rygel_http_post_test_SOURCES = rygel-http-post-test.vala \
#			       rygel-http-post.vala \
#			       rygel-http-request_http-post.vala \
#			       rygel-http-item-uri_http-post.vala \
#			       rygel-state-machine_http-post.vala
#rygel_http_post_test_VALAFLAGS = $(test_valaflags) \
#	--pkg gupnp-av-1.0
#rygel_http_post_test_CFLAGS =  \
#	$(test_cflags)
#rygel_http_post_test_LDADD = \
#	$(test_libs)
#
rygel_searchable_container_test_SOURCES = \
	searchable-container/rygel-searchable-container.vala \
	searchable-container/test.vala
rygel_searchable_container_test_VALAFLAGS = \
	$(test_valaflags) \
	--pkg gupnp-av-1.0
rygel_searchable_container_test_CFLAGS =  \
	$(test_cflags)
rygel_searchable_container_test_LDADD = \
	$(test_libs)

rygel_object_creator_test_SOURCES = object-creator/test.vala \
				  object-creator/rygel-object-creator.vala \
				  object-creator/rygel-dlna-profile.vala \
				  object-creator/rygel-serializer.vala \
				  object-creator/rygel-m3u-playlist.vala \
				  object-creator/rygel-state-machine.vala \
				  object-creator/rygel-search-expression.vala \
				  object-creator/rygel-relational-expression.vala \
				  object-creator/rygel-logical-expression.vala \
				  object-creator/rygel-search-criteria-parser.vala
rygel_object_creator_test_VALAFLAGS = \
	$(test_valaflags)
rygel_object_creator_test_CFLAGS =  \
	$(test_cflags)
rygel_object_creator_test_LDADD = \
	$(test_libs)

rygel_user_config_test_SOURCES = rygel-configuration.vala \
				 rygel-user-config.vala \
				 rygel-user-config-test.vala
rygel_user_config_test_VALAFLAGS = \
	$(test_valaflags)
rygel_user_config_test_CFLAGS =  \
	$(test_cflags) \
	-DSYS_CONFIG_DIR='"$(sysconfigdir)"'
rygel_user_config_test_LDADD = \
	$(test_libs)

rygel_regression_SOURCES = \
	rygel-regression.vala
rygel_regression_VALAFLAGS = \
	$(test_server_valaflags)
rygel_regression_CFLAGS = \
	$(test_server_cflags)
rygel_regression_LDADD = \
	$(test_server_libs)

rygel_database_test_SOURCES = \
	rygel-database-test.vala
rygel_database_test_VALAFLAGS = \
	$(test_valaflags) \
	$(RYGEL_COMMON_LIBRYGEL_DB_VALAFLAGS)
rygel_database_test_CFLAGS = \
	$(test_cflags) \
	$(RYGEL_COMMON_LIBRYGEL_DB_CFLAGS)
rygel_database_test_LDADD = \
	$(test_libs) \
	$(RYGEL_COMMON_LIBRYGEL_DB_LIBS)

#rygel_media_engine_test_SOURCES = \
#	rygel-media-engine-test.vala
#rygel_media_engine_test_VALAFLAGS = \
#	$(test_server_valaflags)
#rygel_media_engine_test_CFLAGS = \
#	$(test_server_cflags) \
#	-DTEST_DATA_FOLDER='"$(abs_srcdir)/data"' \
#	-DTEST_ENGINE_PATH='"$(abs_top_builddir)/src/media-engines"' \
#	-DBUILT_ENGINES='"@BUILT_ENGINES@"'
#rygel_media_engine_test_LDADD = \
#	$(test_server_libs)

if HAVE_GSTREAMER
check_PROGRAMS += \
	rygel-playbin-renderer-test \
	rygel-environment-test

test_librygel_renderer_gst_valaflags = \
	$(RYGEL_COMMON_LIBRYGEL_RENDERER_GST_VALAFLAGS) \
	$(RYGEL_COMMON_VALAFLAGS)
test_librygel_renderer_gst_cflags = \
	$(test_cflags) \
	$(LIBRYGEL_RENDERER_GST_DEPS_CFLAGS) \
	$(RYGEL_COMMON_LIBRYGEL_RENDERER_GST_CFLAGS)
test_librygel_renderer_gst_libs = \
	$(test_libs) \
	$(LIBRYGEL_RENDERER_GST_DEPS_LIBS) \
	$(RYGEL_COMMON_LIBRYGEL_RENDERER_GST_LIBS)
	
rygel_playbin_renderer_test_SOURCES = rygel-playbin-renderer-test.vala
rygel_playbin_renderer_test_VALAFLAGS = \
	--enable-experimental \
	$(test_librygel_renderer_gst_valaflags)
rygel_playbin_renderer_test_CFLAGS = \
	$(test_librygel_renderer_gst_cflags)
rygel_playbin_renderer_test_LDADD = \
	$(test_librygel_renderer_gst_libs)

rygel_environment_test_SOURCES = rygel-environment-test.vala
rygel_environment_test_VALAFLAGS = \
	--enable-experimental \
	$(test_librygel_renderer_gst_valaflags)
rygel_environment_test_CFLAGS = \
	$(test_librygel_renderer_gst_cflags)
rygel_environment_test_LDADD = \
	$(test_librygel_renderer_gst_libs)

endif

if BUILD_MEDIA_EXPORT_PLUGIN
#check_PROGRAMS += plugins/media-export/regression
#
#plugins_media_export_regression_SOURCES = \
#	$(top_srcdir)/src/librygel-core/rygel-core-2.6.vapi \
#	$(top_srcdir)/src/librygel-server/rygel-server-2.6.vapi \
#	$(top_srcdir)/src/plugins/media-export/rygel-media-export.vapi \
#	plugins/media-export/regression.vala
#plugins_media_export_regression_CFLAGS = \
#	$(test_cflags) \
#	$(COLLATION_CFLAGS) \
#	$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_CFLAGS) \
#	$(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
#	-I$(top_srcdir)/src/plugins/media-export
#plugins_media_export_regression_LDADD = \
#	$(test_libs) \
#	$(COLLATION_LIBS) \
#	$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_LIBS) \
#	$(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS) \
#	$(top_builddir)/src/plugins/media-export/librygel-media-export.la
#plugins_media_export_regression_VALAFLAGS = \
#	$(test_valaflags) \
#	--enable-experimental \
#	$(RYGEL_PLUGIN_MEDIA_EXPORT_DEPS_VALAFLAGS)
endif


if ALWAYS_TEST
all-local: check
endif

if ENABLE_COVERAGE
coverage: check
	$(LCOV) --directory $(srcdir) --capture \
		--output-file $(top_builddir)/rygel.info
	$(LCOV) --directory $(srcdir) --output-file $(top_builddir)/rygel.info \
		--remove $(top_builddir)/rygel.info "*.c" "*.h" "*.vapi"
	rm -rf $(top_builddir)/coverage
	$(mkdir_p) $(top_builddir)/coverage
	$(GENHTML) --title "@PACKAGE_STRING@" \
		--output-directory $(top_builddir)/coverage \
		$(top_builddir)/rygel.info
endif