Commit Graph

2407 Commits

Author SHA1 Message Date
Matthias Clasen
8c92c619de Test the deprecation support
Test gtk4-builder-tool validate --deprecations
2023-05-12 19:52:42 -04:00
Matthias Clasen
78d2002965 Add tests for gtk4-builder-tool enumerate 2023-05-12 19:52:42 -04:00
Matthias Clasen
25c4acb6d2 Add tests for hsv<>rgb conversion 2023-05-12 19:52:42 -04:00
Matthias Clasen
0a3dac10c6 Improve test coverage for the css parser 2023-05-12 19:52:42 -04:00
Matthias Clasen
c9afcd31c2 css: Improve transition test coverage 2023-05-12 19:52:42 -04:00
Matthias Clasen
09bab2b2df Improve css parser test coverage 2023-05-12 08:38:39 -04:00
Matthias Clasen
a3ebc0329d Improve test coverage for list models 2023-05-11 23:24:23 -04:00
Matthias Clasen
ba64e5588d Add a little wait to focus tests
I don't know exactly why, but this seems
to help the tests not fail on X11.
2023-05-11 22:24:10 -04:00
Matthias Clasen
fb2e67638d testsuite: Simplify shader test
Simplify the shader to something GLES
will successfully compile.
2023-05-11 09:20:25 -04:00
Matthias Clasen
13ca3187f2 testsuite: fix another surface unref warning 2023-05-11 06:40:57 -04:00
Matthias Clasen
dc3003bc4d gsk: Improve test coverage
Add more tests for gsk transforms, render node
and renderer apis.
2023-05-10 20:21:31 -04:00
Matthias Clasen
abbb3a2da6 testsuite: Close displays in the gsk tests
This gives us better coverage of the dispose
codepath for a driver that has actually been
used.
2023-05-10 20:21:12 -04:00
Matthias Clasen
9a9257d7be tests: Don't disable vertex arrays
It doesn't work, and that makes tests fail.
2023-05-09 23:02:48 -04:00
Matthias Clasen
5c10f2b4cd Improve coverage for half-float fallbacks 2023-05-09 23:02:30 -04:00
Matthias Clasen
676cd1e673 tests: Stop copying the tool tests
No point in doing that, and the meson feature
we are using here is deprecated.
2023-05-09 21:21:39 -04:00
Matthias Clasen
ef5f34c985 Update tests 2023-05-09 16:36:07 -04:00
Matthias Clasen
91ca6d0851 Merge branch 'wip/ebassi/gen-version-macros' into 'main'
Generate version and deprecation macros at build time

See merge request GNOME/gtk!5945
2023-05-09 18:23:40 +00:00
Emmanuele Bassi
cdeeb3275a build: Internal tests must set GTK_COMPILATION
Otherwise they won't be able to use the appropriate function visibility
on Windows.
2023-05-09 19:01:21 +01:00
Matthias Clasen
526ddfa866 Merge branch 'wip/otte/sections' into 'main'
Add GtkSectionModel

See merge request GNOME/gtk!5818
2023-05-09 16:36:55 +00:00
Emmanuele Bassi
265bc90524 build: Use Meson's gnu_symbol_visibility
Instead of injecting `-fvisibility=hidden` depending on a compiler check
ourselves, let Meson do it for us.

This also avoids us having to filter `-fvisibility=hidden` when reusing
the common compiler flags.
2023-05-09 16:43:25 +01:00
Benjamin Otte
46adfbef4f listitemmanager: Create header items for sections
Now, finally, listitemmanager has all the necessary support to make
section headers work.
2023-05-09 17:00:40 +02:00
Benjamin Otte
38844fef4d listitemmanager: Add GtkListHeaderBase and vfuncs
This is plumbing for section handling.

