Commit Graph

853 Commits

Author SHA1 Message Date
Ryan Lortie
3b1b04433c Add a testcase for DBusActivatable=true
Add a fairly realistic testcase that ensures that GDesktopAppInfo with
DBusActivatable=true can successfully talk to GApplication for a variety
of purposes.

https://bugzilla.gnome.org/show_bug.cgi?id=699259
2013-07-11 15:49:28 -04:00
Ryan Lortie
985e95e831 Add missing file
This got removed during the OnlyShowIn shuffle.
2013-07-11 13:49:20 -04:00
Ryan Lortie
6dc5c118e4 Implement the Desktop Action specification
For some time, the desktop file specification has supported "additional
application actions".  This is intended to allow for additional methods
of starting an app, such as a mail client having a "Compose New Message"
action that brings up the compose window instead of the folder list.

This patch adds support for this with a relatively minimal API.

In the case that the application is a GApplication and DBusActivatable,
desktop actions are translated into GActions that have been added to the
application with g_action_map_add_action().  This more or less closes
the loop on being able to activate an application with an action
invocation (instead of 'activate').

https://bugzilla.gnome.org/show_bug.cgi?id=664444
2013-07-11 12:48:08 -04:00
Ryan Lortie
f77e121650 add GPropertyAction
Add a new type of GAction that represents the value of a property on an
object.  As an example, this might be used on the "visible-child-name"
property of a GtkStack.

https://bugzilla.gnome.org/show_bug.cgi?id=703270
2013-07-11 12:35:45 -04:00
Ryan Lortie
cb4469600c GDBusConnection: be more careful with async GetAll
It's possible to get a org.freedesktop.Properties.GetAll call even if we
have no readable properties in the introspection, in which case we
should return the empty list in the usual way.

We should certainly _not_ be dispatching to the method call handler of
an interface which has no properties (since it will not be expecting
this).

Add a check to make sure that there is at least one readable property
before assuming that a NULL get_property handler implies that we want to
handle properties asynchronously.

Add a testcase that was failing before the change and works after it.

https://bugzilla.gnome.org/show_bug.cgi?id=703437
2013-07-01 23:36:30 -04:00
Ryan Lortie
f754c4e85b GDBusConnection: allow async property handling
The existing advice in the documentation to "simply" register the
"org.freedesktop.DBus.Properties" interface if you want to handle
properties asynchronously is pretty unreasonable.  If you want to handle
this interface you have to deal with all properties for all interfaces
on the path, and you have to do all of the checking for yourself.  You
also have to provide your own introspection data.

Introduce a new convention for dealing with properties asynchronously.

If the user provides NULL for their get_property() or set_property()
functions in the vtable and has properties registered then the
properties are sent to the method_call() handler.  We get lucky here
that this function takes an "interface_name" parameter that we can set
to "org.freedesktop.DBus.Properties".

We also do the user the favour of setting the GDBusPropertyInfo on the
GDBusMethodInvocation for their convenience (for much the same reasons
as they might want the already-available GDBusMethodInfo).

Add a testcase as well as a bunch of documentation about this new
feature.

https://bugzilla.gnome.org/show_bug.cgi?id=698375
2013-06-22 13:38:31 -04:00
Ryan Lortie
12958ed5cc gio/tests: sort tests in the Makefile.am
...to make it clear where people should add theirs, reducing the chance
of conflicts caused by everyone always adding at the end.
2013-06-08 17:01:56 -04:00
Dan Winship
6965b721b1 tests: fix and re-add the broken test 2013-06-05 23:49:56 -03:00
Matthias Clasen
1dac271ace Remove a failing testcase
One of the recently added examples seems wrong. Drop it.
2013-06-05 21:50:52 -04:00
Ryan Lortie
74a034028a tests: add a few more invalid IPv6 address tests
https://bugzilla.gnome.org/show_bug.cgi?id=701401
2013-06-05 19:48:29 -03:00
Dan Winship
16b26231ca gio/tests/inet-address: fix to work on OS X
OS X's getaddrinfo() only supports IPv6 scope IDs that are interface
names, not numbers. So use if_indextoname() to get the name of an
interface and construct an address using that.

