Commit Graph

46 Commits

Author SHA1 Message Date
Simon McVittie
de8672fe0b gtestutils: Add G_TEST_SUBPROCESS_DEFAULT, G_TEST_TRAP_DEFAULT
This makes calls to test subprocesses with default behaviour more
self-documenting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-23 10:47:13 +01:00
Philip Withnall
7cff1b2265 glib: Update various code comments to mention Meson
Rather than referring to the old autotools build system.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
22cd18500d Fix various const-correctness issues
Spotted when temporarily compiling with -Wwrite-strings. This only goes
a small way towards making the code base -Wwrite-strings–clean. It
introduces no functional changes, and fixes no bugs.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-04-26 15:19:17 +01:00
Philip Withnall
3d8296940a tests: Fix case of a string comparison
Fixup to commit 12e32e96a3.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-11 14:05:21 +01:00
Maks Naumov
12e32e96a3 Don't skip invalid enum values in schemas
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742997
2017-10-11 10:22:23 +01:00
Philip Withnall
ad9d5a11f2 tests: Fix gschema-compile test for translatable string changes
Little did I know when making commit
c257757cf6 that a lot of the output of
glib-compile-schemas is string matched in some of the unit tests. Fix
them to match the updated strings.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=695573
2017-08-03 16:32:42 +01:00
Tim-Philipp Müller
613e00826e meson: gio/tests: add more gio tests
Need to fix up some of the tests a little, because the
test binary will not necessarily be run from the current
build sub-directory, and the build directory structure
might not always be a mirror of the source directory
structure, so pass location of glib-mkenums and
glib-compile-scheme and such directly.
2017-07-13 19:03:39 -04:00
Ryan Lortie
3fa0a051a4 gsettings: add test for repeated <summary> errors
Make sure error handling on repeated <summary> and <description> is
being done properly, not resulting in glib-compile-schemas throwing a
critical.

https://bugzilla.gnome.org/show_bug.cgi?id=747542
2015-04-08 22:35:35 -04:00
Matthias Clasen
b2734d762f glib-compile-schema: Don't accept duplicate docs
This schema compiler was completely ignoring <summary> and
<description> tags. Unfortunately, there are modules out there
who merge translations for these back in, with xml:lang. And
this is giving dconf-editor a hard time. Since this is not
how translations of schemas are meant to be done, just
reject such schema files.

Also add tests exercising the new error handling.

https://bugzilla.gnome.org/show_bug.cgi?id=747209
2015-04-01 18:55:54 -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
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
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
5e1f9173c3 Convert some gio tests to installed tests 2013-05-20 06:38:41 -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
Matthias Clasen
0178402c6d Revert "tests: port from g_test_trap_subprocess() to g_test_trap_fork()"
This reverts commit ea06ec8063.
2012-12-19 15:20:37 -05:00
Dan Winship
ea06ec8063 tests: port from g_test_trap_subprocess() to g_test_trap_fork()
(or, in a few cases, to g_test_expect_message())

https://bugzilla.gnome.org/show_bug.cgi?id=679683
2012-12-19 14:35:10 -05:00
Ryan Lortie
1dc774a653 Remove g_type_init() calls
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Matthias Clasen
b13a79aeb4 Adapt schema tests to changed error messages 2012-08-17 01:15:08 -04:00
Matthias Clasen
fc0b8d4f28 Add a test for CDATA in gschema.xml files 2011-11-07 00:14:28 -05:00
Matthias Clasen
938e57dd4b Adapt tests to string changes 2011-09-11 23:28:44 -04:00
Ryan Lortie
d95b750a1d compile schemas test: open ranges for all types
We need to make sure that every value in the table actually parses with
GVariant.
2011-03-31 15:15:09 +05:30
Ryan Lortie
d2af82e820 gschema-test: invert expectation for min/max omit
It is now completely valid.

Fix up what is now a legitimate range error in the schema used in one of
the tests.
2011-03-31 15:15:09 +05:30
David Zeuthen
1618ca572f Fix test suite breakage caused by Murray's commit
See https://bugzilla.gnome.org/show_bug.cgi?id=645682

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-25 17:56:59 -04:00
Murray Cumming
30fdc1a799 Docs: Changed can not to cannot. 2011-03-24 09:33:55 +01:00
Christian Persch
b4632e1c98 Fix the wrong-category schema test
It's supposed to test a <default l10n="..."> with a non-existent
category, so make it actually check this!

