Commit Graph

704 Commits

Author SHA1 Message Date
Matthias Clasen
f1602ef833 Disable a few failing reftests 2023-05-21 22:22:08 -04:00
Matthias Clasen
24ea83e55e Stop using GTestDBus
It is causing tests to timeout when libraries we are using
leak bus connections, and it turns out our tests run fine
without a session bus.

Backport of 1b265a7971171.
2023-03-02 19:18:34 -05:00
Thomas Jost
7a41da3a6e
tests: make accel tests easier to debug 2023-01-03 16:58:18 +01:00
Emmanuele Bassi
2b0a605c5d build: Remove the Autotools build
CI and downstream packagers have been using the Meson build for a while
now, and we checked that it's idempotent to the Autotools build.

Having two build systems in tree doesn't make maintaining and releasing
GTK any easier, even if it's the stable/frozen branch.
2022-12-08 11:57:39 +00:00
Emmanuele Bassi
b310ee1eac build: Drop Meson version checks
We depend on a new enough version of Meson.
2022-12-06 21:50:30 +00:00
Emmanuele Bassi
2b095b501f build: Add missing argument to add_languages()
We need to specify whether we want a native compiler or not.
2022-12-06 20:47:55 +00:00
Simon McVittie
cdb598793a testsuite: Don't create .test files for flaky or failing tests
These tests can be run manually, but are not suitable for use as an
acceptance test, so let's not make frameworks like Debian's autopkgtest
run these when they run ginsttest-runner in the most obvious way.

a11ytests.test doesn't seem to be reliable enough to be used as a QA
acceptance criterion, and has been disabled as a build-time test in both
Gitlab-CI and Debian since 2019. a11ystate.test is not set up to be run
at build time at all, and has been marked as flaky on ci.debian.net
since 2018.

The rest of the testsuite/a11y directory seems to have been
reliable in practice, at least on ci.debian.net, so try leaving them
enabled as installed-tests.

In principle this could be made finer-grained by having a separate .test
file and a separate Meson test() for each .ui file, but that would
require more active maintenance of GTK 3.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-24 12:09:21 +00:00
Simon McVittie
a1cd0f71d9 testsuite: Try enabling a11y tests, other than those known to be unstable
At least some of the tests implemented via the accessibility-dump
executable are known to be unstable, but the tests based on separate
executables (tree-performance.c, etc.) have been reasonably consistently
passing on ci.debian.net for several years, so hopefully they are also
reliable enough for upstream CI and we don't need to mark them as flaky?

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-24 12:09:21 +00:00
Simon McVittie
820d72ffb8 testsuite: Avoid using should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.

In GTK 3.24.35, if the environment is such that the label-sizing.ui
reftest happens to be successful, the overall result of the test suite
is failure. This seems unlikely to have been the intention.

Instead of using should_fail, put the tests in one of two new suites:
"flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
with a command like:

    meson test --setup=unstable_tests --suite=flaky --suite=failing

This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 18:54:02 +00:00
Matthias Clasen
6cc0552ab8 Differentiate keypad keysyms in accelerators
When displaying accelerators, differentiate keypad
symbols with a 'KP' prefix. Fixing a 17 year old bug.

Backport of c58d9446f40b36136f25baf.
2022-10-27 14:57:01 -04:00
Simon McVittie
a4f45483b1 Avoid repeated g_log_set_writer_func in tests
Since GLib 2.73.0 it can only be called once per process.

Based on commit 78c153ae in GTK 4, but combining the icontheme test's
two custom log writers into one log writer that serves both purposes,
to avoid the need for a subprocess.