https://bugzilla.gnome.org/show_bug.cgi?id=700123
2013-06-04 09:24:47 -03:00
Matthias Clasen
d0301080ee Improve GSettings test coverage 2013-06-02 20:02:06 -04:00
Matthias Clasen
b9406904a5 Add a directory monitoring test 2013-06-02 20:02:06 -04:00
Ryan Lortie
a62079e2e3 tests: Remove a leftover debug printf
https://bugzilla.gnome.org/show_bug.cgi?id=701456
2013-06-02 09:53:24 -04:00
Matthias Clasen
fc35c3487e Improve unix stream test coverage 2013-06-02 01:47:19 -04:00
Matthias Clasen
8f655149e9 Improve GAppInfo test coverage 2013-06-02 01:46:21 -04:00
Matthias Clasen
0326f146fd Improve GMemoryInputStream test coverage 2013-06-02 01:44:49 -04:00
Matthias Clasen
dcf5dea922 Improve GMenuModel test coverage 2013-06-02 01:44:15 -04:00
Matthias Clasen
c40e0b59da Improve GFileAttributeMatcher test coverage 2013-06-02 01:43:13 -04:00
Matthias Clasen
0753ae1235 Improve GIcon test coverage 2013-06-02 01:42:28 -04:00
Matthias Clasen
49d39633d1 Improve test coverage for GZipCompressor 2013-06-02 01:41:50 -04:00
Matthias Clasen
2f3f270fcc Improve test coverage for GBufferedOutputStream 2013-06-02 01:41:09 -04:00
Matthias Clasen
fed8ae38c3 Improve test coverage a bit 2013-06-01 18:51:25 -04:00
Ryan Lortie
79972d22ac Fix failure to build exit-on-close gdbus test
In the case that HAVE_DBUS_DAEMON was undefined (as in ostree where glib
is built before D-Bus) this test was failing.  Move it inside the
HAVE_DBUS_DAEMON block.
2013-06-01 11:38:10 -04:00
Ryan Lortie
e042db0f83 GSettings tests: reverse installed test complexity
Remove the complications that were introduced in an attempt to make the
gsettings and gschema-compile tests function as installed tests.  These
tests are designed (in large part for gsettings and entirely for
gschema-compile) to test the in-tree tools and should not be testing the
system versions.

In the future we may want to move the use of the in-tree tools from the
gsettings testcase into the Makefile and install the resulting files,
allowing this testcase to run against those files, installed.
2013-05-31 23:16:00 -04:00
Ryan Lortie
f9eb9eed10 Rework the build system for a new tests approach
Perform a substantial cleanup of the build system with respect to
building and installing testcases.

First, Makefile.decl has been renamed glib.mk and substantially
expanded.  We intend to add more stuff here in the future, like canned
rules for mkenums, marshallers, resources, etc.

By default, tests are no longer compiled as part of 'make'.  They will
be built when 'make check' is run.  The old behaviour can be obtained
with --enable-always-build-tests.

--disable-modular-tests is gone (because tests are no longer built by
default).  There is no longer any way to cause 'make check' to be a
no-op, but that's not very useful anyway.

A new glibtests.m4 file is introduced.  Along with glib.mk, this
provides for consistent handling of --enable-installed-tests and
--enable-always-build-tests (mentioned above).

Port our various test-installing Makefiles to the new framework.

This patch substantially improves the situation in the toplevel tests/
directory.  Things are now somewhat under control there.  There were
some tests being built that weren't even being run and we run those now.
The long-running GObject performance tests in this directory have been
removed from 'make check' because they take too long.

As an experiment, 'make check' now runs the testcases on win32 builds,
by default.  We can't run them under gtester (since it uses a pipe to
communicate with the subprocess) so just toss them in TESTS.  Most of
them are passing on win32.

Things are not quite done here, but this patch is already a substantial
improvement.  More to come.
2013-05-31 23:12:15 -04:00
Ryan Lortie
e66abbe2ef Some final g_test_build_filename() porting
This should be the last users that need to be ported.

