1NULL =
2
3TESTS = test_logging test_marshallers test_ssl_verify
4noinst_PROGRAMS = $(TESTS)
5
6test_logging_SOURCES = test-logging.c
7test_logging_CFLAGS =			\
8	-I$(top_srcdir)			\
9	$(GLIB2_CFLAGS)			\
10	$(GIO_UNIX_CFLAGS)		\
11	$(PROTOCOL_CFLAGS)		\
12	$(NULL)
13test_logging_LDADD =					\
14	$(top_builddir)/common/libspice-common.la	\
15	$(GLIB2_LIBS)					\
16	$(GIO_UNIX_LIBS)				\
17	$(NULL)
18
19
20test_marshallers_SOURCES =		\
21	$(TEST_MARSHALLERS)		\
22	test-marshallers.c		\
23	test-marshallers.h		\
24	$(NULL)
25test_marshallers_CFLAGS =		\
26	-I$(top_srcdir)			\
27	$(GLIB2_CFLAGS)			\
28	$(PROTOCOL_CFLAGS)		\
29	$(NULL)
30test_marshallers_LDADD =				\
31	$(top_builddir)/common/libspice-common.la	\
32	$(GLIB2_LIBS)					\
33	$(NULL)
34
35
36if HAVE_GDK_PIXBUF
37TESTS += test_quic
38
39test_quic_SOURCES =			\
40	test-quic.c			\
41	$(NULL)
42test_quic_CFLAGS =			\
43	-I$(top_srcdir)			\
44	$(GLIB2_CFLAGS)			\
45	$(GDK_PIXBUF_CFLAGS)		\
46	$(PROTOCOL_CFLAGS)		\
47	$(NULL)
48test_quic_LDADD =					\
49	$(top_builddir)/common/libspice-common.la	\
50	$(GLIB2_LIBS)					\
51	$(GDK_PIXBUF_LIBS)				\
52	$(NULL)
53endif
54
55TESTS += test_region
56test_region_SOURCES = \
57	test-region.c \
58	$(NULL)
59test_region_CFLAGS =			\
60	-I$(top_srcdir)			\
61	$(SPICE_COMMON_CFLAGS)		\
62	$(PROTOCOL_CFLAGS)		\
63	$(NULL)
64test_region_LDADD =					\
65	$(top_builddir)/common/libspice-common.la	\
66	$(SPICE_COMMON_LIBS)				\
67	$(NULL)
68
69TESTS += test_dummy_recorder
70
71test_dummy_recorder_SOURCES =		\
72	test-dummy-recorder.c		\
73	$(NULL)
74test_dummy_recorder_CFLAGS =		\
75	-I$(top_srcdir)			\
76	$(PROTOCOL_CFLAGS)		\
77	$(NULL)
78test_dummy_recorder_LDADD =				\
79	$(top_builddir)/common/libspice-common.la	\
80	$(NULL)
81
82
83TESTS += test_utils
84test_utils_SOURCES =			\
85	test-utils.c			\
86	$(NULL)
87test_utils_CFLAGS =			\
88	-I$(top_srcdir)			\
89	$(GLIB2_CFLAGS)			\
90	$(NULL)
91test_utils_LDADD =					\
92	$(top_builddir)/common/libspice-common.la	\
93	$(NULL)
94
95
96noinst_PROGRAMS += helper_fuzzer_demarshallers
97helper_fuzzer_demarshallers_SOURCES =	\
98	helper-fuzzer-demarshallers.c	\
99	generated_test_demarshallers.c	\
100	$(NULL)
101helper_fuzzer_demarshallers_CFLAGS =	\
102	-I$(top_srcdir)			\
103	$(GLIB2_CFLAGS)			\
104	$(PROTOCOL_CFLAGS)		\
105	$(NULL)
106helper_fuzzer_demarshallers_LDADD =				\
107	$(top_builddir)/common/libspice-common.la	        \
108	$(top_builddir)/common/libspice-common-server.la	\
109	$(top_builddir)/common/libspice-common-client.la	\
110	$(NULL)
111
112
113# Avoid need for python(pyparsing) by end users
114TEST_MARSHALLERS =				\
115	generated_test_marshallers.c		\
116	generated_test_marshallers.h		\
117	generated_test_demarshallers.c		\
118	generated_test_enums.h			\
119	generated_test_messages.h		\
120	$(NULL)
121
122BUILT_SOURCES = $(TEST_MARSHALLERS)
123
124MARSHALLERS_DEPS =					\
125	$(top_srcdir)/python_modules/__init__.py	\
126	$(top_srcdir)/python_modules/codegen.py		\
127	$(top_srcdir)/python_modules/demarshal.py	\
128	$(top_srcdir)/python_modules/marshal.py		\
129	$(top_srcdir)/python_modules/ptypes.py		\
130	$(top_srcdir)/python_modules/spice_parser.py	\
131	$(top_srcdir)/spice_codegen.py			\
132	$(NULL)
133
134# Note despite being autogenerated these are not part of CLEANFILES, they are
135# actually a part of EXTRA_DIST, to avoid the need for pyparser by end users
136generated_test_marshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
137	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --suffix=_test \
138	--generate-marshallers --server --include test-marshallers.h $< $@ >/dev/null
139generated_test_marshallers.h: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
140	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --suffix=_test \
141	--generate-marshallers --server --include test-marshallers.h -H $< $@ >/dev/null
142generated_test_demarshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
143	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --suffix=_test \
144	--generate-demarshallers --client --include test-marshallers.h \
145	--generated-declaration-file generated_test_messages.h $< $@ >/dev/null
146generated_test_enums.h: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
147	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --suffix=_test \
148	-e $< $@ >/dev/null
149
150EXTRA_DIST =				\
151	$(TEST_MARSHALLERS)		\
152	meson.build			\
153	test-marshallers.proto		\
154	$(NULL)
155
156
157test_ssl_verify_SOURCES =			\
158	test-ssl-verify.c			\
159	$(NULL)
160test_ssl_verify_CFLAGS =		\
161	-I$(top_srcdir)			\
162	$(GLIB2_CFLAGS)			\
163	$(PROTOCOL_CFLAGS)		\
164	$(OPENSSL_CFLAGS)		\
165	$(NULL)
166test_ssl_verify_LDADD =						\
167	$(top_builddir)/common/libspice-common-client.la	\
168	$(top_builddir)/common/libspice-common.la		\
169	$(GLIB2_LIBS)						\
170	$(OPENSSL_LIBS)						\
171	$(NULL)
172
173
174-include $(top_srcdir)/git.mk
175