The vfuncs don't do anything, this is just the infrastructure.
2023-05-09 17:00:40 +02:00
Benjamin Otte
0ff88346cd listitemmanager: Make sections configurable
Add a gtk_list_item_manager_set_has_sections() (default: FALSE) that
requires explicit turning on for the listitemmanager to gain section
support.
2023-05-09 17:00:40 +02:00
Benjamin Otte
5d2605a151 testsuite: assert widgets are in matched sections
All widgets that we display should have their sections known, so assert
that that is the case.
2023-05-09 17:00:40 +02:00
Benjamin Otte
40a7ec73a9 testsuite: Add a print function for the listitemmanager
This is very useful when debugging.
2023-05-09 17:00:40 +02:00
Benjamin Otte
6df8eafc3a testsuite: Add verbose output to listitemmanager test 2023-05-09 17:00:39 +02:00
Benjamin Otte
e680abc723 listitemmanager: Add section tiles
For now, we just have a HEADER at the start and a FOOTER at the end.
That's hard enough to get right.
2023-05-09 17:00:39 +02:00
Benjamin Otte
cecaede610 testsuite: Improve listitemmanager test
It now has trackers!
2023-05-09 17:00:39 +02:00
Benjamin Otte
7856c52882 testsuite: Add tests for sections to filterlistmodel 2023-05-09 17:00:39 +02:00
Matthias Clasen
568023e6e6 Add a test for filterlistmodel sections 2023-05-09 17:00:39 +02:00
Benjamin Otte
41faddea40 testsuite: Add section tests to sortlistmodel test 2023-05-09 17:00:39 +02:00
Matthias Clasen
a09146df5a Add a test for sortlistmodel sections 2023-05-09 17:00:39 +02:00
Benjamin Otte
d24291db98 testsuite: Add a listitemmanager test 2023-05-09 17:00:39 +02:00
Matthias Clasen
661022f2eb Merge branch 'reftest-msvc' into 'main'
reftest-snapshot.c: Fix running reftests on Visual Studio

See merge request GNOME/gtk!5937
2023-05-09 14:48:18 +00:00
Matthias Clasen
58a5de6f5d testsuite: Handle duplicate enum values
Our notify tests would fall over if there was
a duplicate enum value (within the first 10 values).

