Commit Graph

904 Commits

Author SHA1 Message Date
Emmanuele Bassi
16d1a3d28c Classify the tests
Meson has the ability to classify tests according to "suites", a list of
tags. This is especially useful when we want to run specific sets of
tests — e.g. only GLib's tests — instead of the whole test suite. It
also allows us to classify special tests, like "slow" ones, so that we
can only run them when needed.
2018-06-10 15:33:06 +01:00
Xavier Claessens
27ec1469ab Remove developer script not needed in git repository 2018-06-04 22:27:22 -04:00
Xavier Claessens
b04cf01934 Remove old tests not being built since 2012
Those tests are failing and are not built since commit d6a075b
2018-06-04 22:18:02 -04:00
Xavier Claessens
4a369a0b6c Remove tests/gio-ls.c that never has been built 2018-06-04 21:53:00 -04:00
Iain Lane
51d566ba6e test_paths: Reindent to avoid tripping -Wmisleading-indentation
This fixes:

glib/tests/testglib.c: In function ‘test_paths’:
glib/tests/testglib.c:955:3: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
   if (g_test_verbose ())
   ^~
glib/tests/testglib.c:958:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
     {
     ^

https://bugzilla.gnome.org/show_bug.cgi?id=796385
2018-05-30 10:07:35 +01:00
Christoph Reiter
e894534314 tests: Increase the timeout of the 'objects2' and 'sequence' tests. Fixes #1393
These two still fail occasionally due to timeouts, so increase it a bit.
2018-05-26 20:19:53 +02:00
Philip Withnall
cc4de801c9 gobject: Reimplement g_param_values_cmp() for GParamSpecVariant
The existing implementation was completely incorrect (despite the fix in
commit 566e64a66) — it always compared GVariants by pointer, rather than
by value.

Reimplement it to compare them by value where possible, depending on
their type. The core of this implementation is g_variant_compare(). See
the documentation and tests for further details of the new sort order.

This adds documentation and tests.

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

https://bugzilla.gnome.org/show_bug.cgi?id=795735
2018-05-04 18:17:59 +01:00
Georges Basile Stavracas Neto
b9b642de06 fileutils: Add g_canonicalize_filename
Getting the canonical filename is a relatively common
operation when dealing with symbolic links.

This commit exposes GLocalFile's implementation of a
filename canonicalizer function, with a few additions
to make it more useful for consumers of it.

Instead of always assuming g_get_current_dir(), the
exposed function allows passing it as an additional
parameter.

This will be used to fix the GTimeZone code to retrieve
the local timezone from a zoneinfo symlink.

(Tweaked by Philip Withnall <withnall@endlessm.com> to drop g_autofree
usage and add some additional tests.)

https://bugzilla.gnome.org/show_bug.cgi?id=111848
2018-04-30 21:54:31 +01:00
Philip Withnall
9b4c50f63d all: Remove trailing newlines from g_message()/g_warning()/g_error()s
All those logging functions already add a newline to any message they
print, so there’s no need to add a trailing newline in the message
passed to them.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-04-27 16:46:19 +01:00
Emmanuele Bassi
94d4e8b2fb Initialize variables before using them
Avoid a compiler warning when using the average, minimum, and maximum
elapsed variables without initializing them.

https://bugzilla.gnome.org/show_bug.cgi?id=794732
2018-03-28 11:49:59 +01:00
Ernestas Kulik
03e86d000f Remove HAVE_CONFIG_H defs and uses
Since GLib files are only meant to be built as part of GLib, config.h
always exists, so the checks are more or less pointless.

https://bugzilla.gnome.org/show_bug.cgi?id=793399
2018-02-21 13:57:10 +00:00
Christian Hergert
f44472e715 gobject: fix typecasts via g_object_ref
Now that g_object_ref() propagates the parameter type to the
return value, we need to cast to ensure the result is warning
free.

https://bugzilla.gnome.org/show_bug.cgi?id=790697
2017-12-04 11:42:58 +00:00
Philip Withnall
82adf7b5da tests: Work around a gdb bug in assert-msg-test
It seems that when GLib is compiled without CFLAGS=-g, gdb can’t work
out the size of __glib_assert_msg, so assumes it’s 4 bytes — even on
64-bit systems. This causes it to not read the most significant 4 bytes
of the assertion message pointer, and hence it can’t print the stored
assertion message. This causes assert-msg-test to fail.

The upstream gdb bug is
https://sourceware.org/bugzilla/show_bug.cgi?id=22501.

Work around that by referencing and dereferencing __glib_assert_msg so
that gdb treats it as a pointer of sizeof(char*) rather than of the size
it incorrectly calculated from the library’s symbol table (or through
some other mystical process).

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

https://bugzilla.gnome.org/show_bug.cgi?id=782057
2017-11-27 11:44:08 +00:00
Nirbheek Chauhan
bd22bb9898 meson: Use files() for gio sources and headers
This allows them to be fetched with subproject().get_variable(). Needed
for generating Gio-2.0.gir in the gobject-introspection meson port.
2017-11-23 23:03:57 +05:30
Philip Withnall
f2c093f657 build: Drop --enable-rebuilds configure option
It is outdated and no longer effectively used. It was originally in
place to prevent rebuilding generated files (from a tarball) if the
right build tools (awk, Perl, indent) were not available. However, we no
longer use indent, we have hard-required awk for a while, and the only
places the @REBUILD@ substitution was still used were for
glib-genmarshal, which has recently been rewritten in Python (so no
longer depends on whether Perl is available).

Drop the whole lot.

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

https://bugzilla.gnome.org/show_bug.cgi?id=694723
2017-11-17 15:11:47 +00:00
Emanuele Aina
e73831d808 tests: Re-wire the testgobject test program to the build system
After the build system rework in commit f9eb9e testgobject fell through
the cracks and was not built since then.

Re-enable it, even if it is currently failing due to commit 31fde56.

(Tweaked by Philip Withnall to add meson.build support.)

https://bugzilla.gnome.org/show_bug.cgi?id=701156
2017-11-17 12:27:10 +00:00
Emanuele Aina
edcabe1a4e tests: Don't assume that private data follows the instance data
Commit 31fde56 changed the way the private data is laid out in memory by
putting it *before* the instance data to keep the offsets fixed
regardless of the number of many subclasses.

This means that the invariant testgobject was verifying is no longer
true and the failing tests can be safely dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=701156
2017-11-17 12:26:23 +00:00
Руслан Ижбулатов
4a77eb16ce Replace all instances of ssize_t with gssize
ssize_t is supported widely, but not universally, so use gssize instead.
Currently only one piece of code actually *needs* this change to be compilable
with MSVC, the rest are mostly in *nix parts of the code, but these are changed
too, for symmetry.

https://bugzilla.gnome.org/show_bug.cgi?id=788180
2017-10-11 12:56:11 +01:00
Philip Withnall
5cddde1fb2 Consistently save errno immediately after the operation setting it
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret < 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () && errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-08-03 10:21:13 +01:00
Emmanuele Bassi
a45bf85ce5 tests: Do not use gnome.genmarshal()
We are providing glib-genmarshal; using the gnome module in Meson does
not call the just built glib-genmarshal tool.
2017-07-17 13:59:20 +01:00
Emmanuele Bassi
3c03cc8f68 meson: Simplify the use of built tools
The Meson build has fallen a bit behind the Autotools one, when it comes
to the internally built tools like glib-mkenums and glib-genmarshals.

We don't need to generate gmarshal.strings any more, and since the
glib-genmarshal tool is now written in Python it can also be used when
cross-compiling, and without indirection, just like we use glib-mkenums.

We can also coalesce various rules into a simple array iteration, with
minimal changes to glib-mkenums, thus making the build a bit more
resilient and without unnecessary duplication.
2017-07-17 11:05:07 +01:00
Tim-Philipp Müller
2e9fd74b25 meson: add tests/gobject and tests/refcount 2017-07-13 19:03:39 -04:00
Philip Withnall
a131134918 build: Drop nmake/MSC build system for GLib
It hasn’t been seriously maintained for the best part of 10 years and is
very outdated. The recommended way to build GLib on Windows is now
Visual Studio:

https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack#GLib

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

https://bugzilla.gnome.org/show_bug.cgi?id=722047
2017-07-10 11:22:40 +01:00
Rico Tzschichholz
8e23a514b0 unicode: Update test data files for unicode 10.0.0
https://bugzilla.gnome.org/show_bug.cgi?id=784456
2017-07-05 17:53:07 +02:00
Sébastien Wilmet
f6c44ec3e4 tests/: LGPLv2+ -> LGPLv2.1+
gen-casefold-txt.pl and gen-casemap-txt.pl are licensed under GPLv2+, so
they are not touched by this commit.

A lot of *.c files in tests/ don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:35 +02:00
Philip Withnall
a05b64a0cb build: Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENT
TESTS_ENVIRONMENT is reserved for the user to be able to set when
running the tests. AM_TESTS_ENVIRONMENT is for the tests’ Makefile to
set itself.

https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html

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

https://bugzilla.gnome.org/show_bug.cgi?id=782996
2017-05-23 13:29:40 +01:00
Emmanuele Bassi
f952fdf3fc Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly
inconsistent in the past, but the semi-colon-less version clearly
dominates in the code base.

https://bugzilla.gnome.org/show_bug.cgi?id=669355
2017-04-10 10:38:31 +01:00
Sébastien Wilmet
6231b1abc9 License headers: replace current FSF address by a link to gnu.org
Even if the address is correct, it's far more convenient to have a link
to a website.

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:57 +01:00
Simon McVittie
0d28ee458f type-test: do not rely on signed integer overflow wrapping around
Signed integer overflow is undefined behaviour: if a compiler
detects signed integer overflow, it is free to compile it to absolutely
anything.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:47 +00:00
Ross Burton
11a6e19e07 tests/refcount/signals: don't shadow rand()
rand() is in the C library and some C libraries (uclibc, for example) end up
with rand() defined even if stdlib.h isn't included explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=774421
2016-11-14 18:33:32 +00:00
Rico Tzschichholz
1ff79690fb unicode: Update test data files for unicode 9.0.0
https://bugzilla.gnome.org/show_bug.cgi?id=771591
2016-09-21 18:31:10 +02:00
Matthias Clasen
3624e70508 Update Unicode test data for Unicode 8
These files are used by the unicode-caseconv test.
2015-10-06 06:49:48 -04:00
Matthias Clasen
e773acfe9a tests: Don't test g_utf8_to_ucs4_fast too rigorously
The function is documented to assume valid input, and doesn't
guarantee behavior with invalid input. So don't test that.

https://bugzilla.gnome.org/show_bug.cgi?id=754636
2015-09-07 15:01:16 -04:00
Matthias Clasen
db3ffe5bf1 unicode-encoding test: Differentiate error messages
Spitting out the same error for different cases in not helpful.
2015-09-07 15:01:16 -04:00
Emmanuele Bassi
5ce70917df Drop binary checks when cross-compiling
We don't need to run binaries we just built in order to successfully
build GLib and friends any more.

Since commit b74e2a7, we don't need to run glib-genmarshal when building
GIO; since commit f9eb9eed, all our tests (including the ones that do
need to run binaries we just built) are only built when running "make
check", instead of unconditionally at every build.

This means that we don't need to check for existing, native binaries
when cross-compiling, and fail the configuration step if they are not
found — which also means that you don't need to natively build GLib for
your toolchain, in order to cross-compile GLib.

We can also use the cross-compilation conditional, and skip those tests
that require a binary we just built in order to build.

https://bugzilla.gnome.org/show_bug.cgi?id=753745
2015-09-01 10:40:24 -04:00
Simon McVittie
45dae4b506 tests: replace most g_print() with g_printerr()
I searched all files that mention g_test_run, and replaced most
g_print() calls. This avoids interfering with TAP. Exceptions:

* gio/tests/network-monitor: a manual mode that is run by
  "./network-monitor --watch" is unaffected
* glib/gtester.c: not a test
* glib/gtestutils.c: not a test
* glib/tests/logging.c: specifically exercising g_print()
* glib/tests/markup-parse.c: a manual mode that is run by
  "./markup-parse --cdata-as-text" is unaffected
* glib/tests/testing.c: specifically exercising capture of stdout
  in subprocesses
* glib/tests/utils.c: captures a subprocess's stdout
* glib/tests/testglib.c: exercises an assertion failure in g_print()

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:56 +01:00
Simon McVittie
0a9d91ab7b testglib: my_hash_callback_remove_test: actually fail the test
The test is to remove all the odd values with my_hash_callback_remove(),
then iterate over all values and verify that they are even. However,
failing this check would just print "bad!" instead of failing the test.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:50 +01:00
Alexander Larsson
2266f6b743 tests/gobject/performance: Clean up and add refcount performance test 2014-07-30 12:10:30 +02:00
Christian Persch
b39b19ca20 unicode: Update test data files for unicode 7.0.0
https://bugzilla.gnome.org/show_bug.cgi?id=731929#c2
2014-06-29 20:18:48 +02:00
Ryan Lortie
dce88768dc all: remove use of 'register' keyword
We should have done this a decade ago...

https://bugzilla.gnome.org/show_bug.cgi?id=730293
2014-06-28 13:07:52 -04:00
Daniel Macks
93d0c63232 assert-msg-test: Explicitly quit gdb session to avoid zombie
gdb is run in batch mode, and can leave leave the program being
executed/debugged running when the batchfile is finished. Explicitly
"quit"ing the subprocess prevents it from leaving the stray subprocess
when gdb finishes.

https://bugzilla.gnome.org/show_bug.cgi?id=731366
2014-06-10 08:57:54 -04:00
Matthias Clasen
367dbdce36 Fix the mapping test in continuous
It turns out that due to a recent gdm change, the inherited
signal mask has SIGUSR1 blocked - which is bad news for
tests using SIGUSR1. Fix the test by explicitly checking the
signal mask before using SIGUSR1.
2014-05-30 10:22:35 -04:00
Matthias Clasen
1e28df0264 Add more debug spew to the mapping-test 2014-05-28 06:16:11 -04:00
Matthias Clasen
de1c0722b9 mapping-test: Add debug spew
This might help figuring out why the test is failing in continuous.
2014-05-27 22:13:33 -04:00
Matthias Clasen
922dd548d5 Try to fix mapping-test
The mapping-test is failing under gnome-continuous. I suspect this
is simply due to running many tests in parallel, and mapping-test
being racy. Replace the blind sleep by signals, to avoid the
races.
2014-05-22 17:25:34 -04:00
Colin Walters
4cbee6a35b Restore executability for other files 2014-01-31 09:36:52 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Matthias Clasen
27e352985b Remove broken attempt at parsing date-only
g_time_val_from_iso8601 was attempting to parse strings
having only a date, but failed to actually set the timeval
despite returning TRUE. Since the docs state that the function
only parses strings containing a date and a time, just return
FALSE in this case.

Also remove an incomplete testcase for this behaviour that was
just checking the boolean return value, but not timeval.
2014-01-01 17:59:21 -05:00
Ryan Lortie
3f41e49285 Use POSIX-specified <poll.h> over <sys/poll.h>
POSIX specifies that <poll.h> is the correct header to include for
poll(), so let's do that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=141251
2013-12-22 11:33:07 -05:00
Stef Walter
3f8888d348 sources: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-12-15 19:29:26 -05:00
Dan Winship
158dde0507 Replace #ifdef HAVE_UNISTD_H checks with #ifdef G_OS_UNIX
In Windows development environments that have it, <unistd.h> is mostly
just a wrapper around several other native headers (in particular,
<io.h>, which contains read(), close(), etc, and <process.h>, which
contains getpid()). But given that some Windows dev environments don't
have <unistd.h>, everything that uses those functions on Windows
already needed to include the correct Windows header as well, and so
there is never any point to including <unistd.h> on Windows.

Also, remove some <unistd.h> includes (and a few others) that were
unnecessary even on unix.

https://bugzilla.gnome.org/show_bug.cgi?id=710519
2013-11-20 09:25:39 -05:00
Michael Haubenwallner
b1af471a3f build: Give internal libraries higher precedence
Linking local libraries too late may cause preinstalled libraries to
get found earlier, due to external library paths in .la files.

https://bugzilla.gnome.org/show_bug.cgi?id=712314
2013-11-19 08:11:35 -05:00
Stef Walter
d10f35310f threadpool-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-11 17:37:48 +01:00
Stef Walter
3e041ce5ad mainloop-test: Fix uninitialized memory access in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-11 17:35:26 +01:00
Stef Walter
aa7ec15091 Revert "defaultiface: Fix leak in test"
This reverts commit fd7b2faa64.

This required another patch to be commited first. Will put this
back in bugzilla.
2013-11-11 17:06:38 +01:00
Chun-wei Fan
fd41363e02 tests/: Include unistd.h on *NIX only
https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-11 22:37:39 +08:00
Chun-wei Fan
ccba409d34 tests/: Avoid closing invalid fd's
...and only include unistd.h when we are on *NIX.

Newer Visual C++ runtimes (8.0/2005 and later) will cause the program to
crash with an internal abort() call when they detect instances of close()
being called on an invalid fd, such as when the fd is -1, and these should
be purged anyways.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-11 22:36:32 +08:00
Stef Walter
177fe9f98e timeloop: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-11 08:14:45 +01:00
Stef Walter
9e0ade0691 file-test: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-11 08:10:51 +01:00
Stef Walter
fd7b2faa64 defaultiface: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:27:22 +01:00
Stef Walter
bac4179476 timeloop-closure: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:27:15 +01:00
Stef Walter
d8722441d1 signals: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:27:01 +01:00
Stef Walter
1b9662046f paramspec-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:26:53 +01:00
Stef Walter
320f0b32de override: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:26:37 +01:00
Stef Walter
e6de9c6940 gvalue-test: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:26:28 +01:00
Stef Walter
83301d8c1f accumulator: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711779
2013-11-11 07:26:20 +01:00
Stef Walter
6294d73023 module-test: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711768
2013-11-10 22:53:42 +01:00
Stef Walter
0a02fd9c52 iochannel-test: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:45:04 +01:00
Stef Walter
44bd2ab07e unicode-encoding: Fix leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:44:39 +01:00
Stef Walter
e8cc0966d4 thread-test: Fix leaks in tests
This is a test of deprecated functionality and its age is
showing. Doesn't actually do what it says. But fix leaks anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:44:12 +01:00
Stef Walter
ae1764b4e0 mainloop-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:43:25 +01:00
Stef Walter
83a14d13ec datetime: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:42:57 +01:00
Stef Walter
5ae5d438a6 mapping-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:42:29 +01:00
Stef Walter
fc4630b7ac gio-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:41:44 +01:00
Stef Walter
ee743674a1 completion-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:41:29 +01:00
Stef Walter
ba56c7b720 child-test: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:41:16 +01:00
Stef Walter
9a67fb903f asyncqueue-test: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-10 22:40:58 +01:00
Chun-wei Fan
20f873a0bc tests/libmoduletestplugins*.c: Update Prototypes
Visual C++ does not like function declarations being different from
their prototypes, so make the prototypes match the declarations by
decorating them with G_MODULE_EXPORT.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-04 10:31:28 +08:00
Dan Winship
c9ac45a023 .gitignore: add "signals" 2013-09-28 10:39:01 -04:00
Ryan Lortie
9da87f597c fix up refcount/properties test case
Recent changes to the properties testcase made invalid use of the GArray
free function.  This free function takes a pointer to the item to be
freed, not the item itself.  Since that item was a pointer to a GObject,
g_object_unref() was getting a GObject**, rather than a GObject*.

The use of GArray in this testcase is pretty questionable in the first
place, so just use C arrays instead.
2013-09-23 17:07:33 -04:00
Ray Strode
29ef821766 tests: add signal disconnection test
This commit adds a test to ensure that during a signal emission, if
a signal handler gets disconnected, it won't be run, even if it would
have run before the disconnection.
2013-09-20 16:06:02 -04:00
Ray Strode
cb7059e17f tests: free properties test object from main thread instead of helper thread
The test objects are used from the main thread after the helper threads
are destroyed, so we need to keep them alive until we're done using them.
2013-09-20 16:06:02 -04:00
Matthias Clasen
d929eb64ee Try to make the testgdate test hobble along a little longer 2013-06-17 12:40:47 -04:00
Ryan Lortie
601a00fa2a Change a pair of TESTS = to TEST += 2013-06-01 09:55:13 -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
210b1f8b42 Remove a bunch of lingering g_thread_init()
After this patch, there is but one remaining use of g_thread_init(),
which is in tests/slice-threadinit.c, a testcase dedicated to testing
the functionality of gslice across a g_thread_init() boundary.

This testcase is pretty meaningless these days... probably we should
delete it.
2013-05-31 23:03:19 -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
Ryan Lortie
d7b3e558cf Move a pair of gobject tests to tests/gobject/
testgobject.c and timeloop-closure.c are the only two tests in the
toplevel tests/ directory that depend on gobject, so move them to
tests/gobject/ along with the other gobject tests.

Both of these were in noinst_PROGRAMS and not TESTS, so keep them that
way when we move them.
2013-05-31 23:03:19 -04:00
Matthias Clasen
db1c83a516 Improve gtype test coverage 2013-05-29 08:37:28 -04:00
Matthias Clasen
4c9a7b65eb More test fixes for builddir != srcdir 2013-05-27 22:05:19 -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
Ryan Lortie
8bb6a4aec5 performance test: add signal test with args
Add a signal that has some typical arguments (a uint and a pointer)
since all of the other signal performance tests are for signals with no
args.

https://bugzilla.gnome.org/show_bug.cgi?id=694380
2013-05-23 21:50:53 -04:00
Ryan Lortie
4b72bbf9b1 performance test: share some code
The handled and unhandled cases share the same data and _run()
functions.  Refactor into a common section.

https://bugzilla.gnome.org/show_bug.cgi?id=694380
2013-05-23 21:50:52 -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
Dan Winship
52f6a7d162 tests: fix a few recently-broken tests 2013-05-21 11:21:36 -03:00
Matthias Clasen
7ff5c08221 Convert more tests to installed tests
This makes the tests in tests installed, except for
the performance tests.
2013-05-20 23:41:49 -04:00
Matthias Clasen
1808888a1f Convert more tests to installed tests 2013-05-20 21:05:56 -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
Ryan Lortie
4c6c093b36 More clean up for Unicode corrigendum #9
Fix some more testcases.
2013-03-18 23:28:27 -04:00