Commit Graph

2453 Commits

Author SHA1 Message Date
Matthias Clasen
8d2047c824 testsuite: Use proper alignment when uploading to GL 2023-05-30 22:36:41 -04:00
Matthias Clasen
a79da8b655 Improve test coverage for GdkGLTexture 2023-05-30 22:36:10 -04:00
Matthias Clasen
876b439d4a Merge branch 'matthiasc/conversion-tests' into 'main'
Texture format work

See merge request GNOME/gtk!6035
2023-05-31 00:13:51 +00:00
Matthias Clasen
2bf2635635 testsuite: Exclude some formats on GLES
GLES < 3.2 has some problems with 16-bit formats,
so exclude these from our download tests.
2023-05-30 19:46:13 -04:00
Matthias Clasen
67ed09f5ae testsuite: Add tests for native GL textures
Create GL textures in gray and GA formats
and check that we can download from them
successfully.
2023-05-30 19:46:13 -04:00
Sophie Herold
d141ac5adf gdk: Add gray/alpha memory formats to testsuite 2023-05-30 14:41:01 -04:00
Sophie Herold
50115d70c6 gdk: Add grayscale and alpha memory formats 2023-05-30 14:41:01 -04:00
Benjamin Otte
3dc3d03a08 testsuite: Add conversion tests
Ensure we can convert from any format to any other format.
2023-05-30 00:42:10 +02:00
Benjamin Otte
788bd575d6 testsuite: Disable certain texture download tests
The GL renderers like to premultiply content that isn't, and due to the
data loss with alpha == 0 (transparent white, transparent black and
transparent anything are all represented by (0, 0, 0, 0) when
premultiplied) these values cannot be converted back.
2023-05-30 00:42:10 +02:00
Benjamin Otte
94a2dc4c47 testsuite: Update memorytexture test for TextureDownloader
There is no longer a need to use gdk_texture_download() and force
conversion to ARGB8 format. We can download the pixels in the original
format again.

That way we avoid testing the conversion code and avoid having to deal
with differences in representable colors.

However, some formats do do conversions, so we allow pixel comparisons
to be accurate (requires 16bit comparison accuracy) or inaccurate (we
only care about 8bit).
Note that for the default RGBA formats, this is identical and means they
need to be bit-exact the same, no matter what.
But the higher bit depth formats may be more different - floating point
can even have different values with high accuracy (the float mantissa is
23 bit, we only care about 16).
2023-05-30 00:42:10 +02:00
Benjamin Otte
169a7f83e6 testsuite: Imitate gdk_memory_convert() correctly
The formula use to compute pixel values from GdkRGBA floats was slightly
adapted some time ago, copy that adaptation
2023-05-30 00:39:46 +02:00
Luca Bacci
703494c7fa testsuite: rename 'wait' function to 'timed_loop'
When compiling for macOS, CLang errors out because a non-static
wait function is declared in sys/wait.h.
2023-05-29 16:43:28 +02:00
Matthias Clasen
f10c234361 css: Add a test for non-ASCII font family
This came up in #5852, so make sure that it works.
2023-05-28 07:57:40 -04:00
Matthias Clasen
5c1c22156c sortlistmodel: Optimize signals
When we emit items-changed due to a section
sorter change, don't also emit sections-changed.
Instead make the items-changed signal cover the
whole range.

Tests included.
2023-05-27 20:37:28 -04:00
Matthias Clasen
9c1049e710 multiselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
a1352a88ff singleselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
8825917140 noselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
ba8d4902b5 filterlistmodel: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
8f3d3ca587 slicelistmodel: Pass through sections
Implement GtkSectionModel in the obvious way.

Tests included.
2023-05-27 17:27:19 -04:00
Matthias Clasen
aeba1e08e8 sortlistmodel: Emit sections-changed
When a new section sorter is set, potentially
all sections have changed. So emit sections-changed
for all items.

Tests included.
2023-05-27 17:27:19 -04:00
Matthias Clasen
fc524ed346 Cosmetics
Fix copy-paste errors in line 1.
2023-05-27 13:51:39 -04:00
Matthias Clasen
56cfef3544 testsuite: Use gtk_list_item_manager_gc_tiles
Use this  new api instead of open-coding it.