Bug #635882.
2010-11-28 17:26:30 -05:00
Christian Persch
57143e311d Inherit gettext-domain from <schemalist>
When the <schema> doesn't have a 'gettext-domain' attribute, but
the <schemalist> does, use that one.

Bug #635640.
2010-11-28 19:01:21 +01:00
Ryan Lortie
e40f3932dd Bug 628937 - gracefully handle broken schemas
Implement the first of two features requested in the bug: when
encountering a broken .xml schema file, back out the changes in that
file and continue to parse other files.

This prevents a single broken .xml file from messing up GSettings for
everyone else.

Add a --strict option to get the old behaviour.  Use this from the test
cases.
2010-10-01 11:21:02 -04:00
Ryan Lortie
ba0208b3a8 Clean up improper #includes
We have a lot of broken #including going on around the tree.  This has
gone unnoticed due to our sloppy use of -I.
2010-08-06 13:05:18 -04:00
David Zeuthen
aefc6df6bb Fix gschema-compile test
This was broken by commit 1b5b87bfa0

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:30:34 -04:00
Ryan Lortie
5383c7110f Bug 622124 - implement flags for GSettings
Add a <flags> tag to the schema file format and a flags='' attribute to
go along with.  Add some extra test cases for those.

Add new g_settings_{get,set}_flags() calls and support binding to
GParamSpecFlags properties.  Add test cases.
2010-07-01 19:06:02 -04:00
Ryan Lortie
3628b0b499 GSettings: add <override>, tests, modify output
Add <override> tag, more tests, and actually output the results of these
new tags to the gschemas.compiled file.
2010-06-29 20:24:39 -04:00
Ryan Lortie
900a756e8f GSettings: new <schema> tags 'extends', 'list-of'
Add support for extends='' and list-of='' tags to the <schema> element.
The attributes are parsed and some sanity-checking is done but currently
nothing happens as a result.

Add some tests.
2010-06-29 15:58:35 -04:00
Ryan Lortie
a768953760 Fix bug in strinfo
We can't search for a larger needle inside of a smaller haystack, and
unsigned integer subtraction tends to result in very large numbers
rather than small ones.

Add a check for this case and abort out immediately.

Also add a test case (lifted directly from the docs) that demonstrates
the problem.

Issue discovered and tracked down by Milan Bouchet-Valat
2010-06-19 11:41:30 -04:00
Ryan Lortie
fc538894d3 GSettings: enum/choices/aliases/range test cases
Fix a small bug that one of the tests uncovered.
2010-06-17 00:03:44 -04:00
Ryan Lortie
71c5e3f899 Bug 620496 - schema compiler: reject invalid paths
The GSettings schema compiler was accepting any string as a path.  It is
probably quite a common mistake to suspect that '/apps/foo' is a valid
path name when this will cause all sorts of trouble later.  Check for
this case and report the error.
2010-06-07 10:18:43 +02:00
Matthias Clasen
2ed13de153 Fix issues with GSETTINGS_CHECK_RULE
Rename the --schema-files option to --schema-file, since it only
accepts one file at a time. Change the GSETTINGS_CHECK_RULE to
use it that way, too. And also make it work better with !srcdir
builds.

Bugs #616731 and #616864
2010-05-14 21:58:08 -04:00
Christian Persch
6f7fb3744b Add testcases for <range> and <choices>
Bug #616102.
2010-04-25 20:07:26 -05:00
Tor Lillqvist
da306296cf Can't use stderr as a field name 2010-04-25 17:26:41 +03:00
Matthias Clasen
ec664445a9 Rename gschema-compile to glib-compile-schemas
And clean up the autofoo a bit: use an uppercase variable,
check for pkg-config, check for presence of glib-compile-schemas.
2010-04-23 17:27:26 -04:00
Bastien Nocera
e63a1a3d6e Fix gschema-compile tests for --schema-files changes 2010-04-21 15:04:28 +01:00
Matthias Clasen
1c2aea7854 Add tests for --allow-any-name 2010-04-21 09:50:42 -04:00
Matthias Clasen
c83a976245 Add some more schema compiler tests 2010-04-21 00:43:55 -04:00
Matthias Clasen
cd9b8b563f 2.25.0 2010-04-19 17:30:42 -04:00
Matthias Clasen
0e48b0638d Some tests for gschema-compile
Mostly making sure that we produce reasonable error messages for
typical mistakes.
2010-04-19 13:28:00 -04:00
Matthias Clasen
4a605693fc Don't segfault when <default> is missing
Also add a framework for schema compiler tests.

Fixes bug 616086.
2010-04-19 11:49:12 -04:00