Commit Graph

831 Commits

Author SHA1 Message Date
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
Colin Walters
bdf383dcd6 gio/tests: Deduplicate Makefile.am a bit
We can just add all the static test data to EXTRA_DIST.
2013-05-20 20:15:43 +01:00
Matthias Clasen
142d78214d Convert remaining gio tests to installed 2013-05-20 08:46:21 -04:00
Matthias Clasen
5e1f9173c3 Convert some gio tests to installed tests 2013-05-20 06:38:41 -04:00
Dan Winship
e9284ed297 gtestutils: deprecate g_test_trap_fork()
https://bugzilla.gnome.org/show_bug.cgi?id=679683
2013-05-13 12:10:53 -04:00
Dan Winship
e3d1869ee3 tests: port from g_test_trap_subprocess() to g_test_trap_fork()
https://bugzilla.gnome.org/show_bug.cgi?id=679683
2013-05-13 12:10:52 -04:00
Dan Winship
f4a1882341 GProxyAddressEnumerator: add default-port property
Although none of the in-tree GSocketConnectable types need it, other
types (like SoupAddress) may find it useful to be able to pass a URI
and a default-port to GProxyAddressEnumerator separately (the same way
you can with GNetworkAddress). So add a default-port property.

https://bugzilla.gnome.org/show_bug.cgi?id=698877
2013-05-05 16:50:43 -04:00
Mike Ruprecht
c027e88a30 gio/tests: Find "true" in PATH opposed to hardcoding the location
Not all systems have /usr/bin/true. Some have it in /bin/true.
Instead of trying to guess a hardcoded path to find it, let
g_app_info_create_from_commandline() internally search PATH
to find the program.

https://bugzilla.gnome.org/show_bug.cgi?id=698655
2013-04-25 02:54:14 -05:00
Ryan Lortie
c91af2ab44 Test GUnixSocketAddress construction
This test fails without the previous fix and works properly with it.

https://bugzilla.gnome.org/show_bug.cgi?id=698686
2013-04-23 14:36:07 -04:00
Jasper St. Pierre
63a0cc3f8d tests: Fix appinfo test 2013-04-22 13:12:20 -04:00
Ryan Lortie
c16f914b40 GIcon: add g_icon_[de]serialize()
Add support for serialising a GIcon to a GVariant and deserialising the
result back to a GIcon.

This solves a number of problems suffered by the existing to_string()
API, primarily these:

 - not forcing the icon to be a utf8 string means that we can
   efficiently encode a PNG (ie: just give the array of bytes)

 - there is no need to ensure that proper types are loaded before using
   the deserialisation interface.  'Foreign' icon types will probably
   emit a serialised format the deserialises to a GBytesIcon.

We additionally clearly document what is required for being a consumer
or implementation of #GIcon.

Further patches will be required to GdkPixbuf and GVfsIcon to bring
their implementations in line with the new rules (essentially: introduce
implementations of the new serialize() API).

https://bugzilla.gnome.org/show_bug.cgi?id=688820
2013-04-21 16:31:14 -04:00
Sebastian Dröge
bcbaf1bef0 Fix compilation on Android with the bionic C library
https://bugzilla.gnome.org/show_bug.cgi?id=689223
2013-04-16 13:24:26 +02:00
Lars Uebernickel
00f6d78125 g_dbus_connection_signal_subscribe: add path and namespace matching
https://bugzilla.gnome.org/show_bug.cgi?id=695156
2013-04-08 15:59:39 +02:00
Ryan Lortie
8cddb54659 gaction: add parser for detailed action names
Expand and formalise the syntax for detailed action names, adding a
well-documented (and tested) public parser API for them.

Port the only GLib-based user of detailed action names to the new API:
g_menu_item_set_detailed_action().  The users in Gtk+ will also be
ported soon.

https://bugzilla.gnome.org/show_bug.cgi?id=688954
2013-04-01 16:53:54 -04:00
Colin Walters
978571d854 g_file_copy(): Ensure G_FILE_COPY_OVERWRITE preserves permissions
We need to close the stream *before* applying the file modes, because
g_file_replace() allocates a temporary file.  At the moment we're
applying the modes to the extant file, then immediately rename()ing
over it with the default perms.

This regressed with commit 166766a89f.

The real fix here is to have g_file_create_with_info() so that we can
atomically create a file with the permissions we want.

https://bugzilla.gnome.org/show_bug.cgi?id=696014
2013-03-25 16:32:39 -04:00
Tristan Van Berkom
dd0ea5dcc2 Added examples to GTestDBus documentation 2013-03-21 16:37:21 +09:00
Emilio Pozuelo Monfort
605c4ca24e live-g-file: test hidden files
We test for traditional Unix dot-leading files as well as
for files listed in the .hidden file.

https://bugzilla.gnome.org/show_bug.cgi?id=695147
2013-03-13 09:41:09 -04:00
Martin Pitt
97050e503f Fix /appinfo/mime tests
Commit f641699 (for bug 675333) introduced a check whether the Exec= program in
a .desktop actually exists. This broke the /appinfo/mime/* test cases which use
executable names like "my_app".

Use real ones instead (like "echo" and "sleep"), and add a new
/appinfo/mime/ignore-nonexisting test case which verifies that
g_desktop_app_info_new() indeed ignores nonexisting executables.

https://bugzilla.gnome.org/show_bug.cgi?id=695191
2013-03-12 07:07:07 +01:00
Jasper St. Pierre
155f599b20 tests/appinfo: Fix a typo
The environment variable name is BLA, not BAR, so if BAR is
set for some strange reason, the test fails.
2013-03-06 20:32:53 -05:00
Colin Walters
156b14cde5 build: Add --disable-compile-warnings
Some (broken) toolchains for example trip up
-Werror=missing-prototypes in system headers.  This patch allows
people to skip the formerly hardcoded "baseline" warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=694757
2013-02-27 08:34:01 -05:00
Dan Winship
8a77f7bb18 gnetworkaddress: preserve IPv6 scope ID in IP literals
If a GNetworkAddress is created with a hostname like "fe80::xxx%em1",
make sure that the scope_id corresponding to "em1" is present in the
GSocketAddresses it returns when used as a GSocketConnectable.

https://bugzilla.gnome.org/show_bug.cgi?id=684404
2013-02-15 09:10:00 -05:00
Dan Winship
ee17a54c28 GSimpleProxyResolver: new simple GProxyResolver class
Add GSimpleProxyResolver, for letting people do static proxy
resolution, and to use as a base class for other resolvers (such as
GProxyResolverGnome).

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00
Dan Winship
7c49869eae GSocketClient: add proxy-resolver property
Add a proxy-resolver property to GSocketClient, to allow overriding
proxy resolution in situations where you need to force a particular
proxy rather than using the system defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00