[Spice-devel] [spice-common v4 5/7] log: Add test case for logging code

Christophe Fergeau cfergeau at redhat.com
Thu Jan 21 05:01:37 PST 2016


On Thu, Jan 21, 2016 at 07:35:44AM -0500, Frediano Ziglio wrote:
> > 
> > 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.
> > ---
> >  tests/Makefile.am    |  17 ++-
> >  tests/test-logging.c | 408
> >  +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 424 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/test-logging.c
> > 
> > diff --git a/tests/Makefile.am b/tests/Makefile.am
> > index 92d2f62..248f467 100644
> > --- a/tests/Makefile.am
> > +++ b/tests/Makefile.am
> > @@ -1,7 +1,22 @@
> >  NULL =
> >  
> > -TESTS = test_marshallers
> > +TESTS = test_logging test_marshallers
> >  noinst_PROGRAMS = $(TESTS)
> 
> Why not executing during make check?
> This this program cannot run as an automatic test?

This gets executed during make check, noinst_PROGRAMS vs check_PROGRAMS
only changes when this gets built (make VS make check).


$ LC_ALL=C make check
[...]
Making check in tests
make[1]: Entering directory '/home/teuf/redhat/spice/spice-common/tests'
make  check-am
make[2]: Entering directory '/home/teuf/redhat/spice/spice-common/tests'
make  check-TESTS
make[3]: Entering directory '/home/teuf/redhat/spice/spice-common/tests'
make[4]: Entering directory '/home/teuf/redhat/spice/spice-common/tests'
PASS: test_logging
PASS: test_marshallers
============================================================================
Testsuite summary for spice-common noversion
============================================================================
# TOTAL: 2
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[4]: Leaving directory '/home/teuf/redhat/spice/spice-common/tests'
make[3]: Leaving directory '/home/teuf/redhat/spice/spice-common/tests'
make[2]: Leaving directory '/home/teuf/redhat/spice/spice-common/tests'
make[1]: Leaving directory '/home/teuf/redhat/spice/spice-common/tests'
make[1]: Entering directory '/home/teuf/redhat/spice/spice-common'
make[1]: Leaving directory '/home/teuf/redhat/spice/spice-common'


Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20160121/2babc0d1/attachment-0001.sig>


More information about the Spice-devel mailing list