summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-11-01meson: Centralize test timeout valuesSimon McVittie
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10Autotools: Always run glib-genmarshal, even if cross-compilingSimon McVittie
glib-genmarshal is now written in Python rather than C, so we can always run it directly, even if we're cross-compiling for an architecture whose binaries we can't run. This matches the behaviour of the Meson build system. Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1546 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908334 Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10Tests: Mark printf wrappers with G_GNUC_PRINTFSimon McVittie
If we tell clang that we're passing the arguments on to a compatible printf call, it can see that we're doing it right, and won't warn us about -Wformat-nonliteral. This follows up from commit abac67c0. Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10Meson: Do not run tests/refcount with --tapXavier Claessens
This is a partial revert of a change introduced in cbc7fbbf7.
2018-10-10meson: Run build-time tests with --tap where supportedSimon McVittie
This makes it easier to debug test failures, by ensuring that g_debug() and g_test_message() are printed as TAP diagnostics. Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1528 Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10Meson: Install timeloop-closure testXavier Claessens
2018-10-10Meson: Run in TAP mode installed tests that support itXavier Claessens
2018-10-10Tests: Fix -Wformat-nonliteral causing build failure with clangXavier Claessens
2018-10-10tests W32: ifdef a variable not used on WindowsРуслан Ижбулатов
2018-10-10tests W32: Move timeloop test to the non-Windows sectionРуслан Ижбулатов
It just doesn't work on Windows, and that can't be fixed with a quick patch.
2018-10-10tests W32: ugly fix for sscanf() formatРуслан Ижбулатов
As we recently established, G_G*_FORMAT macros are for glib functions *only*. It's not guaranteed that they will work for C runtime printf() or scanf() variants, and indeed - in this case they do not (GCC thinks that MSVCRT sscanf() requires %I64 prefix for 64-bit values; whether that is true or not is irrelevant at this point - we need to make the werror go away).
2018-10-10tests W32: include process.h for getpid()Руслан Ижбулатов
At least, MinGW has POSIX names. No idea if this works in MSVC.
2018-10-10tests W32: Fix Windows values castingРуслан Ижбулатов
LPARAM is LONG_PTR which is the same as INT_PTR on Windows. WPARAM is UINT_PTR. HWND is a pointer. (%p prints pointers without 0x prefix, hence the extra 0x).
2018-10-10tests W32: Cast the MSG struct as (gchar *) for g_io_channel_readРуслан Ижбулатов
2018-10-10Rename cxx-test.C to cxx-test.cppXavier Claessens
Meson checks file extension case-insentively, and compiles ".C" as C source instead of C++.
2018-10-10Meson: build and install remaining testsXavier Claessens
2018-10-10tests: Mark two more tests as slowPhilip Withnall
These keep on taking just longer than 30s on my local machine when run in parallel with the rest of the tests (i.e. with `ninja test`). Testing them individually, they do terminate correctly. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-30build: Stop distributing generated files in autotools tarballsPhilip Withnall
It is a bug if we distribute files which are generated at build time — they should be built on the machine which is compiling GLib, not be shipped in the tarball. This brings the autotools-generated tarball in line with the ninja-generated one, with the exception of man pages and gtk-doc HTML output. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-18unicode: Update test data files for unicode 11.0.0Rico Tzschichholz
Fixes https://gitlab.gnome.org/GNOME/glib/issues/1407
2018-07-16Meson: Use environment() for test_envXavier Claessens
2018-07-06tests: Mark refcount/properties2 test as slowPhilip Withnall
It often takes a bit more than 30s to run on my local machine. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29tests: Various minor leak fixes in the GObject testsPhilip Withnall
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-14Deprecate g_type_class_add_private()Emmanuele Bassi
It's been 4 years and 8 development cycles since we introduced G_ADD_PRIVATE and offset-based private data access. It is now time to finally deprecate the old mechanism. Closes: #699
2018-06-12tests: Port gen-casefold-txt.pl and gen-casemap-txt.pl to Python 3. See #1332Christoph Reiter
I've tried to keep the code structure roughly the same.
2018-06-10Classify the testsEmmanuele Bassi
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-04Remove developer script not needed in git repositoryXavier Claessens
2018-06-04Remove old tests not being built since 2012Xavier Claessens
Those tests are failing and are not built since commit d6a075b
2018-06-04Remove tests/gio-ls.c that never has been builtXavier Claessens
2018-05-30test_paths: Reindent to avoid tripping -Wmisleading-indentationIain Lane
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-26tests: Increase the timeout of the 'objects2' and 'sequence' tests. Fixes #1393Christoph Reiter
These two still fail occasionally due to timeouts, so increase it a bit.
2018-05-04gobject: Reimplement g_param_values_cmp() for GParamSpecVariantPhilip Withnall
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-04-30fileutils: Add g_canonicalize_filenameGeorges Basile Stavracas Neto
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-27all: Remove trailing newlines from g_message()/g_warning()/g_error()sPhilip Withnall
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-03-28Initialize variables before using themEmmanuele Bassi
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-02-21Remove HAVE_CONFIG_H defs and usesErnestas Kulik
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
2017-12-04gobject: fix typecasts via g_object_refChristian Hergert
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-11-27tests: Work around a gdb bug in assert-msg-testPhilip Withnall
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-23meson: Use files() for gio sources and headersNirbheek Chauhan
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-17build: Drop --enable-rebuilds configure optionPhilip Withnall
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-17tests: Re-wire the testgobject test program to the build systemEmanuele Aina
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-17tests: Don't assume that private data follows the instance dataEmanuele Aina
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-10-11Replace 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-08-03Consistently save errno immediately after the operation setting itPhilip Withnall
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-07-17tests: Do not use gnome.genmarshal()Emmanuele Bassi
We are providing glib-genmarshal; using the gnome module in Meson does not call the just built glib-genmarshal tool.
2017-07-17meson: Simplify the use of built toolsEmmanuele Bassi
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-13meson: add tests/gobject and tests/refcountTim-Philipp Müller
2017-07-10build: Drop nmake/MSC build system for GLibPhilip Withnall
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-05unicode: Update test data files for unicode 10.0.0Rico Tzschichholz
https://bugzilla.gnome.org/show_bug.cgi?id=784456
2017-05-29tests/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet
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-23build: Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENTPhilip Withnall
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