summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: 05d9ba290c40fb3e623ec1daaf43d3b4349d6e9d (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
NULL =

TESTS = test_logging test_marshallers test_ssl_verify
noinst_PROGRAMS = $(TESTS)

test_logging_SOURCES = test-logging.c
test_logging_CFLAGS =			\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(GIO_UNIX_CFLAGS)		\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
test_logging_LDADD =					\
	$(top_builddir)/common/libspice-common.la	\
	$(GLIB2_LIBS)					\
	$(GIO_UNIX_LIBS)				\
	$(NULL)


test_marshallers_SOURCES =		\
	$(TEST_MARSHALLERS)		\
	test-marshallers.c		\
	test-marshallers.h		\
	$(NULL)
test_marshallers_CFLAGS =		\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
test_marshallers_LDADD =				\
	$(top_builddir)/common/libspice-common.la	\
	$(GLIB2_LIBS)					\
	$(NULL)


if HAVE_GDK_PIXBUF
TESTS += test_quic

test_quic_SOURCES =			\
	test-quic.c			\
	$(NULL)
test_quic_CFLAGS =			\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(GDK_PIXBUF_CFLAGS)		\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
test_quic_LDADD =					\
	$(top_builddir)/common/libspice-common.la	\
	$(GLIB2_LIBS)					\
	$(GDK_PIXBUF_LIBS)				\
	$(NULL)
endif

TESTS += test_region
test_region_SOURCES = \
	test-region.c \
	$(NULL)
test_region_CFLAGS =			\
	-I$(top_srcdir)			\
	$(SPICE_COMMON_CFLAGS)		\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
test_region_LDADD =					\
	$(top_builddir)/common/libspice-common.la	\
	$(SPICE_COMMON_LIBS)				\
	$(NULL)

TESTS += test_dummy_recorder

test_dummy_recorder_SOURCES =		\
	test-dummy-recorder.c		\
	$(NULL)
test_dummy_recorder_CFLAGS =		\
	-I$(top_srcdir)			\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
test_dummy_recorder_LDADD =				\
	$(top_builddir)/common/libspice-common.la	\
	$(NULL)


TESTS += test_utils
test_utils_SOURCES =			\
	test-utils.c			\
	$(NULL)
test_utils_CFLAGS =			\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(NULL)
test_utils_LDADD =					\
	$(top_builddir)/common/libspice-common.la	\
	$(NULL)


noinst_PROGRAMS += helper_fuzzer_demarshallers
helper_fuzzer_demarshallers_SOURCES =	\
	helper-fuzzer-demarshallers.c	\
	$(NULL)
helper_fuzzer_demarshallers_CFLAGS =	\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(PROTOCOL_CFLAGS)		\
	$(NULL)
helper_fuzzer_demarshallers_LDADD =				\
	$(top_builddir)/common/libspice-common.la	        \
	$(top_builddir)/common/libspice-common-server.la	\
	$(top_builddir)/common/libspice-common-client.la	\
	$(NULL)


# Avoid need for python(pyparsing) by end users
TEST_MARSHALLERS =				\
	generated_test_marshallers.c		\
	generated_test_marshallers.h		\
	generated_test_demarshallers.c		\
	generated_test_enums.h			\
	$(NULL)

BUILT_SOURCES = $(TEST_MARSHALLERS)

MARSHALLERS_DEPS =					\
	$(top_srcdir)/python_modules/__init__.py	\
	$(top_srcdir)/python_modules/codegen.py		\
	$(top_srcdir)/python_modules/demarshal.py	\
	$(top_srcdir)/python_modules/marshal.py		\
	$(top_srcdir)/python_modules/ptypes.py		\
	$(top_srcdir)/python_modules/spice_parser.py	\
	$(top_srcdir)/spice_codegen.py			\
	$(NULL)

# Note despite being autogenerated these are not part of CLEANFILES, they are
# actually a part of EXTRA_DIST, to avoid the need for pyparser by end users
generated_test_marshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers --server --include test-marshallers.h $< $@ >/dev/null
generated_test_marshallers.h: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers --server --include test-marshallers.h -H $< $@ >/dev/null
generated_test_demarshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include test-marshallers.h $< $@ >/dev/null
generated_test_enums.h: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py -e $< $@ >/dev/null

EXTRA_DIST =				\
	$(TEST_MARSHALLERS)		\
	meson.build			\
	test-marshallers.proto		\
	$(NULL)


test_ssl_verify_SOURCES =			\
	test-ssl-verify.c			\
	$(NULL)
test_ssl_verify_CFLAGS =		\
	-I$(top_srcdir)			\
	$(GLIB2_CFLAGS)			\
	$(PROTOCOL_CFLAGS)		\
	$(OPENSSL_CFLAGS)		\
	$(NULL)
test_ssl_verify_LDADD =						\
	$(top_builddir)/common/libspice-common-client.la	\
	$(top_builddir)/common/libspice-common.la		\
	$(GLIB2_LIBS)						\
	$(OPENSSL_LIBS)						\
	$(NULL)


-include $(top_srcdir)/git.mk