Commit graph

419 commits

Author SHA1 Message Date
Simon McVittie
a2c623b881 Merge branch 'dbus-1.4' 2011-11-02 15:31:09 +00:00
Simon McVittie
a36d4918a6 corrupt test: compile successfully against older GLib (Debian stable)
We don't really need g_socket_send_with_blocking here.

Also, don't leak the GLib socket objects.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41219
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-11-02 15:20:51 +00:00
Simon McVittie
c587e56b8a Set DBUS_TEST_HOMEDIR when running installcheck
This avoids spamming ~/.dbus and ~/.dbus-keyrings with filesystem activity
while running the tests.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41218
Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-11-02 15:19:54 +00:00
Simon McVittie
e9f0378bbf Merge tests' cmake and autotools bus configuration
In Unix, the tests listened on both debug-pipe (which is a socketpair,
or a TCP emulation of socketpair on Windows) and a Unix socket.

In the Windows port, the tests were hard-coded to listen on a particular
port, which allowed the dispatch test to connect to that port, as long
as no two tests ran simultaneously (which I don't think was ever guaranteed -
make -j can violate this). That's valid out-of-process, and also
fully-specified, so they only needed one <listen> directive, so the
CMake input only had one.

To make the tests work under CMake on Unix, there was a hack: the string
substituted for the content of the <listen> directive contained
</listen><listen> to get the other address in, which is pretty nasty.

Instead of doing that, I've made both build systems, on both Unix and
Windows, use both debug-pipe and a more normal transport (Unix or TCP).
debug-pipe has a Windows implementation and it's used in
dbus-spawn-win.c, so it'd better work. The use of debug-pipe is now
hard-coded rather than being a configure parameter (there's no reason
to vary it in different builds), and I used TEST_LISTEN as the name of the
Unix/TCP address, because it's a "vague" address (no specific Unix path, no
TCP port), that you can listen on but not connect to.

This in turn means that we can merge the Autoconf .in and CMake .cmake
files, similar to Bug #41033.

You might wonder why I've kept debug-pipe. I did try to get rid of it, but
it turns out that the tests in dispatch.c rely on
dbus_connection_open_private() not blocking, and normal socket
connections block on connect(). Until we fix that by adding an async
version of dbus_connection_open_private(), it won't be safe to have a
test like dispatch.c that "talks to itself", unless it uses a transport
as trivial as debug-pipe in which neither end has to block on the other.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-28 19:00:56 +01:00
Simon McVittie
33c43947cd Simplify substitution of test executables to use fewer variables
Also use EXEEXT in all the service files, even in the automake build
system.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-28 19:00:49 +01:00
Simon McVittie
6934bc6927 Simplify generation of bus configuration files
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-28 19:00:11 +01:00
Simon McVittie
0db406cb19 refs test: fix unused variable
This one was added since my more-unused-39231 branch.
2011-09-21 11:56:28 +01:00
Simon McVittie
87d37f0867 Fix compilation of syslog test in master 2011-09-21 11:56:28 +01:00
Simon McVittie
b3b9fc03da Merge branch 'more-unused-39231'
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:45:13 +01:00
Simon McVittie
bf3d8259ac Merge branch 'dbus-1.4'
Conflicts:
	NEWS
2011-09-21 11:39:32 +01:00
Simon McVittie
5defa43b6f Check for Python; skip Python tests if not found
As with the optional test-dependencies on GLib and dbus-glib, we make this
a hard dependency if --enable-tests[=yes], but not if --enable-tests=auto.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
029ecdf402 Add a semi-automatic test for _dbus_system_log
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39987
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
14ed371845 Make "make -C test clean" idempotent
Previously, it'd fail when done twice, because you can't rmdir a
nonexistent directory.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40004
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21 11:25:48 +01:00
Simon McVittie
bf2a1b169f Remove more never-used variables 2011-09-19 13:50:37 +01:00
Simon McVittie
74868224e4 dbus-daemon-eavesdrop test: apply the same Windows fixes as dbus-daemon test
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40003
2011-08-12 10:45:15 +01:00
Simon McVittie
39e3866c0a Fix linking of libdbus-testutils.la with Automake targeting Windows
This regressed in commit 9875480ed - libdbus-testutils.la needs static
linking too.
2011-08-12 10:26:26 +01:00
Simon McVittie
c99a3df254 Merge branch 'dbus-1.4' 2011-08-12 10:26:13 +01:00
Simon McVittie
bc643f81a5 Fix compiler warnings when cross-compiling dbus-daemon test for mingw32
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40003
Reviewed-by: Colin Walters <walters@verbum.org>
2011-08-12 10:21:50 +01:00
Simon McVittie
a1c90cacfa Merge branch 'dbus-1.4'
Conflicts:
	bus/main.c
2011-08-05 14:52:37 +01:00
Simon McVittie
6c6ae1efcd Add a regression test for fd.o #38005
(The dbus-1.4 version.)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 14:46:31 +01:00
Simon McVittie
9f64c1930a relay test: don't leak the server's address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 14:46:09 +01:00
Simon McVittie
0c4a2087c6 Remove various never-used variables
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 12:26:51 +01:00
Simon McVittie
565ae9dea9 test-service, test-shell-service: check what RequestName returned
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 12:26:48 +01:00
Simon McVittie
7430df2416 test, test/name-test: remove SOURCES where they can be inferred from the name of the executable 2011-07-29 11:49:15 +01:00
Simon McVittie
590a835974 test/name-test: remove useless CFLAGS 2011-07-29 11:49:14 +01:00
Simon McVittie
add0b02ee0 test/name-test: use AM_CPPFLAGS instead of INCLUDES 2011-07-29 11:49:13 +01:00
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
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