Commit Graph

853 Commits

Author SHA1 Message Date
Matthias Clasen
50850cdf98 Use g_timeout_add_seconds for some long timeouts
https://bugzilla.gnome.org/show_bug.cgi?id=692618
2013-02-03 10:21:20 -05:00
Matthias Clasen
ab328469f5 Silence automake
automake doesn't like INCLUDES anymore.
2013-02-02 22:54:15 -05:00
Dan Winship
82f2ee90fe .gitignore updates 2013-01-26 10:09:33 -05:00
Matthias Clasen
a605b332c5 Dist assert-msg-test.gdb
And refer to it in srcdir. Otherwise, the test fails mysteriously
in make distcheck.
2013-01-14 23:48:33 -05:00
Ryan Lortie
5d42fdd068 visibility: Use a separate CFLAGS variable
We only want to control the default visibility for our five main
installable libraries: libglib, libgthread, libgmodule, libgobject,
libgio.  We should therefore only set -fvisibility=hidden when building
those.

Use a separate substitution variable for this purpose.

Using CFLAGS directly leads to some modules built in testcases not
exporting their symbols (and then the tests fail).  It also affects the
fam file monitoring module.

Colin had originally done it this way in his visibility patch series but
I failed to understand why so I didn't copy it.  Now I do.

Also: revert changes made to two testcases in an attempt to work around
this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=691756
2013-01-14 23:31:59 -05:00
Matthias Clasen
7e00f38191 Fix module-test in a better way
Avoid having visibility attribute directly in the code by
adding a _GLIB_EXTERN-decorated declaration for the exported
variables.
2013-01-14 22:47:02 -05:00
Matthias Clasen
b96499690b Fix up visibility fallout in module-test 2013-01-14 21:31:47 -05:00
Matthias Clasen
d1c25d3191 Fix the assert-msg test
gdb is playing games with us, by breaking -x /dev/stdin
2013-01-14 17:35:47 -05:00
Ryan Lortie
c2055f22f4 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2013-01-04 21:20:04 +01:00
Rico Tzschichholz
efa7b5f1e7 Revert "gtype: disallow adding interfaces after the fact"
This reverts commit d6a075b0d8.
2013-01-04 20:25:46 +01:00
Matthias Clasen
86610b0594 Move testgobject to tests/
And fix it to actually check the right things.
2013-01-01 14:06:20 -05: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
Dan Winship
1d7985aa0a tests: multiple fixes to run-assert-msg-test.sh
1) use "../libtool" rather than "libtool" to avoid problems
with wacky OS X not-actually-libtool

2) Use libtool on the libtool script, not the binary, so that it
actually does anything

3) Don't use "gdb --ex" since it's apparently new-ish/non-portable.