Co-authored-by: Matthias Clasen <mclasen@redhat.com>
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5119
2022-08-20 19:34:05 +01:00
David King
7f295eeb32 meson: Do not install reftests
Match the testsuite in the main branch.
2021-12-23 10:57:58 +00:00
Matthias Clasen
01cb9b5ae6 Update meson build for recent changes
Adapt the meson build to the changes in
commit 93e1f7f1ec.
2021-12-21 14:22:45 -05:00
Matthias Clasen
93e1f7f1ec Remove a bunch of failing reftests
Still not enough to make distcheck pass.
Giving up on it :(
2021-12-20 23:01:34 -05:00
Matthias Clasen
62768629f2 Fix distcheck 2021-12-20 17:18:55 -05:00
Matthias Clasen
b541ad48d1 reftests: Enforce default settings
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
2021-07-19 13:10:31 -04:00
Timm Bäder
25879ea37e scrolledwindow: Always add other scrollbar size...
... if we're not using indicators and the policy may be visible. Not
doing this if the policy may be invisible is incorrect as we need to
reserve the space anyway in case the scrolledwindow is allocated at
minimum size and the child size increases to show the scrollbar.
2021-04-19 14:43:01 -04:00
Matthias Clasen
a1757170da Fix a11y test results
The color palette change is reflected in the a11y dump
for the color chooser.
2020-11-07 22:40:41 -05:00
Matthias Clasen
aed01a338e Fix the flipping-icons test
Remove icons that no longer have an rtl variant
in Adwaita.

Fixes: #2561
2020-05-21 22:29:28 -04:00
Simon McVittie
c37bbb2641 Add miscellaneous unpackaged files to dist tarball
Various files are in git but not in dist tarballs. Some of them look
like potentially useful references for downstream distributors.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-08 13:43:28 +01:00
Matthias Clasen
41330b6c03 testsuite: Handle icontheme test better
Skip just the failing tests in release builds.
2020-03-13 16:31:33 +00:00
Emmanuele Bassi
aac214f1b0 testsuite/gtk: Add xfail tests
Some tests are expected to fail.

Some tests are expected to fail in non-debugging builds.

The icontheme test is the latter.
2020-03-13 16:30:06 +00:00
Emmanuele Bassi
a4e4b136c9 Update the list of tests that may fail
The update of the Docker image we use on our CI introduced changes in
the underlying platform, and that caused some reftests to fail.
2019-12-17 17:39:43 +00:00
Timm Bäder
25174154b9 reftests: Fix css-multi-state test
Properly unset theme CSS and use the right selector for the toggle
buttons.
2019-11-29 20:35:06 +09:00
Matthias Clasen
f737908d2f Fix a11y test output 2019-11-27 13:16:22 -05:00
Alexandr Miloslavskiy
1efb72210d Fix crash in parse_border()
The bug was introduced in commit:
	9b7640b8 by Benjamin Otte, 2012-03-26 17:24:02
	styleproperty: Make _gtk_style_property_parse_value() return a CssValue

In that commit, `values` changed from `GValue*` to `GtkCssValue**`,
but one `!G_IS_VALUE (&values[8])` was left untouched. As a result,
if `border` shorthand contains anything after color, it might crash,
depending on memory layout.

New test included.

Fixes: #751
2019-11-23 18:06:31 +01:00
Chun-wei Fan
36edb5fbf6 reftests: Fix building on Visual Studio
We need to mark the prototypes in the headers so that they get exported
properly from the reftest DLLs that we build, so that the reftest DLLs
and program will link properly.  Include gtk-reftest.h in
reftest-snapshot.c so that the compiler picks up the export directives
as needed.
2019-11-22 11:43:35 +08:00
Niklas Hambüchen
d5457d1b14 build: Don't hardcode shared_library() in meson.
Instead, use the standard library().
This is a meson best practice.

Fixes #2248.

Fixes -Ddefault_library=static not having any effect.

Cherry-Picked-From: bb9c07d8fe8b90c42ba81fb5bb6f8a9826252660
2019-11-18 03:31:20 +01:00
Christoph Reiter
3c2b5cda74 meson: port installed tests and reftests
I couldn't get all reftests to work reliably, so the tests failing
on either CI or on my machine are skipped for now.

Installed tests are disabled by default and can be enabled with "-Dinstalled_tests=true"
2019-11-15 12:52:03 +01:00
Matthias Clasen
90dfff5901 Fix gtk-builder-tool tests 2019-09-03 22:34:36 -04:00
Matthias Clasen
17064928d2 Fix gtk-query-settings test 2019-09-03 22:34:36 -04:00
Matthias Clasen
e082414f0c Update a11y test results 2019-09-03 22:34:36 -04:00
Matthias Clasen
f8251a4da9 Add a test for reinserting action groups
This is reproducing a crash that was seen
in gnome-builder.
2019-06-23 20:49:57 -04:00
Matthias Clasen
cc282c00d2 Fix build with older GLib
Turns out g_strv_equal is recent.
2019-06-20 08:22:56 -04:00
Matthias Clasen
08f216e11f action muxer: Fix gtk_widget_get_action_group
The documentation for gtk_widget_get_action_group
and gtk_widget_list_prefixes states that both of
these operate on all the action groups that are
'available' to the widget.

Which means: they are meant to walk up the parent
muxer chain. So do that.

Add tests to verify the expected behavior.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1396
2019-06-19 21:38:27 +00:00
Matthias Clasen
cb7c994e82 Update test output 2019-06-18 10:59:03 +00:00
Christoph Reiter
bd80b34ca8 meson: a11y tests: don't build testfocus.c, autotools doesn't dist it
And the resulting binary isn't used anyway
2019-06-17 22:16:44 +02:00
Christoph Reiter
f0038fad63 meson: a11y tests: don't test "menus.ui", autotools doesn't dist it 2019-06-17 22:15:25 +02:00
Christoph Reiter
94555371f5 meson: print disabled backends in the final build summary
It's easy to miss what's not getting build otherwise
2019-06-17 17:50:42 +00:00
Daniel Boles
3e3e89a3c1 testsuite/a11y/about: Fix exp. output per e56a9e6c
Commit e56a9e6ce5 fixing Issue
https://gitlab.gnome.org/GNOME/gtk/issues/686 changed what happens here,
for whatever reason, and there's apparently no notion of 'correctness'
to worry about, so just update the expected output to match and pass CI.

Close https://gitlab.gnome.org/GNOME/gtk/issues/1949#note_531709
2019-06-14 17:48:34 +01:00
Matthias Clasen
2957b86f72 Add a reftest for multiple font families
This tests that listing multiple font
families in the css font-family property
works as expected.
2019-05-03 16:38:22 -04:00
Chun-wei Fan
983e82b750 state-record.c: Include header for write()/close()
Avoid an "implicit declaration of ..." warning/error for using
close()/write().
2019-04-18 15:06:54 +08:00
Christoph Reiter
77c1424582 meson: add tools tests 2019-04-13 13:11:23 +02:00
Christoph Reiter
014320bfb0 meson: add a11y test 2019-04-13 12:49:27 +02:00
Chun-wei Fan
e96c6c40f8 testsuite/gtk/builder.c: Export the needed symbols
Those symbols need to be properly exported for Visual Studio builds for
things to work properly.  Fixes the test on Visual Studio builds.
2019-04-11 16:46:22 +02:00
Christoph Reiter
d52dad2042 autotools: dist all meson related build files 2019-04-11 16:45:36 +02:00
Christoph Reiter
fb083b6de2 tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson
Under autotools the compiled schemas are in the build directory and with
meson they are in the root build dir. Avoid changing the autotools build for
now and add a special GTK_TEST_MESON env var which we can use to differentiate
the two.

See 1253e7bfcbc80f88 for a similar fix on master.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
7d0364a127 testsuite/gtk/stylecontext.c: Declare variables at top-of-block
This will ensure the code builds on pre-C99 compilers.
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
ead77a4628 meson: Cleanup tests and gdk testsuite 2019-04-11 16:45:36 +02:00
Philippe Normand
4eb2f297f1 meson: Disable --export-dynamic for clang
It doesn't seem to be supported, at least when compiling on macOS.
2019-04-11 16:45:36 +02:00