Commit graph

944 commits

Author SHA1 Message Date
Simon McVittie
4a7fe6ca53 test: promote GLIB_CFLAGS, DBUS_GLIB_CFLAGS to top level and use AM_CPPFLAGS
INCLUDES is a deprecated way to get the same effect as AM_CPPFLAGS.

It's harmless to add extra -I directories to all the tests, even those
that use neither GLib nor dbus-glib, so we can simplify by setting these
AM_CPPFLAGS for the whole directory.
2011-07-29 11:49:07 +01:00
Simon McVittie
9875480ed4 test: reverse assumption regarding static/dynamic linking
If we change the default assumption to be that new tests will be
dynamically-linked to libdbus, those tests can be useful for
installcheck or even for installation. Accordingly, explicitly use
new variable $(static_cppflags) for all tests that need static linking.
2011-07-29 11:17:29 +01:00
Simon McVittie
274e0fbc20 Simplify linking for tests that use libdbus-testutils
This is the library used by tests that link libdbus-internal and DBusLoop.
By linking libdbus-internal into it, we can avoid having to repeat that
dependency all over the place - libtool and cmake both know how to follow
recursive dependencies.

In cmake, also use libdbus-testutils for more tests, in preference to
repeating its source files.
2011-07-29 11:17:17 +01:00
Simon McVittie
f7b7de3bb1 Don't explicitly link thread and network libs into various tests
These tests get everything they need from the public or internal API of
libdbus-internal.la, and libtool knows how to pull in libraries'
dependencies, so we don't need explicit linking.

spawn-test and break-loader don't actually need test-utils.[ch]
either.
2011-07-29 11:16:44 +01:00
Simon McVittie
c368b36901 Simplify linking by moving -export-dynamic to AM_LDFLAGS 2011-07-29 11:06:41 +01:00
Simon McVittie
f8c131047c Remove DBUS_GLIB_CFLAGS from name-test subdirectory (not used/needed)
This appears to be left over from when dbus-glib was part of dbus.
2011-07-29 11:06:38 +01:00
Simon McVittie
b451102301 Remove DBUS_CLIENT_CFLAGS, which is always empty 2011-07-29 11:06:07 +01:00
Simon McVittie
fa9bf406b4 Remove DBUS_TEST_CFLAGS, which is empty 2011-07-29 11:05:34 +01:00
Simon McVittie
63c93a1165 Add a regression test that can reproduce fd.o #34393
The number of messages is arbitrary; the more messages, the more likely
the crash is. 2000 messages seem to cause it reliably on this laptop,
but I've set it to 10000 to be safe.

Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
2011-07-28 18:23:52 +01:00
Simon McVittie
feb31a3321 Merge branch 'dbus-1.4' and update NEWS for master
Conflicts:
	NEWS
2011-07-18 19:42:35 +01:00
Simon McVittie
d54ea8a41b Use EXEEXT when running tests from another directory, and skip bus-test-launch-helper on non-Unix
This is necessary when cross-compiling from Linux to mingw32 and running
the resulting tests under Wine. (This partially works! Some tests fail,
though.)

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-18 19:14:59 +01:00
Simon McVittie
b354cfc84a Run bus tests from test/
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34405
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-18 19:14:55 +01:00
Simon McVittie
e07a8f8e44 Run dbus-test from test/, not dbus/
This avoids failures caused by test/data not having been set up yet.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34405
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-18 19:14:54 +01:00
Simon McVittie
cf9ee7ae80 test/Makefile.am: list tests one per line
This improves clarity, and makes conflicts less likely and merges more
obviously correct.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34405
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-18 19:14:49 +01:00
Cosimo Alfarano
b86e967d63 Add testsuite for eavesdrop=true DBusMatchRule
[with some typos fixed during commit -smcv]

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890
Bug-NB: NB#269748
2011-07-14 16:25:20 +01:00
Simon McVittie
40b5dc824a Add a stub _dbus_loop_toggle_watch and call it where needed
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337
Bug-NB: NB#197191
2011-06-13 17:30:43 +01:00
Simon McVittie
4b43f5db7a DBusLoop: remove second layer of watch callbacks where possible
Similar to the previous commit, almost every use of DBusWatch can just
have the main loop call dbus_watch_handle.

The one exception is the bus activation code; it's had a comment
explaining why it's wrong since 2003. We should fix that one day, but for
now, just migrate it to a new _dbus_loop_add_watch_full which preserves
the second-layer callback.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-06-13 16:09:50 +01:00
Simon McVittie
93385b7339 DBusLoop: remove a layer of pointless abstraction around timeouts
Instead of supplying 8 tiny wrapper functions around dbus_timeout_handle,
each with a user_data parameter that's a potentially unsafe borrowed
pointer but isn't actually used, we can call dbus_timeout_handle directly
and save a lot of trouble.

One of the wrappers previously called dbus_timeout_handle repeatedly
if it returned FALSE to indicate OOM, but that timeout's handler never
actually returned FALSE, so there was no practical effect. The rest just
ignore the return, which is documented as OK to do.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342
Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-06-13 16:07:17 +01:00
Simon McVittie
166bed249d Merge branch 'dbus-1.4'
Conflicts:
	NEWS
	configure.ac
