spice-common/tests/Makefile.am
Christophe Fergeau df56d585cb log: Add test case for logging code
This gives us a baseline of how the SPICE/glib integration is supposed
to behave.

Everything goes through glib logging facilities, and is impacted by
G_MESSAGES_DEBUG/G_DEBUG=fatal-{warnings,criticals}

Messages in the SPICE_LOG_DOMAIN log domain (output either through
spice_log() or g_log()) will also consider the legacy SPICE_DEBUG_LEVEL
and SPICE_ABORT_LEVEL environment variables. Messages in other domains
will not be impacted by these legacy environment variables.

If spice-common is built without SPICE_DISABLE_ABORT,
spice_return_if_fail()/spice_critical() will abort the program.
g_return_if_fail()/g_critical() will not abort the program.
2016-01-26 15:58:43 +01:00

67 lines
2.0 KiB
Makefile

NULL =
TESTS = test_logging test_marshallers
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 = \
generated_test_marshallers.c \
generated_test_marshallers.h \
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)
# Avoid need for python(pyparsing) by end users
TEST_MARSHALLERS = \
generated_test_marshallers.c \
generated_test_marshallers.h \
$(NULL)
BUILT_SOURCES = $(TEST_MARSHALLERS)
MARSHALLERS_DEPS = \
$(CODE_GENERATOR_BASEDIR)/python_modules/__init__.py \
$(CODE_GENERATOR_BASEDIR)/python_modules/codegen.py \
$(CODE_GENERATOR_BASEDIR)/python_modules/demarshal.py \
$(CODE_GENERATOR_BASEDIR)/python_modules/marshal.py \
$(CODE_GENERATOR_BASEDIR)/python_modules/ptypes.py \
$(CODE_GENERATOR_BASEDIR)/python_modules/spice_parser.py \
$(CODE_GENERATOR_BASEDIR)/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) $(CODE_GENERATOR_BASEDIR)/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) $(CODE_GENERATOR_BASEDIR)/spice_codegen.py --generate-marshallers --server --include test-marshallers.h -H $< $@ >/dev/null
EXTRA_DIST = \
$(TEST_MARSHALLERS) \
test-marshallers.proto \
$(NULL)
-include $(top_srcdir)/git.mk