https://bugzilla.gnome.org/show_bug.cgi?id=684723
2012-12-19 08:32:42 -05:00
Ryan Lortie
5df1edaf70 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2012-12-18 21:37:07 +01:00
Rico Tzschichholz
d1ab41c940 Revert "gtype: disallow adding interfaces after the fact"
This reverts commit d6a075b0d8.
2012-12-18 21:23:13 +01:00
Arnel A. Borja
4a506290a7 win32: Use AC_CHECK_TOOL to find dlltool
https://bugzilla.gnome.org/show_bug.cgi?id=684145
2012-12-02 18:12:57 +01:00
Dan Winship
b8c13a01b6 win32: misc warning fixes
https://bugzilla.gnome.org/show_bug.cgi?id=688109
2012-11-15 14:19:06 -05:00
Ryan Lortie
d6a075b0d8 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2012-11-05 13:20:28 -05:00
Simon McVittie
837db1a026 Fix more warning-addition fallout
I'm normally a big fan of small atomic commits, but I also want to get
things done this afternoon...

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
2012-11-02 16:27:19 +00:00
Simon McVittie
733acc2316 Fix more void prototypes in tests
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
2012-11-02 16:14:11 +00:00
Simon McVittie
eb7dc2bcc6 Predeclare more things in tests
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
2012-11-02 16:14:09 +00:00
Colin Walters
055aa2b55e gdateparser: Delete unused debug print function
https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-02 09:03:52 -04:00
Colin Walters
8e59d8602c Use (void) for no parameters, not ()
This ensures we build with -Werror=missing-parameter-type.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:02 -04:00
Colin Walters
84475e4320 build: Prototype GType accessors for private classes
Otherwise we fail to build with -Werror=missing-prototypes.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:02 -04:00
Colin Walters
6d88a2f822 build: Add missing "static" keyword where it should be used
Otherwise we fail to build with -Werror=missing-prototypes.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:01 -04:00
Colin Walters
f6da43f56c build: Ensure we #include header files for glib-genmarshal code
Otherwise we fail with -Werror=missing-prototypes.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:01 -04: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
Dan Winship
b901aaf673 Update .gitignores 2012-08-26 14:40:22 -04:00
Dieter Verfaillie
a3655be211 win32: fix tests/sources.c
"make check" was failing on sys/resource.h not being available on
win32. Seeing that this test just spews some numbers on stdout
whithout really testing anything we can safely replace them with
similar enough numbers by relying on g_get_monotonic_time ().

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=682386
2012-08-21 21:15:45 +02:00
Matthias Clasen
373dcaea56 Improve threadpool test coverage 2012-08-18 14:38:53 -04:00
Mark Nauwelaerts
24b9f61ee4 tests: add check for leaking signal return value
https://bugzilla.gnome.org/show_bug.cgi?id=674800
2012-08-05 12:52:33 +01:00
Mark Nauwelaerts
13a1154b4c tests: make refcount signals test slightly valgrind cleaner 2012-08-05 12:26:03 +01:00
Dan Winship
56de38da7d tests: add a timing test for adding lots of GSources
https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Matthias Clasen
d4f8854785 Cosmetic changes 2012-06-11 10:25:24 -04:00
Ryan Lortie
774074f99b slice-color test: don't use non-existent macro
G_GUINT64_MODIFIER doesn't exist, but G_GINT64_MODIFIER does (and will
be the same as is needed for unsigned).
2012-05-01 15:16:05 -07:00
Dan Winship
c37273dccb fix warnings 2012-04-30 09:28:42 -04:00
Matthias Clasen
c2318a18f9 Dispose test object
While not very important, it means one less untested function
in the coverage report.
2012-04-02 09:09:11 -04:00
Matthias Clasen
c173c0beb4 Drop g_thread_init from tests
This is not needed anymore.
2012-04-02 09:09:11 -04:00
Alexander Larsson
f3fb42cfaf Merge branch 'signal-performance' 2012-03-05 12:29:45 +01:00
Nirbheek Chauhan
840c32281d Run gdb under libtool so that local libraries are used
If this isn't done, the system-wide glib is used for this test,
and that can cause test failures.

https://bugzilla.gnome.org/621368
2012-03-04 20:36:04 -05:00
Alexander Larsson
950e6a4a20 tests: Add generic and empty signal emission performace tests
generic means it uses the generic marshaller
empty means the vfunc pointer is NULL

https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Lionel Landwerlin
3be0e57458 tests: performance: add emit-handled/emit-unhandled tests
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
2012-03-02 17:13:03 +01:00
Matthias Clasen
da4293a4e4 Update case conversion test data for Unicode 6.1 2012-02-26 21:49:20 -05:00
Peter Kjellerstedt
50efbaf063 Do not fail unit test due to gdb abbreviating strings
gdb by default will only print strings up to 200 characters. After that
it abbreviates them. This affects the run-assert-msg-test.sh script if
the path to the glib installation is too long (in our case it was 133
characters, 132 would still have worked...)

By having gdb execute "set print elements 0" before printing the assert
string, the limit on maximum number of characters to print is set to
unlimited.

Signed-off-by: Peter Kjellerstedt <pkj@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=670218
2012-02-17 11:59:30 -05:00
Simon McVittie
29f2ced8eb various GLib tests: plug memory leaks
These don't really matter, since it's test code, but they do obscure
real leaks in the library.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Acked-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:40:16 +00:00
Simon McVittie
a0f5e89aed testglib: test_file_functions: don't close fd if it's -1
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:40:02 +00:00
Nicola Fontana
f24d8247b3 Do not use static GTypeInfo and GInterfaceInfo
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.

https://bugzilla.gnome.org/show_bug.cgi?id=600161
2011-11-29 22:03:25 -05:00
Sjoerd Simons
216fd8a82c Silence compiler warnings
Fix several warnings for format strings (-Werror=format-security) and
set but unused variables (-Wunused-but-set-variable)