2011-06-10 22:46:42 +01:00
Simon McVittie
88c6b7ac73 fix installable tests to not install if unwanted 2011-06-10 21:52:39 +01:00
Simon McVittie
c83287898c Merge branch 'dbus-1.4' 2011-06-10 18:52:07 +01:00
Simon McVittie
1250da8f7b Fix copyright dates
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:33:22 +01:00
Simon McVittie
6ace0a5cbd Use DBUS_TIMEOUT_INFINITE in dbus-daemon.c
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:33:20 +01:00
Simon McVittie
0fa7d26c8e Test that a message with the byte order mangled causes disconnection but no crash
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:58 +01:00
Simon McVittie
b92612945a marshal test: test dbus_message_demarshal_bytes_needed
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:49 +01:00
Simon McVittie
bf421f5a30 Add a test for marshalling and endian-swapping
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:43 +01:00
Simon McVittie
983fd36264 installcheck: don't run installed tests against installed library if in a DESTDIR
That probably won't work, because it'll find the system-wide library
which might be older.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:40 +01:00
Simon McVittie
715fa5c0d5 Alter test-dbus-daemon so it tests the installed dbus-daemon by default
For installcheck, adjust it to use things from DESTDIR.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:37 +01:00
Simon McVittie
a2f3b17504 Add support for installing most of the modular tests
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:35 +01:00
Simon McVittie
f43d76a83b new test for being disconnected by a corrupt message stream
This was meant to reproduce fd.o #15578, but doesn't; the cause of that
bug isn't this simple.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:27 +01:00
Simon McVittie
da6b4d0426 Test nonce-tcp transport
Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=34569

Reviewed-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:10 +01:00
Simon McVittie
ae5524d632 dbus-daemon test: sanity-check the just-installed config file when using DESTDIR
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:06 +01:00
Simon McVittie
ba9c274f33 Add a simple integration test for dbus-daemon
This just pushes 2000 messages (or 100000 in performance-testing mode)
through the dbus-daemon, to an echo service and back.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:02 +01:00
Simon McVittie
7f25b33f1f Run integration tests on the installed dbus binaries during installcheck
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:57 +01:00
Simon McVittie
1c485fc7be Give the tests DBUS_TEST_DAEMON and DBUS_TEST_DATA in their environment
This will allow modular tests to spawn a dbus-daemon with a specified
config file; nothing uses this just yet.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:51 +01:00
Simon McVittie
841352a73a Attempt to reproduce fd.o #34393 via another regression test
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:47 +01:00
Simon McVittie
65de5fd80a loopback test: unref messages after use
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:46 +01:00
Simon McVittie
163d3b2154 Add an end-to-end sanity check for TCP and Unix DBusServer/DBusConnection
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:42 +01:00
Simon McVittie
fd99c3a1c1 Merge branch 'dbus-1.4' 2011-05-25 17:39:34 +01:00
Simon McVittie
cea055514a Check for X even if X11 autolaunching is disabled
DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However,
the converse is not true.

If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to
the X server to determine when the session ends; most distributors will
want this, but it can be disabled with the standard Autoconf option
--without-x.

If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus
will be willing to perform autolaunch. Again, most distributors will want
this, but it can be disabled with --disable-x11-autolaunch.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
2011-05-25 17:38:44 +01:00
Simon McVittie
2bfac1b73d test-autolaunch: don't expect autolaunching to work if X11 is disabled
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
2011-05-25 17:38:21 +01:00
Simon McVittie
2adf484fb3 Revert merge of master (dbus-1.5) into dbus-1.4
This reverts commits d1d395774435..09c9d6406b75f, keeping Lennart's
addition of UnknownInterface etc.
2011-03-14 11:53:09 +00:00
Simon McVittie
09c9d6406b Make dbus_type_is_valid into public API
This is just as useful for bindings as dbus_signature_validate, and I
think it's a good design principle to say that anything checked in a
_dbus_return_if_fail should be something the caller could check
for themselves.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:14:55 +00:00
Simon McVittie
9a97f82079 Import compiler.m4 and lcov.am from telepathy-glib, and use them to replace gcov
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10887
2011-02-17 17:07:12 +00:00
Simon McVittie
a0e8ae3b77 Merge branch 'dist-30285' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-02 15:15:02 +00:00
Simon McVittie
9fee6d735e Merge branch 'serverdata-33277' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-02 15:14:31 +00:00
Simon McVittie
27f29026c2 Don't distribute generated files that embed our builddir
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30285
2011-02-01 18:04:21 +00:00
Simon McVittie
a431ced679 test/name-test: remove dangling references to test-names.c, which is absent
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-01-25 13:18:03 +00:00
Simon McVittie
4fa3a89d32 test-privserver-client: wait for server to die between iterations
This fixes a race condition: the server exits while the client continues
to the next iteration. If the server wins, the test passes. If the client
wins, it sends a message to the dying service, never gets a reply, and the
test fails.

My branch to refactor the main loop for fd.o #23194 seems to make the
client more likely to win this race, resulting in intermittent test
failures.

This is an instance of the general problem described by fd.o #11454.
2011-01-21 14:22:39 +00:00
Simon McVittie
a9327eba3c test_server_shutdown: disconnect the server before causing it to be freed
Otherwise we die with an assertion failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33277
2011-01-21 14:22:39 +00:00