Also, assert that it merges consecutive
multi-item tiles.
2023-05-20 19:50:11 -04:00
Matthias Clasen
1d4f383ba5 Drop the FILLER tile type
It is not used anymore.
2023-05-20 12:28:19 -04:00
Matthias Clasen
43a22bb350 Cosmetics
Use the proper g_assert variant.
2023-05-20 07:39:21 -04:00
Matthias Clasen
70ba00ae53 testsuite: Make this test compile
clang did not like this creative use of
strings at all. Rightfully so.
2023-05-18 08:40:50 -04:00
Matthias Clasen
188677724c Improve test coverage for property lookup models 2023-05-16 20:13:57 -04:00
Matthias Clasen
9d3046f187 Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main

See merge request GNOME/gtk!5975
2023-05-16 20:42:27 +00:00
Benjamin Otte
2b0e3a5b1a nodeparser: Move an error check
By putting the check earlier, it will be emitted for the right token.
2023-05-16 18:53:53 +02:00
Benjamin Otte
f5955feea1 testsuite: Add crossfade-clip-both-children test
This one tests a crossfade between two non-overlapping nodes with a clip
region that covers neither of the two nodes.

This tests that renderers can deal with clip regions that doesn't
overlap nodes in a situation where they will most likely want to create
an offscreen.
As offscreens are typically clipped to the clip region, this would cause
an empty offscreen and that can cause failures.
2023-05-16 18:53:27 +02:00
Benjamin Otte
853e8719c6 testsuite: Add clip-translate-offscreen test
This was an experiment where an offscreen was translated inside an
existing clip.

Because renderers try to limit offscreens to the clip rect, this is
interesting, because they might get the translation wrong.
2023-05-16 18:53:27 +02:00
Benjamin Otte
ee6ef41e71 css: Remove crashy resource:// optimization
Using gdk_texture_new_from_resource() is not valid here because we are
not sure if the given resource is valid.

Plus, the previous optimization is no longer relevant, because we are
not using gdk_pixbuf_new_from_resource() anymore - which was what this
optimization was about before it was ported to GdkTexture.

Test attached.
2023-05-16 18:53:27 +02:00
Benjamin Otte
fde3d2cd50 testsuite: Add testcase for z clipping
the near and far clipping plane are at -10000 and 10000 respectively.
Test that the renderers respect that.
2023-05-16 18:53:27 +02:00
Matthias Clasen
3e27232028 Improve test coverage for sorters 2023-05-16 12:33:12 -04:00
Matthias Clasen
c2676ad785 Improve test coverage for GtkPropertyLookupListModel 2023-05-16 12:33:12 -04:00
Matthias Clasen
05a0aca5ab Improve test coverage for GtkStringSorter 2023-05-15 23:21:06 -04:00
Matthias Clasen
013401b594 Fix texture tests with GLES
No sync for you if you're using GLES.
2023-05-15 19:11:35 -04:00
Matthias Clasen
0152286fa0 Improve test coverage for GdkGLContext 2023-05-15 16:49:12 -04:00
Matthias Clasen
41b606b16d Add tests for GdkTextureDownloader 2023-05-15 15:24:56 -04:00
Matthias Clasen
f83c00c928 Test gltexture update functionality 2023-05-15 12:50:28 -04:00
Matthias Clasen
f497cb2b6e Improve gdk test coverage 2023-05-15 11:56:31 -04:00
Matthias Clasen
e50209a535 Add more texture load tests
Add some tests for handling of failures.

The test data here is taking from gdk-pixbufs
tests/test-images/fail directory, excluding anything
but png, tiff and jpg images.
2023-05-14 07:50:11 -04:00
Matthias Clasen
d6430995ad Improve gdk test coverage
Test the loadable icon implementation of GdkTexture.
2023-05-14 07:50:11 -04:00
Matthias Clasen
cea15fc63e Improve gdk test coverage
Add tests for GdkToplevvelLayout and
GdkPopupLayout.
2023-05-13 21:56:29 -04:00
Matthias Clasen
f2a297f56d Stop using gtk_css_provider_load_from_data 2023-05-13 19:59:17 -04:00
Matthias Clasen
9a2d6d6d88 Improve css parser test coverage 2023-05-13 07:36:28 -04:00
Matthias Clasen
57dd88ee53 testsuite: Cosmetics 2023-05-12 19:52:42 -04:00
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