https://bugzilla.gnome.org/show_bug.cgi?id=664144
2011-11-17 23:12:27 -05:00
Will Thompson
5e2a2ef288 g_parse_debug_string: invert flags given besides "all"
Any flags specified as well as "all" are subtracted from the result,
allowing the user to specify FOO_DEBUG="all,bar,baz" to mean "give me
debugging information for everything except bar and baz".

https://bugzilla.gnome.org/show_bug.cgi?id=642452
2011-10-24 20:35:30 -04:00
Will Thompson
73ffa9034f Test g_parse_debug_string ("all")
https://bugzilla.gnome.org/show_bug.cgi?id=642452
2011-10-24 20:26:22 -04:00
Matthias Clasen
94a46ea410 Fix 'make check' with clang
Patch by Elias Pipping

https://bugzilla.gnome.org/show_bug.cgi?id=662491
2011-10-24 13:43:11 -04:00
Javier Jardón
4a25d21bd0 tests/gobject: Use G_VALUE_INIT 2011-10-18 17:12:33 +01:00
Ryan Lortie
ef6371ff74 tests/Makefile.am: remove unused LDFLAGS variable 2011-10-15 13:13:13 -04:00
Ryan Lortie
fd382156b8 tests: disable deprecation warnings for tests
We need to test deprecated functions, so don't warn us for doing so.
2011-10-13 10:51:35 -04:00
Ryan Lortie
6f343ca548 Remove g_mutex_new()/g_cond_new() in testcases
These were the last users of the dynamic allocation API.

Keep the uses in glib/tests/mutex.c since this is actually meant to test
the API (which has to continue working, even if it is deprecated).

https://bugzilla.gnome.org/show_bug.cgi?id=660739
2011-10-04 19:35:27 -04:00
Ryan Lortie
9793708931 drop errorcheck mutex test
We don't support errorchecking mutexes in GLib anymore.
2011-10-04 18:52:55 -04:00
Ryan Lortie
2a677d1370 locks: drop _INIT macros
All locks are now zero-initialised, so we can drop the G_*_INIT macros
for them.

Adjust various users around GLib accordingly and change the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=659866
2011-10-02 22:33:10 -04:00
Matthias Clasen
151756631d Don't use g_thread_foreach in tests 2011-10-02 22:31:45 -04:00
Javier Jardón
3659ca99f5 tests: Use G_VALUE_INIT 2011-10-02 17:22:57 +01:00
Colin Walters
f42fe6cdc0 gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar()
The documentation for G_TYPE_CHAR says:

"The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed
 integer."

However the return value for g_value_get_char() was just "char" which
in C has an unspecified signedness; on e.g. x86 it's signed (which
matches the GType), but on e.g. PowerPC or ARM, it's not.

We can't break the old API, so we need to suck it up and add new API.
Port most internal users, but keep some tests of the old API too.

https://bugzilla.gnome.org/show_bug.cgi?id=659870
2011-09-22 20:05:38 -04:00
Ryan Lortie
14e6377a60 Deprecate g_thread_create_full()
Replace it with g_thread_create_with_stack_size() and a real function
implementation of g_thread_create().

Modify a testcase that was calling g_thread_create_full()
inappropriately (it was using the default values anyway).
2011-09-21 16:06:55 -04:00
Ryan Lortie
c33cd00739 Stop using GStaticMutex in two testcases 2011-09-21 16:06:53 -04:00
Dan Winship
5bc7729d16 Make threads mandatory
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:55 -04:00
Dan Winship
350a1cda0a update .gitignore 2011-09-04 17:50:41 -04:00
Matthias Clasen
1b28408b8b Spelling fixes
Spelling fixes in comments and docs, provided by
Kjartan Maraas in bug 657336.
2011-08-29 14:49:32 -04:00
Matthias Clasen
76856241d0 Add a quick utility to test datetime formatting 2011-08-21 21:33:30 -04:00
Matthias Clasen
b76bb6713b Add g_mkdtemp in the spirit of g_mkstemp
At the same time, also add g_mkdtemp_full and g_dir_make_tmp
variants. The patch also unifies the unique-name-generating
code for all variants of mkstemp and mkdtemp and adds tests
for the new functions.