Make it handle that, by skipping the duplicate value.
2023-05-08 07:00:34 -04:00
Chun-wei Fan
a9ca72695f reftest-snapshot.c: Fix running reftests on Visual Studio
On Visual Studio-like builds, shove a ".dll" suffix for the reftest
module so that we look for the correct DLL when running the tests.
2023-05-08 15:10:17 +08:00
Matthias Clasen
8495e0e412 Add a test for quick key events 2023-05-06 09:09:13 -04:00
Matthias Clasen
c9b0ca0de7 ci: Improve headless test logging 2023-05-06 09:02:25 -04:00
Matthias Clasen
8ad1189b0b ci: Bump timeouts for headless tests 2023-05-05 16:21:54 -04:00
Matthias Clasen
e56a539363 Add a masked variation to gsk tests
This improves test coverage for mask nodes.
2023-05-05 15:05:08 -04:00
Matthias Clasen
93ccf08c81 ci: Bump timeouts of headless tests 2023-05-05 12:05:10 -04:00
Matthias Clasen
852f46df19 Remove a no longer building test 2023-05-04 20:53:15 -04:00
Matthias Clasen
5e8e4130a5 Skip another failing gsk test with small textures 2023-05-04 15:36:57 -04:00
Matthias Clasen
f81aa14d93 Merge wayland_smalltexture and wayland_gles
We don't really need to have two full separate
test runs for these conditions, so combine them
into one test setup.
2023-05-04 15:13:09 -04:00
Matthias Clasen
ac0311b621 ci: Mark headless monitor test as working 2023-05-04 11:39:35 -04:00
Matthias Clasen
d288931b45 More debug spew
Lets see what MUTTER_DEBUG=screen-cast says.
2023-05-04 11:38:55 -04:00
Matthias Clasen
03adeecfa3 Add generous waits
These tests work in the smae container locally.
Perhaps this is down to timing?
2023-05-04 11:38:55 -04:00
Matthias Clasen
f98d1a6474 Mark the headless monitor test as failing
This is failing because I can't figure out
how to make wireplumber and pipewire work
in ci enough to let me add a new monitor :(

As usual, the test works fine locally.
2023-05-03 23:53:14 -04:00
Matthias Clasen
57e6aae80a Try to fix dnd tests 2023-05-03 23:27:09 -04:00
Matthias Clasen
f23eaafc85 Typo fix 2023-05-03 23:27:09 -04:00
Matthias Clasen
926b26e9fc headless tests: Add debug spew
Trying to track down what is going on with our
missing monitors.
2023-05-03 23:27:09 -04:00
Matthias Clasen
88f27c423c ci: Launch pipewire and wireplumber
The headless tests require pipewire and wireplumber
for screencast sessions to work. So launch them.
2023-05-03 23:27:09 -04:00
Matthias Clasen
30342896d0 Use python3
No /usr/bin/python in our CI image :(
2023-05-03 23:27:09 -04:00
Matthias Clasen
be8e203edc Make the headless input tests work
These needed some updates and workarounds.

They are now part of the testsuite and can
be run like this:

    meson test -Cbuild --suite headless
2023-05-03 23:27:09 -04:00
Matthias Clasen
b85a137a68 Fix scan-build warning 2023-05-03 15:32:19 -04:00
Matthias Clasen
a235b59089 Skip some tests with small textures
When textures are too large, we will scale them down
to fit the max texture size, which will cause comparisons
to fail.
2023-05-01 16:29:45 -04:00
Matthias Clasen
33ab588d4e Improve test coverage
Check that our two rounded rect intersection functions agree.
2023-05-01 13:58:42 -04:00
Matthias Clasen
7200a93a88 gsk: Give up on one test
The rounded-clip-in-clip-3d test fails in GL when
flipped. Given that it was already excluded from cairo,
and also fails cairo when flipped, give up on it for now.
2023-05-01 13:45:20 -04:00
Matthias Clasen
e453a989df Improve rounded rect intersection
Move the rounded rect/rect intersection code to
gskroundedrect.c, make it more precise, and add
tests for it.

Update the callers in the GL renderer.
2023-05-01 13:45:20 -04:00
Matthias Clasen
f29b24517e Add a test for rotated blend nodes 2023-05-01 13:45:20 -04:00
Matthias Clasen
f6e47b7eb0 Add a test for rotated cross-fade nodes
This one checks that we don't apply the modelview
transform twice with cross-fades.
2023-05-01 13:45:13 -04:00
Matthias Clasen
21df62f428 Add another test 2023-05-01 13:43:33 -04:00
Matthias Clasen
5afd5cfec7 Add another gsk test 2023-05-01 13:43:33 -04:00
Matthias Clasen
406b1e2e03 testsuite: Fix gsk test
The repeated tests were not careful enough to produce
the correct reference image to match what the repeat
node does.

With these changes, all cairo tests pass.
2023-05-01 13:43:33 -04:00
Matthias Clasen
f1729affa8 testsuite: Add more gsk tests
Add separate suites for running the gsk compare-render
tests with the --flip, --rotate or --repeat options.
A bunch of these fail currently, and need diagnosis.
2023-05-01 13:35:35 -04:00
Matthias Clasen
3b2ba8ed99 Add more gsk tests
Add options to the gsk compare-render test for
modifying the node (and do a matching change to
the reference image).

flip: negative scale flipping things horizontally
rotate: 90 degree rotation
repeat: 2x2 grid
2023-05-01 13:35:35 -04:00
Matthias Clasen
386c3ac34f Add another transform test
Test that transforming bounds with negative scales
works as expected.
2023-05-01 13:35:22 -04:00
Matthias Clasen
63b50f48a9 Merge branch 'harmonize-would_drop' into 'main'
Harmonize would_drop() replacement for g_log_writer_default_would_drop()

See merge request GNOME/gtk!4935
2023-04-28 22:55:42 +00:00
Benjamin Otte
778979cf0e testsuite: Use GLTextureBuilder 2023-04-27 06:40:47 +02:00
Benjamin Otte
39583e40ef testsuite: Allow accessors in interfaces
There are a lot of cases where properties are implemented in classes but
the getters for these exist in an interface that class implements.

A common Example is g_list_model_get_n_items() being the getter for
GtkWhateverListModel::n-items.
But also property implementations that don't use override_property()
(usually because they have a different default) are handled by this.
2023-04-20 17:47:54 +02:00
Benjamin Otte
be5f225022 testsuite: Be less verbose in accessor-apis test
Only print the tried names when --verbose is passed to the test.
2023-04-20 17:47:54 +02:00
Matthias Clasen
b6fac448d7 Merge branch 'matthiasc/for-main' into 'main'
Try harder to fix focus tests

See merge request GNOME/gtk!5842
2023-04-16 20:00:46 +00:00
Matthias Clasen
765f55dfbe testsuite: Skip focus tests when necessary
If our window does not get focus, we can't reliably
test things that depend on widgets being focused.
2023-04-16 20:58:26 +02:00
Matthias Clasen
db6a116d49 Try harder to fix focus tests
The focus test now asserts that its window is active.
So we should not run them in parallel with other tests,
since those might steal the focus.
2023-04-16 20:08:03 +02:00
Benjamin Otte
27fd0b907d testsuite: Fix broken test to not unref surfaces twice
The test doesn't hold 2 references, it holds only one.

The reason one unref can cause a leak is that some backends - like X11 -
only destroy the surface once the DestroyNotify event from the X server
has come in.
2023-04-16 19:28:21 +02:00
Matthias Clasen
585fb497c1 testsuite: Actually wait for focus
We were failing to properly iterate the main
context here. Oops.
2023-04-16 09:11:24 +02:00
Matthias Clasen
c57e5811f1 tests: Check is-focus instead of has-focus
We are not presenting windows here.
2023-04-16 08:50:35 +02:00
Benjamin Otte
b64f7050ba testsuite: Make GLES testsuite run use GLES 2
We want to support GLES 2, so make sure we test that support.

Also force-disable common extensions we don't explicitly check for and
don't want to accidentally use.
2023-04-15 17:55:20 +02:00
Benjamin Otte
41454b63b4 testsuite: Add some more exhaustive testing to listlistmodel 2023-04-15 05:27:47 +02:00
Matthias Clasen
87e16f3ad9 testsuite: Check widget properties better
Check that setting a property after resetting
it works. An instance of this was fixed in the
previous commit.
2023-04-10 00:24:57 -04:00
Matthias Clasen
4e17900b9a testsuite: Check more property notification
Handle more value types.
2023-03-30 21:39:55 -04:00
Matthias Clasen
577195a243 Make widget property setters behave
We want to allow setting a property to its
current value, while still having a precondition
for widget->parent being NULL otherwise.
2023-03-30 17:32:38 -04:00
Matthias Clasen
2650c4e974 testsuite: Check more property notification
We can easily check some object types
such as widgets.
2023-03-30 14:13:19 -04:00
Matthias Clasen
87f9e8a4c1 testsuite: Clean up some exclusions
Drop some exclusions from the notify test.
The tests work fine for these objects.
2023-03-30 14:13:19 -04:00
Matthias Clasen
dbefc330bd Add some more keysyms tests
Spot-check a few keypad symbols.
2023-03-29 07:35:24 -04:00
Matthias Clasen
31ebe42d2e testsuite: Update a test
cacecd2fb5 changed a warning message that
some tests check for. Oops.
2023-03-29 07:34:27 -04:00
Benjamin Otte
1449e487d3 Merge branch 'wip/otte/node-naming' into 'main'
node format: Allow naming textures and nodes

See merge request GNOME/gtk!5740
2023-03-29 11:28:15 +00:00
Benjamin Otte
9dd050ff30 testsuite: Add parsing tests for node and texture naming 2023-03-29 03:53:52 +02:00
Benjamin Otte
1605b07ff5 rendernodeparser: Failing to parse a string is an error
Testcase included.
2023-03-29 03:53:52 +02:00
Benjamin Otte
cc9de42e70 testsuite: Fix broken test
The test was referencing a nonexisting image.

Plus, node parsing cannot reference relative URLs.
2023-03-29 03:53:52 +02:00
Kévin Commaille
cd860beb38 Add a test for splicing treelistmodel 2023-03-29 03:32:51 +02:00
Matthias Clasen
644b8a4214 testsuite: Add some GL texture tests
Tests creation and upload/download of GL
textures in various contexts.
2023-03-24 13:57:16 -04:00
Matthias Clasen
a8b92935d9 testsuite: Cosmetics 2023-03-24 13:57:16 -04:00
Matthias Clasen
24720307bb gsk: Tweak one test to pass
Clip away the problematic corners in this
artificial texture scaling test. The GL renderer
has problems getting them perfect.
2023-03-22 00:15:04 -04:00
Matthias Clasen
61b9be1c1a gsk: Add a test for scaled textures
GL and cairo disagree on this one, and have forever.
Whee!
2023-03-22 00:14:16 -04:00
Matthias Clasen
d04690d05c a11y: Add a test for gtk_accessible_role_to_name
This should prevent !5693 from happening again
in the future.
2023-03-21 20:06:37 -04:00
Benjamin Otte
fb2a17a972 testsuite: Add a treelistmodel test
This one exhaustively tests reusing the same model as a child model for
many nodes.
This tracks that multiple items-changed signals emitted at the same time
(or multiple handlers for one such signal) doesn't put the treelistmodel
in an inconsistent state while it is handling all of them.

I'm not sure this (ab)use of treelistmodel should be officially
supported, but it works today, so let's test it to see if we can keep it
working.
2023-03-21 14:10:17 +01:00
Matthias Clasen
e7bb7785fa testsuite: Improve setup name consistency
Rename the 'waylandgles' test setup to 'wayland_gles'.
2023-03-19 10:19:00 -04:00
Matthias Clasen
ace2122d45 testsuite: Add a test setup for slicing
Add a 'wayland_smalltexture' test setup that forces
the max texture size to be 1024, which lets us test
the texture slicing codepaths.
2023-03-19 10:15:22 -04:00
Matthias Clasen
80730a4014 testsuite: Add some texture tests
In constrast to our other tests, these use
textures that are big enough to force slicing
with setting GSK_MAX_TEXTURE_SIZE, which we
will use in the following commits to improve
test coverage.
2023-03-19 10:05:52 -04:00