Commit graph

57 commits

Author SHA1 Message Date
Ralf Habacker
34d0c73f99 Test system bus config files on Unix only
Previously, we didn't consistently test parsing of every file in
valid-config-files-system/ everywhere that we tested valid-config-files/.
We now test it on Unix.

The system bus is not supported on Windows, so we do not test
valid-config-files-system/ there.

valid-config-files/many-rules.conf contains <user> and <group> rules
which are not applicable to Windows. Copy the original many-rules.conf
to valid-config-files-system/ so that it will be tested on Unix, and
remove the non-portable rules from valid-config-files/many-rules.conf.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[rh:base patch came from Simon]
2015-11-03 14:22:30 +01:00
Ralf Habacker
12214344a2 Keep cmake build system in sync with autotools (add test-monitor).
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-10-21 13:26:16 +02:00
Ralf Habacker
2c7abec29e Add test-fdpass to cmake build system.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17289
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-03-04 18:43:54 +00:00
Ralf Habacker
53d3914946 Add manual-paths test executable with cmake build support.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-12 23:22:18 +01:00
Simon McVittie
94610d7de6 Add a common test_init() for GLib tests which prevents hanging forever
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04 17:15:36 +00:00
Ralf Habacker
b36747519a Link tests to test-utils-glib.c under CMake too
[Separated out from a larger commit -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88964
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-04 15:11:48 +00:00
Ralf Habacker
fa1ada44ea Add manual tcp test case.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-30 09:33:40 +01:00
Ralf Habacker
ea54a97f05 Merge branch 'dbus-1.8'
Conflicts:
	NEWS
	configure.ac
2015-01-05 11:49:48 +01:00
Ralf Habacker
01af167b55 Windows cmake cross compile fix
We need to include 'test' subdir in any case not only when using glib.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88009
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-05 11:47:13 +01:00
Ralf Habacker
8ad6a5575f Include test-dbus and test-bus in cmake 'make check' target.
Because test-dbus and test-bus lives in subdirectory dbus/bus, we need
to define make 'check' in top level source directory.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-10-24 18:49:44 +02:00
Simon McVittie
8fd6e561df cmake: only copy session.conf and system.conf into test data dir
Historically, CMake used the glob *.conf.in whereas Autotools listed
the files explicitly. This used to be equivalent, but broke down
when we added example-*.conf.in which are just snippets rather than
complete configuration files (they're intended to go in session.d
or system.d, or otherwise get included by the main config file).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2014-10-24 16:51:53 +02:00
Ralf Habacker
89c6173706 Add directory test application 'manual-dir-iter' to cmake and autotools build system.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57272
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-09-08 14:33:37 +00:00
Ralf Habacker
d8394d75d1 Win32 cmake msvc16 64 bit native and mingw32/64 4.8.3 cross compile fix.
This patch fixes a "missing include directory" compile error on test-print build target.

Bug: http://lists.freedesktop.org/archives/dbus/2014-August/016260.html
Reviewed-by: rony@wu.ac.at
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2014-08-08 19:03:05 +02:00
Ralf Habacker
5dfc800644 Let cmake 'make check' run test applications as test group.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17 16:29:37 +00:00
Ralf Habacker
54440baa21 Rename spawn-test to test-spawn to match common test application naming scheme.
[Same change as for shell-test in the previous commit. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17 16:29:19 +00:00
Ralf Habacker
e782b0806e Rename shell-test to test-shell to match common test application naming scheme.
[Add its source file to SOURCES: this test was previously relying on the
Automake feature that the default value of foo_bar_SOURCES is foo-bar.c. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17 16:28:39 +00:00
Ralf Habacker
8e728f36d1 Use macros for test and helper executable targets on cmake build system.
The new macros add_test_executables and add helper_executables provides a
platform independent way for specifing dbus test and service applications.

On native Windows and Linux/UNIX systems the test applications are
directly runable.

When cross compiling for Windows on Linux test applications could be
executed on the Linux host system with the help of wine and activated
binfmt_misc support for wine.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10 01:24:56 +01:00
Ralf Habacker
79a7a30cdb Add 'check' cmake target to keep in sync with autotools.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10 01:07:38 +01:00
Ralf Habacker
21ad24ada5 Create session.conf and system.conf for test/data/valid-config-files from *.in files on cmake.
We need to patch the listen address.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10 00:48:50 +01:00
Ralf Habacker
67a78c4ef6 Define TEST_BUS_LAUNCH_BINARY for cmake to keep in sync with autotools.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10 00:41:02 +01:00
Ralf Habacker
9866c2d785 Remove obsolete cmake project tags in sub directories; we only have one project.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-08 01:35:49 +01:00
Ralf Habacker
e09eb12683 Add glib support to cmake buildsystem.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-07 19:06:26 +01:00
Simon McVittie
30e7a81302 Tests: allow dbus-glib to be replaced with use of libdbus-internal
We only use dbus-glib for its main loop; within dbus, DBusLoop is
available as an alternative, although it isn't thread-safe and
isn't public API.

For tests that otherwise only use libdbus public API, it's desirable to
be able to avoid DBusLoop, so we can run them against an installed
libdbus as an integration test. However, if we don't have dbus-glib,
we're going to have to use an in-tree main loop, which might as well
be DBusLoop.

The major disadvantage of using dbus-glib is that it isn't safe to
link both dbus-1 and dbus-internal at the same time. This is awkward
for a future test case that wants to use _dbus_getsid() in dbus-daemon.c,
but only on Windows (fd.o #54445). If we use the same API wrapper around
both dbus-glib and DBusLoop, we can compile that test against dbus-glib
or against DBusLoop, depending on the platform.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03 12:00:51 +01:00
Chengwei Yang
0cb7d487bc tests to embedded tests: replaced in cmake files
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291
2013-06-28 12:18:32 +01:00
Simon McVittie
f56a55af1a Revert "made session service dirs customizable: cmake part"
This reverts commit 89e453216c.
It makes the tests fail under autotools.
2012-01-04 18:20:15 +00:00
Ralf Habacker
89e453216c made session service dirs customizable: cmake part 2011-11-21 12:21:01 +01:00
Simon McVittie
c141af6147 Remove EXT variable from CMake, just use Automake-compatible EXEEXT
According to Ralf, there's no standard name for this in CMake, so we
might as well use the standard Automake name.

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:01:15 +01: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
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
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
Ralf Habacker
37619035de Keep in sync with automake. 2010-12-04 23:05:56 +01:00
Ralf Habacker
280cdc2ad8 Added missing test libraries and tools to keep in sync with autotools. 2010-04-13 21:18:41 +02:00
Ralf Habacker
e828d41e3e Keep test file directories in sync with autotools 2010-04-13 21:17:31 +02:00
Ralf Habacker
4d8dcd5561 Cmake build system cleanup.
Converted tabs to spaces and removed trailing spaces in test dir.
2010-04-11 11:53:56 +02:00
Ralf Habacker
0ed7d779b7 Cmake support for cross plattform usable test files.
Recent test configuration files contains 'unix:...'
bus adresses which do not work on windows.
For cross plattform usable test files the whole
listen tag entry has to be set by the build system,
which is available with a new build system variable
named TEST_LISTEN.
To have the client client side definition in sync,
TEST_CONNECTION has been moved from c file into cmake
build system.
2010-04-11 11:49:46 +02:00
Ralf Habacker
19251c52de Simplified cmake specific test file generating.
If there is a *.cmake test file available for
a related *.in file, take the *.cmake test file
instead of the *.in file as test file source.
Also added some messages.
2010-04-09 23:07:11 +02:00
Ralf Habacker
1d0076b500 Keep cmake build system in sync with commit d47154c28b. 2010-03-22 22:33:02 +01:00
unknown
2154acb349 Make the windows binaries and build match the linux one with cmake buildsystem.
This is performed by including the files from the client lib in the internal one
and by removing the linking to dbus-1 for targets using the internal library.
2010-03-22 10:41:06 +01:00
Ralf Habacker
d999abdaa8 CMake dbus libraries usage cleanup.
Renamed DBUS_LIBRARIES to DBUS_INTERNAL_LIBRARIES and moved to top level CMakeLists.txt.
Removed obsolate references of dbus-internal library.
Added DBUS_LIBRARIES definition which contains only the dbus library.
2010-03-20 22:33:58 +01:00
Ralf Habacker
76919f681c fixed bus-test sha1 connection address on unix with cmake build system 2010-03-08 15:56:56 +01:00
Romain Pokrzywka
b0e0cd03e8 commented bits cleanup 2010-02-07 00:32:44 +01:00
Romain Pokrzywka
bbd1c9fe82 now fix the build for the tests; turns out we need another set of exports, since some tests are compiled in the client lib and some are in the internal lib... 2010-02-07 00:32:39 +01:00
Ralf Habacker
4a24e84aa7 readded test files required for windows 2009-12-01 10:53:53 +01:00
Frank Osterfeld
08f8057d1f do not run test binaries as unit tests if they aren't unit tests (cherry picked from commit 5281f5b113bd97152d1c9eac050432bda3274748) 2009-11-30 13:43:18 +01:00
Frank Osterfeld
fa2a53309d fix warning, use Sleep, not _sleep on windows (cherry picked from commit ea36c743ad60a2dd5c6286571d1a475903519809) 2009-11-30 12:00:14 +01:00
Frank Osterfeld
9f36b6760c fix TEST_SOCKET_DIR on windows, do not override value from top-level in test/ (cherry picked from commit fde144333281348cda2d533331946996d7a09bff) 2009-11-30 11:39:23 +01:00
Frank Osterfeld
c89d506700 bus-test-launch-helper is a unit test, test-service and test-shell-service are not. Rename test-shell to shell-test to match autotools (cherry picked from commit b106387b73d6a300a013a15f6507244e82f007ed) 2009-11-30 11:39:21 +01:00
Frank Osterfeld
a4e65790ea Use correct sources to build test-shell-service, fixes a hang in bus-test (cherry picked from commit 0afe04db5152b57582863bef83a55d78020a79c6) 2009-11-30 11:39:21 +01:00
Ralf Habacker
ed1c2fdd82 removed obsolate files 2009-11-30 11:28:37 +01:00
Frank Osterfeld
dbde622530 cleanup: these files are already generated elsewhere (cherry picked from commit 21f66df24affd4a4d2fb3324fb51899c811530da) 2009-11-30 11:26:13 +01:00