Based on patches by Paolo Bonzini,
http://bugzilla.gnome.org/show_bug.cgi?id=118563
2011-08-14 14:09:58 -04:00
Ryan Lortie
dbd0d63b6b wait longer in threadpool test case
If we are going to fail an assert, wait for a bit longer before doing so
(up to 5 seconds, if needed).

This is a long-standing Debian patch to fix build failures on really
slow machines.
2011-07-20 10:51:16 +02:00
Matthias Clasen
9fa5b8e5c7 asyncqueue: improve test coverage 2011-06-19 01:05:26 -04:00
Ryan Lortie
ce9681b87e Drop a few more G_CONST_RETURN 2011-06-13 09:27:28 -04:00
Matthias Clasen
abf4a0200f Test runtime dir getter 2011-06-06 00:30:30 -04:00
Matthias Clasen
1f022a88d4 Remove deprecated atomic functions from tests 2011-06-06 00:30:02 -04:00
Antoine Jacoutot
2ee470a71f Don't hardcode path to true(1).
true(1) is not always installed under /bin so leave system() find
it in the PATH.

https://bugzilla.gnome.org/show_bug.cgi?id=651219
2011-05-27 12:00:41 -04:00
Matthias Clasen
e5c986cbcf Only remove the lines that are no longer needed 2011-05-03 12:41:11 -04:00
Matthias Clasen
5d1aba2464 Revert "[build] Remove stale LDADD lines from tests/Makefile.am to allow build"
This reverts commit b0874ce28e.
2011-05-03 12:37:45 -04:00
Dan Winship
33c0877adc Add back an erroneously-removed line to tests/Makefile.am 2011-05-02 17:06:37 -04:00
Dan Winship
bdc23c44e8 Fix compiler warnings 2011-05-02 11:50:23 -04:00
Behdad Esfahbod
b0874ce28e [build] Remove stale LDADD lines from tests/Makefile.am to allow build
Automake 1.11 wasn't happy.
2011-05-02 11:43:18 -04:00
Matthias Clasen
ef5d4d55fe Fix make check
g_thread_init() causes a hash table to be allocated (in read_aliases).
Since hash tables are now a bit larger, we need to bump one of the
probe sizes to avoid our probe slice being used for the aliases
hash table.
2011-05-01 17:10:04 -04:00
Matthias Clasen
bd8b245f57 Update Unicode tests to 6.0 2011-01-22 00:02:08 -05:00
Matthias Clasen
316be2748f Adapt testglib.c to GRelation deprecation
Patch by Chun-wei Fan, bug https://bugzilla.gnome.org/show_bug.cgi?id=637858
2010-12-28 00:12:19 -05:00
Matthias Clasen
bf1027f826 Move ifaceproperties test to gobject/tests/ 2010-12-27 23:49:12 -05:00
Matthias Clasen
2a5e0cf9e0 Convert ifaceproperties.c to test framework
Also add a test that checks warnings for failure to implement
interface properties.

