summaryrefslogtreecommitdiff
path: root/testsuite/gtk
Commit message (Collapse)AuthorAgeFilesLines
* Stop using GTestDBusMatthias Clasen2023-03-022-34/+2
| | | | | | | | 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.
* tests: make accel tests easier to debugThomas Jost2023-01-031-4/+3
|
* build: Remove the Autotools buildEmmanuele Bassi2022-12-081-308/+0
| | | | | | | | 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.
* build: Add missing argument to add_languages()Emmanuele Bassi2022-12-061-1/+1
| | | | We need to specify whether we want a native compiler or not.
* testsuite: Don't create .test files for flaky or failing testsSimon McVittie2022-11-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* testsuite: Avoid using should_failSimon McVittie2022-11-231-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Differentiate keypad keysyms in acceleratorsMatthias Clasen2022-10-271-2/+4
| | | | | | | When displaying accelerators, differentiate keypad symbols with a 'KP' prefix. Fixing a 17 year old bug. Backport of c58d9446f40b36136f25baf.
* Avoid repeated g_log_set_writer_func in testsSimon McVittie2022-08-202-35/+25
| | | | | | | | | | | 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
* scrolledwindow: Always add other scrollbar size...Timm Bäder2021-04-191-2/+2
| | | | | | | ... 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.
* testsuite: Handle icontheme test betterMatthias Clasen2020-03-132-8/+16
| | | | Skip just the failing tests in release builds.
* testsuite/gtk: Add xfail testsEmmanuele Bassi2020-03-131-1/+19
| | | | | | | | Some tests are expected to fail. Some tests are expected to fail in non-debugging builds. The icontheme test is the latter.
* meson: port installed tests and reftestsChristoph Reiter2019-11-153-2/+39
| | | | | | | 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"
* Add a test for reinserting action groupsMatthias Clasen2019-06-231-0/+21
| | | | | This is reproducing a crash that was seen in gnome-builder.
* Fix build with older GLibMatthias Clasen2019-06-201-0/+21
| | | | Turns out g_strv_equal is recent.
* action muxer: Fix gtk_widget_get_action_groupMatthias Clasen2019-06-191-1/+121
| | | | | | | | | | | | | | 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
* testsuite/gtk/builder.c: Export the needed symbolsChun-wei Fan2019-04-111-19/+19
| | | | | Those symbols need to be properly exported for Visual Studio builds for things to work properly. Fixes the test on Visual Studio builds.
* autotools: dist all meson related build filesChristoph Reiter2019-04-111-0/+1
|
* tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under mesonChristoph Reiter2019-04-116-5/+11
| | | | | | | | | 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.
* testsuite/gtk/stylecontext.c: Declare variables at top-of-blockChun-wei Fan2019-04-111-1/+2
| | | | This will ensure the code builds on pre-C99 compilers.
* meson: Disable --export-dynamic for clangPhilippe Normand2019-04-111-1/+1
| | | | It doesn't seem to be supported, at least when compiling on macOS.
* meson: Sync build files with master and update to 3.24Nirbheek Chauhan2019-04-111-149/+108
|
* Import meson build files from an 3.22Nirbheek Chauhan2019-04-111-0/+150
| | | | Specifically, from 6dd6660c685d22e88af5ed4d0b5f1f22df0338de
* Skip GdkPixbuf in default-value testsMatthias Clasen2018-12-121-0/+4
|
* test: Fix compile-time warningsBastien Nocera2018-07-211-2/+2
| | | | | | | | | | testsuite/gtk/notify.c: In function ‘test_type’: testsuite/gtk/notify.c:434:14: warning: assignment to ‘GObject *’ {aka ‘struct _GObject *’} from incompatible pointer type ‘GtkSettings *’ {aka ‘struct _GtkSettings *’} [-Wincompatible-pointer-types] instance = g_object_ref (gtk_settings_get_default ()); ^ testsuite/gtk/notify.c:443:16: warning: assignment to ‘GObject *’ {aka ‘struct _GObject *’} from incompatible pointer type ‘GdkWindow *’ {aka ‘struct _GdkWindow *’} [-Wincompatible-pointer-types] instance = g_object_ref (gdk_window_new (NULL, &attributes, 0)); ^
* defaultvalue: Ignore more style properties that Adwaita overridesgtk-3-24-defaultvalues-ignore-moreIain Lane2018-07-191-0/+28
| | | | These broke once we switched away from Raleigh
* themes: Remove RaleighDaniel Boles2018-06-291-1/+7
| | | | | | | | | | | | | | | | | It has been extremely broken since the move to CSS gadgets/nodes, so clearly no one is depending on it; nor does anyone seem to want to resurrect it, and writing a Raleigh-inspired theme from scratch would be faster if they did. So let's drop the dead weight from the build and lib Now that we don't have Raleigh, the defaultvalue test has to be changed to set Adwaita before checking the default values of style properties - some of which Adwaita overrides in its CSS, meaning those would fail. Not that it passed before anyway! But it does now after my other commit. Note that I leave the last reference in gtk-zip.sh.in alone since that hasn't been touched in 8 years and probably has plenty other problems... Close https://gitlab.gnome.org/GNOME/gtk/issues/1187
* defaultvalue: Fix some very broken indentationDaniel Boles2018-06-291-3/+6
| | | | and while here, use the more typical : to separate the type and property
* defaultvalue: Ignore property to actually passDaniel Boles2018-06-291-0/+10
| | | | | GtkFontChooserWidget:tweak-action gets set in init(), so we have to skip testing that it is the default NULL for a GObject, or the test fails.
* defaultvalue: Stop warnings via new g_object_ref()Daniel Boles2018-06-291-2/+2
| | | | | Now that it can propagate the type, we must explicitly cast to GObject* to assign it, otherwise gcc shouts.
* defaultvalue test: Remove obsolete propertiesDaniel Boles2018-06-291-11/+1
|
* Add a test for ::row-changed vs node refsMatthias Clasen2018-01-191-0/+71
| | | | | | | | Test that filter models propagate ::row-changed if there is an external reference on the node, and not otherwise. This is showing up in buggy icon view behaviour, where the icon view is not redrawing if the content changes in a model that is below a filter model.
* tree model sort: Fix set_sort_columnMatthias Clasen2018-01-161-0/+89
| | | | | | | | | | We were failing to change the sort order for the default sort column in some cases. Fix that, and add a testcase for this issue. https://bugzilla.gnome.org/show_bug.cgi?id=792459 Add a testcase for the previous fix
* GtkBuilder: Prefer "type-func" over "class" when looking for the GTypeDebarshi Ray2017-08-291-1/+11
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=786932
* testsuite/scrolledwindow: Try non-overlay/non-autoDaniel Boles2017-06-021-32/+187
| | | | | | | | | It was only testing the default configuration, where overlay scrolling is on and both scrollbars use POLICY_AUTOMATIC. We should also test the other 3 configurations that are available by including non-overlay scrollbars and/or those that use POLICY_ALWAYS. https://bugzilla.gnome.org/show_bug.cgi?id=778853
* build: Enable subdir-objectsEmmanuele Bassi2017-05-091-17/+35
| | | | | | | Like we did in the master branch. Using subdir-objects removes the forward compatibility warnings coming from autotools.
* Revert "testsuite/scrolledwindow—Test non-overlay/non-auto"Daniel Boles2017-02-221-194/+40
| | | | | | | | This reverts commit fbd876fe933e05b59e610ecd2e4b8a17b756e984. Reverting until I can be sure gtkscrolledwindow.c does the right thing. https://bugzilla.gnome.org/show_bug.cgi?id=778853
* testsuite/scrolledwindow—Test non-overlay/non-autoDaniel Boles2017-02-191-40/+194
| | | | | | | | | | It was only testing the default configuration where overlay-scrolling is TRUE and the policy is POLICY_AUTOMATIC. We should also test FALSE and POLICY_ALWAYS. This commit adds those tests and makes the !overlay && POLICY_ALWAYS case pass by excluding the size of the relevant scrollbar, as we are only interested in whether the content size is as requested. https://bugzilla.gnome.org/show_bug.cgi?id=778853
* testsuite/gtk/textiter: Add missing assertionDaniel Boles2017-02-181-1/+2
| | | | | | gboolean ret for whether gtk_text_iter_backward_line() moved the iter was declared but not used anywhere. I presume it was meant to be checked, and it passes now, so let’s do it.
* textiter: fix bug in gtk_text_iter_backward_line()Nelson Benítez León2017-02-181-0/+37
| | | | | | | | | | | | | | | | gtk_text_iter_backward_line() checks the value of real->line_char_offset without previously calling ensure_char_offsets (real) to make sure the former is up-to-date. As a consequence of this, when gtk_text_iter_backward_line() is called after a gtk_text_buffer_insert_range() in the first line of buffer, the iter is not moved to the start of the line, and the return value is wrong. Fixed by adding the ensure_char_offsets() call. A test case for this bug is added to the textiter gtk testsuite.
* Fix the scrolledwindow testMatthias Clasen2016-08-311-0/+2
| | | | | These tests were written for the propagate-nat-size semantics, so opt in to it.
* gtkicontheme: Don’t emit warning about fallback theme when in unit testsPhilip Withnall2016-08-061-9/+22
| | | | | | | | | | | In order to eliminate g_test_expect_message() (which doesn’t work with G_LOG_USE_STRUCTURED), make the warning about the fallback theme not existing be conditional on the icon theme search path containing a system path. Any application code which modifies the search path does so through appends and prepends, so this should not affect whether the warning is emitted in production. https://bugzilla.gnome.org/show_bug.cgi?id=769485
* tests: Avoid g_test_expect_messageMatthias Clasen2016-08-061-2/+11
| | | | Instead of using g_test_expect_message, just ignore the warning.
* Skip GtkShortcutLabel::accelerator in notify testMatthias Clasen2016-08-021-0/+4
| | | | | This property is not freely settable, since the string gets parsed.
* Make icontheme test work with structured loggingMatthias Clasen2016-08-021-9/+26
| | | | | Since we've opted in to G_LOG_USE_STRUCTURED, this test now needs to do its thing using a log writer function.
* Skip GdkDrawingContext in default value testsMatthias Clasen2016-08-021-0/+1
| | | | GdkDrawingContext objects can't be freely constructed.
* Skip GdkDrawingContext in some testsMatthias Clasen2016-06-202-0/+2
| | | | | GdkDrawingContext is not freely constructible, so we need to skip it in the notify and finalize tests.
* style cascade: Allow cascades with more ancestorsPhilip Chimento2016-06-191-0/+230
| | | | | | | | | | | | | | | Previously a style cascade's parent could not have a parent itself. That represented the two levels at which you could add a style provider: at the screen level, with gtk_style_context_add_provider_for_screen(), and at the style context level, with gtk_style_context_add_provider(). This commit changes no functionality, but this change will be necessary for adding style providers in the future that apply to a subtree of the widget tree. It relaxes the requirement that a style cascade's parent must not have a parent, since in the future a style context may be affected by any number of parent widgets' style contexts. https://bugzilla.gnome.org/show_bug.cgi?id=751409
* scrolledwindow test: Check natural width for max content sizeTristan Van Berkom2016-06-091-4/+4
| | | | | | The maximum content size does not increase the minimum request but only ensures that both minimum and natural requests do not exceed the maximum setting.
* Fix buildEmmanuele Bassi2016-06-081-2/+2
| | | | | | | | | | | Commit 023f406c9617284ee3b88727df489f20cd066fd6 has a typo that results in this error: ../../../testsuite/gtk/notify.c: In function 'test_type': ../../../testsuite/gtk/notify.c:679:54: error: expected expression before ')' token (g_str_equal (pspec->name, "max-content-width") ||) ^
* test: Skip GtkScrolledWindow::max-content- propertiesMatthias Clasen2016-06-081-0/+6
| | | | | | | The allowed values for the max-content- properties depend on the value of the min-content- properties, in a way that our simple test is not prepared to deal with. Just skip them for now.