spice-common/tests/Makefile.am
Frediano Ziglio 2e914f3305 Integrate recorder library
Allow to use recorder library. See https://github.com/c3d/recorder for
details.
The main usage will be to collect statistics while the programs will run.
By default the recorder will be disabled at compile time. The idea of the
usage in SPICE is to collect data while the program run. Using current
SPICE logging facility was discussed but not easy to filter data. Other
solutions (SystemTap, LTTng) were discarded due to not cross platform.
A printf based solution was discussed too but missing the additional tools
which are useful. Currently we don't plan to use as extensively as to be a
problem to be replaced or removed in the future.

Both Autoconf and Meson build systems are supported.
Autoconf requires the addition of SPICE_CHECK_RECORDER call in configure.ac.
Meson requires to add recorder option.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-01-23 14:44:19 +00:00

137 lines
3.5 KiB
Makefile

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) \
$(NULL)
test_dummy_recorder_LDADD = \
$(top_builddir)/common/libspice-common.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