See https://bugzilla.gnome.org/show_bug.cgi?id=637738
2010-12-27 23:40:28 -05:00
Tor Lillqvist
46390c9d10 Don't call close() on -1
Of course, a proper implementation of close() will just ignore an
invalid parameter silently, and set errno. But apparently the "debug"
version of the Microsoft C library generates some noise in this
case. So avoid that. Thanks to John Emmas for reporting.
2010-10-07 12:06:48 +03:00
Jens Georg
db7ddcc195 Improve parsing of date-only iso8601 strings 2010-08-26 18:18:52 +03:00
Dan Winship
8f5ec0dad3 Fix misc compiler warnings in (mostly) test programs 2010-08-19 18:24:53 -04:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
Matthias Clasen
5179d92e9c fix the completion test 2010-08-03 10:25:54 -04:00
Matthias Clasen
21d98dbc4b improve completion test coverage 2010-08-03 10:25:54 -04:00
Matthias Clasen
e4b5104003 Move bookmarkfile tests to the test framework 2010-08-03 10:25:54 -04:00
Matthias Clasen
03be0d7237 Move markup parse tests to the test framework 2010-07-30 19:51:21 -04:00
Matthias Clasen
13ac9f94fd Add some more GFile tests 2010-07-30 19:51:19 -04:00
Matthias Clasen
c972d4df64 Move markup escape tests to test framework 2010-07-30 19:51:18 -04:00
Matthias Clasen
d0750c9d6e Don't leak in converter test 2010-07-30 19:51:18 -04:00
Matthias Clasen
9fc3c980cc Add some volume monitor tests
Although not much of this is easily testable.
2010-07-30 19:51:17 -04:00
Matthias Clasen
e5a72ae3c4 Move queue tests to the test framework 2010-07-30 19:51:17 -04:00
Olivier Crête
f6d3e224df notify: Add tests for threadsafe object notifies
https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:21 +02:00
Matthias Clasen
b720732059 Move uri tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
953962d783 Move tree tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
5123bc69e7 Move slist tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
b61fd45ac3 Move list tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
26e29cb360 Move charset conversion tests to the test framework 2010-07-04 20:51:06 -04:00
Matthias Clasen
e26b92b947 Move node tests to the test framework 2010-06-23 09:25:29 -04:00
Matthias Clasen
01abbc4bd3 Move node test to the test framework 2010-06-23 09:25:29 -04:00
Matthias Clasen
5c1b3a0263 Move date tests to the test framework 2010-06-23 09:25:29 -04:00
Matthias Clasen
2f438f18ae Move hash tests to the test framework 2010-06-21 23:08:01 -04:00
Matthias Clasen
5629366c3d Move checksum tests to the test framework 2010-06-21 23:08:01 -04:00
Matthias Clasen
7bea2a7a4f Move utf8 validation tests to the test framework 2010-06-20 21:16:24 -04:00
Matthias Clasen
5b08ef84e4 Move utf8 pointer tests to test framework 2010-06-20 21:04:47 -04:00
Matthias Clasen
0ed575213b Consolide base64 tests in a single file 2010-06-20 16:53:39 -04:00
Matthias Clasen
08d6e535be Move scanner tests to glib/tests 2010-06-20 16:53:38 -04:00
Matthias Clasen
09aa2e79ab Move sequence tests to the test framework 2010-06-20 12:23:13 -04:00
Matthias Clasen
bf8ce25216 Move base64 tests of to test framework 2010-06-20 11:34:31 -04:00
Matthias Clasen
f849dbac05 Move regex tests to the g_test framework 2010-06-20 11:20:54 -04:00
Christian Persch
db68f8203a Add g_value_take_variant
Turns out we do need g_value_take_variant(), so we can correctly
implement VARIANT:* marshalers.

Bug #621947.
2010-06-19 19:07:36 +02:00
Christian Persch
4708b8ecc3 Add fundamental type and pspec for GVariant
Make G_TYPE_VARIANT a fundamental type instead of boxed, and add
g_variant_{set,get,dup}_variant.

Add GParamSpecVariant.

Bug #610863.
2010-06-17 21:00:54 +02:00
Christian Persch
1b8ee5196e Sprinkle some $(AM_V_GEN) around to make the build more silent. 2010-06-15 22:01:02 -04:00
Juan A. Suarez Romero
992e07c8b2 Fix warnings
Do explicit casts to avoid warnings.
2010-06-09 10:32:12 +02:00
Colin Walters
183102104a [mainloop-test] Fix compilation errors 2010-05-26 16:21:15 -04:00
Havoc Pennington
6b53e4826f GSource: add g_source_set_name, g_source_get_name, g_source_set_name_by_id
These allow applications to give meaningful names to their sources.
Source names can then be used for debugging and profiling, for
example with systemtap or gdb.

https://bugzilla.gnome.org/show_bug.cgi?id=606044
2010-05-25 16:59:22 -04:00
Priit Laes
96d105906e Fix run-assert-msg-test to work with libtool-2.2.x. 2010-03-08 00:16:23 -05:00
Ryan Lortie
1e6b184225 add performance tests to gitignore 2010-02-10 13:59:35 -05:00
Ryan Lortie
3e30e8a87e make tests not dynamic link against /lib/libglib
For some reason, even though the tests are linked against libgobject.la
and libgobject.la mentions libglib.la as a dependency, the tests are
running against the system glib instead of the in-tree one.