For some of the oldschool non-gtester-ified tests, we call g_test_init()
from main() because it is necessary in order to use
g_test_build_filename().
2013-05-31 23:03:19 -04:00
Matthias Clasen
a114e98d09 Split off the gdbus-overflow test
It is unrealiable under load, and frequently fails in the
ostree tests. See https://bugzilla.gnome.org/show_bug.cgi?id=701105
2013-05-31 21:24:21 -04:00
Ryan Lortie
ccc039c705 Remove org.gtk.test.gschema
This is the old non-xml schema file format that we were playing around
with at one time.  Nothing is using this file anymore.
2013-05-29 23:31:19 -04:00
Ryan Lortie
8df1bb3486 Rename G_TEST_DISTED to G_TEST_DIST
Since this feature is so utterly automake-centric, we may as well be
using the same terminology as automake itself (ie: although it's
BUILT_SOURCES, it's DIST_EXTRA, not DISTED).

Also add some comments to the enum explaining that these terms are
really corresponding directly to the automake terms.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:32 -04:00
Ryan Lortie
da478acd3c Remove G_TEST_DATA= from installed .test files
This is no longer needed with the new test data file finding stuff.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:32 -04:00
Ryan Lortie
ddd7e941f4 Test data file API: port two more testcases
These ones were slightly non-trivial so they didn't get included in the
previous patches.  Port them now.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:32 -04:00
Ryan Lortie
17ded322c5 tests: move tests to new _get_filename() API
This API was introduced to save a few lines of code here and there, so
let's start by removing a bunch from our own tests.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:32 -04:00
Ryan Lortie
58c6ca32aa tests: use new g_test_build_filename() API
Port most of the tests to the new g_test_build_filename() API.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:31 -04:00
Matthias Clasen
98a921045c Fix make check with builddir != srcdir
This broke when the tests were converted to be installable.
My apologies.
2013-05-27 21:21:55 -04:00
Colin Walters
4ec32e6fa8 gio/tests: Make gdbus-proxy-well-known-name handle srcdir != builddir 2013-05-27 19:30:31 -04:00
Ryan Lortie
7336a1e745 Fix yet more test regressions... 2013-05-27 18:34:53 -04:00
Ryan Lortie
42139d4637 One more broken test.... 2013-05-27 18:34:53 -04:00
Ryan Lortie
8f87d428a6 More srcdir != destdir tests fallout 2013-05-27 18:27:26 -04:00
Colin Walters
0b167b0ae9 build: Fix usage of %.test again
We actually need the first dependency because it includes the
final executable name.  Rather, fix the original bug by using
the variable $(EXEEXT).
2013-05-24 22:16:44 +01:00
Colin Walters
5088c705ac tests: Drop unnecessary % from .test pattern match rule
On Windows, the executables will have .exe, so this won't
match.  Furthermore, they aren't actually dependent on the
executable to build.
2013-05-24 16:30:21 -04:00
Colin Walters
49030c8797 gdbus-peer: Drop some usage of g_thread_yield()
It's a recipe for race conditions and error; on some hardware
architectures one thread isn't guaranteed to see the results
of writes from another thread without a cache flush.

https://bugzilla.gnome.org/show_bug.cgi?id=700855
2013-05-23 10:11:21 -04:00
Josep Puigdemont
c9cc0beb3a Timeout the test if dbus sevice has not appeared in due time.
The test /gdbus/connection/large_message waits for a dbus name to appear.
The dbus name is created by a another process executed in the background.
If for some reason this fails, the test will likely wait forever.
This will avoid this situation by making the test fail if the dbus service
has not appeared after 10 seconds.

https://bugzilla.gnome.org/show_bug.cgi?id=698981
2013-05-21 11:18:08 -04:00
Dan Winship
4b94c0831e Use 'dumb quotes' rather than `really dumb quotes'
Back in the far-off twentieth century, it was normal on unix
workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
APOSTROPHE to be drawn as "’". This led to the convention of using
them as poor-man's ‛smart quotes’ in ASCII-only text.

However, "'" is now universally drawn as a vertical line, and "`" at a
45-degree angle, making them an `odd couple' when used together.

Unfortunately, there are lots of very old strings in glib, and also
lots of new strings in which people have kept up the old tradition,
perhaps entirely unaware that it used to not look stupid.

Fix this by just using 'dumb quotes' everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=700746
2013-05-21 11:23:22 -03:00
Colin Walters
bb1a5ca9a8 gio/tests: Fix gdbus-connection when run from "make check" 2013-05-21 09:21:21 -04:00
Colin Walters
c26e253b10 gio/tests: gsettings is a developer-only test
It tries to run glib-compile-schemas and glib-mkenums, which
we won't have in the runtime tree.

Anyways it's kind of a dumb test since the best test for
compilation tools is...compiling things, which we already
do frequently.
2013-05-21 00:12:31 +01:00
Colin Walters
c12538a9c0 gio/tests: Disable desktop-app-info test in installed mode for now
It wants a writable copy of the applications, and appears to
depend on a prior execution of "mimeapps".  This will take
a bit of work to untangle.
2013-05-21 00:02:39 +01:00
Colin Walters
3d7fcc23c1 gio/tests: Make gdbus-peer work in installed mode
There's no /etc/hosts in gnome-ostree...
2013-05-20 21:50:28 +01:00
Colin Walters
7ee44da5cf gio/tests: Fix gapplication test in installed mode 2013-05-20 21:43:52 +01:00
Colin Walters
1a398b2e56 gio/tests: Some more fixes for installed tests
file passes now, appinfo needs a bit more work, but is getting
there.
2013-05-20 21:33:00 +01:00