Adding the libglib.la file as an explicit LDFLAG fixes it.
2010-02-10 11:35:01 -05:00
Tor Lillqvist
241c7f476d Don't use deprecated g_win32 API 2010-02-04 14:53:20 +02:00
Ryan Lortie
6aa73f03eb improve gitignore 2010-01-28 22:43:51 -05:00
Martin Pitt
3658727cfa always use our own internal assertion message symbol
Re-using glibc's __abort_msg symbol causes linking problems, since the symbol
is declared private. Always use our own__glib_abort_msg symbol to store
assertion messages, to avoid compatibility and linking problems.

Also fix the test case to work with out of tree builds (such as "make
distcheck"), and re-enable it.

https://bugzilla.gnome.org/show_bug.cgi?id=594872
2010-01-26 11:22:31 +01:00
Matthias Clasen
975aea7bce Disable yet another failing test that was recently added... 2010-01-25 14:13:48 -05:00
Alberto Garcia
7693b0af44 [tests] Remove C++ style comments
It makes the IBM XL C Compiler (the 'native' non-free compiler
on the AIX 5.3 and 6.1 platform) stop compiling with syntax error.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=581300

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-01-20 18:58:32 +01:00
Alexander Larsson
3c5e1fd903 Remove additional thread support in performance test
We're always enabling threads now so this is not needed.
2010-01-13 10:24:09 +01:00
Martin Pitt
da66897950 Support storing assertion messages into core dump
Crash interception/debugging systems like Apport or ABRT capture core dumps for
later crash analysis. However, if a program exits with an assertion failure,
the core dump is not useful since the assertion message is only printed to
stderr.

glibc recently got a patch which stores the message of assert() into the
__abort_msg global variable.
(http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=48dcd0ba)
That works fine for programs which actually use the standard C assert() macro.

This patch adds the same functionality for glib's assertion tests. If we are
building against a glibc which already has __abort_msg (2.11 and later, or
backported above git commit), use that, otherwise put it into our own field
__glib_assert_msg.

Usage:

  $ cat test.c
  #include <glib.h>

  int main() {
      g_assert(1 < 0);
      return 0;
  }

  $ ./test
  **ERROR:test.c:5:main: assertion failed: (1 < 0)
  Aborted (Core dumped)

  $ gdb --batch --ex 'print (char*) __abort_msg' ./test core
  [...]
  $1 = 0x93bf028 "ERROR:test.c:5:main: assertion failed: (1 < 0)"

https://bugzilla.gnome.org/show_bug.cgi?id=594872
2009-12-23 15:51:11 +00:00
Matthias Clasen
80bda52b57 Fix dynamictype test to build 2009-11-29 21:19:10 -05:00
Alexander Larsson
b35fa1994d Cast iface_init to GInterfaceInitFunc
This is in line with what all other type define macros do.

https://bugzilla.gnome.org/show_bug.cgi?id=508157
2009-11-26 12:32:36 +01:00
Alexander Larsson
36646f46ab Add test for G_IMPLEMENT_INTERFACE_DYNAMIC 2009-11-26 11:54:44 +01:00
Alexander Larsson
f4d9789fcf Add gobject performance tests for threaded code
This measures how much things like lock contention affects the gobject
code.
2009-10-02 21:02:48 +02:00
Alexander Larsson
b1f94af095 Add performance tests for GObject primitives
These are basic performance test for a couple of basic gobject
primitives:

* construction of simple objects. Simple is a bare gobject derived
  class with no properties, signals or interfaces.

* construction of complex objects. Complex is a gobject subclass
  with construct properties, normal properties, signals, and
  implements an interface.

* run-time type check of complex objects

* signal emissions

Lots of care is taken to try to make the results reproducible. Each
test is run for multible "rounds", where we try to make each round be
"not too short" in order to be significant wrt timer accuracy, but
also "not to long" to make the probability of some other random event
happening on the system (interrupts, other process scheduled, etc)
during the round less likely.
The current target round time is 4 msecs, which was picked without
rigour, but seems small wrt e.g. scheduler time.

For each test we then run the calculated round size for 60 seconds,
and then report the performance based on the minimal time of one
round. The model here is that any random stuff that happens during a
round can only slow it down, there is nothing that can make it go
faster, so the minimal time is the best estimate of how fast one round
goes.

The result is not ideal, even on a "idle" system the results vary
from round to round, but the variation seems to be less than 1%.
So, any performance difference reported by this test over 1% is
probably statistically significant.

Additionally the tests can be run with or without threads being
initialized. The script tests/gobject/run-performance.sh makes
it easy to produce a performance report for the current checkout.

https://bugzilla.gnome.org/show_bug.cgi?id=557100
2009-10-02 21:02:23 +02:00
Dan Winship
8212aadac7 g_time_val_from_iso8601: handle timezoneless dates
per ISO 8601:2004 4.2.5.2

Based on a patch from Andy Shevchenko
http://bugzilla.gnome.org/show_bug.cgi?id=589491
2009-09-01 09:40:03 -04:00
Matthias Clasen
5694ab7642 Revert "Move gio tests from gio/tests/ to tests/gio/"
This reverts commit 2262d76b33.

Move GIO tests back to where they belong.
2009-07-05 22:49:24 -04:00
Dan Winship
29e6525b1e Two "make check" fixes for late changes to the thread-context patch
g_simple_async_result_complete() now checks that it's being run from
the correct main loop, so tests/gio/simple-async-result was failing,
because it called it from outside any main loop. (And gio's pltcheck
was failing because I hadn't added g_main_current_source() to it.)
2009-07-01 13:52:49 -04:00
Benjamin Otte
2262d76b33 Move gio tests from gio/tests/ to tests/gio/
This avoids getting tests built every time when working on libgio and
running make in the gio/ directory.
2009-07-01 19:03:19 +02:00
Hans Breuer
75ef018248 Updated msvc build files 2009-05-30 15:29:23 +02:00
Matthias Clasen
f33a484b4a Fix up tests forgotten in Michaels commit
When Michael cleaned up after my fumbled commit of his gmarkup
optimizations, he fumbled himself and forgot to fix up the tests...
2009-05-03 17:10:16 -04:00
Dan Winship
92ac8d165e Misc warning fixes
glib/pcre/pcre_ucp_search_funcs.c, glib/pcre/pcre_valid_utf8.c: add
back missing config.h includes, and this time add them to the copies
in glib/update-pcre/ too so they don't get lost again on the next PCRE
update.

glib/garray.c, glib/gbase64.c: fix signed/unsigned pointer casts

gio/xdgmime/xdgmimeglob.c: remove unused variable

gio/tests/live-g-file.c: fix printf args on x86_64

tests/Makefile.am, tests/regex-test.c: remove redundant -DENABLE_REGEX
2009-05-01 10:37:45 -04:00
Peter Kjellerstedt
efc2cdbfc9 Fix parsing of timezones
Make g_time_val_from_iso8601 handle timezones with minutes correctly;
also accept comma as a fraction separator.  (#578369)
2009-04-08 10:26:11 -04:00
Matthias Clasen
84fdf0d00e Fix distcheck
svn path=/trunk/; revision=7932
2009-03-01 16:46:45 +00:00
Matthias Clasen
82e1d3e753 Bug 523742 – Use noinst for non-installable libraries
* tests/Makefile.am: use noninst_LTLIBRARIES for noninstalled
        libraries.Patch by Björn Lindqvist


svn path=/trunk/; revision=7860
2009-02-12 03:55:38 +00:00
Dan Winship
b9cf1ed275 update
* glib/tests/.gitignore: update

	* tests/.gitignore: update, sort

	* tests/gobject/.gitignore: add

svn path=/trunk/; revision=7772
2009-01-05 14:56:55 +00:00
Matthias Clasen
c6404e8329 Accept short data
svn path=/trunk/; revision=7625
2008-10-24 04:10:50 +00:00
Dan Winship
5c53925ed0 Bug 553447 $(Q#|(B g_assert_no_error()
* glib/gtestutils.h (g_assert_no_error, g_assert_error): Macros to
	assert that a GError is not set, or else is set to a particular
	error.

	* glib/gtestutils.c (g_assertion_message_error): utility for
	those macros

	* glib/tests/keyfile.c:
	* tests/asyncqueue-test.c:
	* tests/bookmarkfile-test.c:
	* tests/convert-test.c:
	* tests/file-test.c: Use g_assert_error/g_assert_no_error

svn path=/trunk/; revision=7555
2008-09-27 01:43:29 +00:00