Commit Graph

1436 Commits

Author SHA1 Message Date
Timm Bäder
0415574acf testsuite: Add another repeat node test case 2019-08-11 09:05:31 +02:00
Timm Bäder
4c70bf6c9c testsuite: Add a repeat node test case 2019-08-11 09:05:31 +02:00
Mohammed Sadiq
a642883e33 Add builder tests for bind-source without bind-property
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2080
2019-08-10 19:03:37 +05:30
Matthias Clasen
6118dfba74 Add missing includes 2019-07-31 08:04:03 -04:00
Matthias Clasen
e3ee1df456 Add an image comparison utility
This comes in handy sometimes, and we
already have the image diff code.
2019-07-30 14:02:43 -04:00
Matthias Clasen
032473fef8 reftest: Exclude flaky tests
These depend on details of text rendering,
and started failing with newer pango.
2019-07-28 16:42:52 -04:00
Matthias Clasen
8752564fea Remove new attributes from tests
Until we can depend on pango 1.44, these will
fail in ci. Partially reverts f1c7803f80
2019-07-28 11:00:29 -04:00
Matthias Clasen
3fccb16ca6 gsk: Move text-related test out of ci
These are too sensitive to rendering differences
between renderers to run reliably in ci, but we
still want to keep them around. In particular,
the big glyph tests are useful to exercise the
GL glyph cache.
2019-07-28 09:35:37 -04:00
Matthias Clasen
f1c7803f80 label: Parse new pango attributes
Support allow-breaks and show attributes.
These will be in pango 1.44
2019-07-27 00:02:08 -04:00
Matthias Clasen
fd7f6ca7ad tests: improve error handling 2019-07-25 13:51:34 -04:00
Christoph Reiter
9856218073 Merge branch 'tests-no-box-packing' into 'master'
testsuite: Remove dangling references to box-packing tests

See merge request GNOME/gtk!997
2019-07-18 19:32:19 +00:00
Simon McVittie
5cfe9ab603 testsuite: Remove dangling references to box-packing tests
These were removed in commit c47abb5f, before 3.96.0.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-07-18 09:26:07 +01:00
Timm Bäder
24a4063645 scrollbar: Use a box layout
Makes a lot more sense than the intermediate box just for its layout.
2019-07-15 07:52:42 +02:00
Timm Bäder
b9b5072668 gl renderer: Fix opacity nodes with overlapping child nodes 2019-07-14 10:08:04 +02:00
Matthias Clasen
bda3c6c084 Merge branch 'wip/baedert/for-master' into 'master'
Improve the valgrind experience

See merge request GNOME/gtk!984
2019-07-09 19:39:13 +00:00
Robert Ancell
dbd2a81501 Change the few examples that use a full GTK_ enum value in .ui files.
Lowercase versions work just as well and are much more readable.
2019-07-08 15:52:28 +12:00
Timm Bäder
042f7d117f compare-render: Don't unref an invalid GFile
We already unref it when the g_file_make_directory_with_parents fails.
2019-07-07 07:24:00 +02:00
Matthias Clasen
b2f15a622d Merge branch 'wip/ebassi/constraint-layout' into 'master'
Add constraint-based layout manager

Closes #1090

See merge request GNOME/gtk!973
2019-07-02 14:01:01 +00:00
Benjamin Otte
129691f3a6 flattenlistmodeL: Compute items-changed position properly
The code previously forgot to include the left child of the model's
node. Which of course only happened if that child wasn't NULL, which is
a common case.

Found and test provided by Matthias Clasen.
2019-07-02 02:53:00 +02:00
Emmanuele Bassi
4dd1de4129 Use explicit values for constraint strength
Instead of playing games with mapping negative symbolic values to
positive ones, let's use the appropriate constants everywhere. This
allows us to use:

        GTK_CONSTRAINT_STRENGTH_WEAK * 2

Or

        GTK_CONSTRAINT_STRENGTH_STRONG + 1

In code using the public API.

We also store the strength values as integers, so we can compare them
properly, and only turn them into doubles when they are inserted into
the solver, just like every other variable.
2019-07-01 12:39:24 +01:00
Matthias Clasen
2f97134a08 Amend a constraint solver test
Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.
2019-07-01 00:10:11 +01:00
Emmanuele Bassi
6b308cd71e Add constraint solver
GtkConstraintSolver is an implementation of the Cassowary constraint
solving algorithm:

  http://constraints.cs.washington.edu/cassowary/

The Cassowary method allows to incrementally solve a tableau of linear
equations, in the form of:

  x = y × coefficient + constant

with different weights, or strengths, applied to each one.

These equations can be used to describe constraints applied to a layout
of UI elements, which allows layout managers using the Cassowary method
to quickly, and efficiently, lay out widgets in complex relations
between themselves and their parent container.
2019-06-30 23:42:44 +01:00
Matthias Clasen
f6a2678486 Add another grid layout test
This one will be used for comparison
with constraint layouts.
2019-06-28 19:21:21 +00:00
Matthias Clasen
e28ec2a3eb Some more grid layout tests
Add testcases for spanning children and homogeneity.
2019-06-28 18:07:23 +00:00
Matthias Clasen
c4fd786866 Add a test for the grid layout manager
Test some obvious conditions. This is mainly
to test the waters for more intesting tests
with other layout managers later.
2019-06-28 13:30:16 +00:00
Matthias Clasen
b903d8ee33 Add another action test
Test that disabled actions aren't activated.
2019-06-23 01:39:34 +00:00
Matthias Clasen
366e8da927 Add another test for action inheritance
This one checks for precedence between
class actions and inserted groups.
2019-06-22 23:30:22 +00:00
Matthias Clasen
135580108a Add a test for action introspection
This checks that gtk_widget_query_action works.
2019-06-22 23:11:49 +00:00
Matthias Clasen
4515604511 Add another test for action inheritance
Check that overlapping prefixes are handled
correctly.
2019-06-22 23:00:42 +00:00
Matthias Clasen
3ef8af3be9 Add a test for GtkText actions
Check that the class actions are there and work.
2019-06-21 03:58:21 +00:00
Matthias Clasen
fe6507f875 Add a test for gtk_widget_insert_action_group
This tests that action group inheritance
behaves as expected.
2019-06-21 03:58:13 +00:00
Daniel Boles
732630e0e2 testsuite/a11y/about: Fix exp. output per 31066a69
cherry-pick of commit e56a9e6ce5

Close #1949
2019-06-14 18:05:06 +01:00
Matthias Clasen
f63cec30a4 Add a focus-chain test for focusable containers 2019-06-11 17:15:02 +00:00
Matthias Clasen
1d93e38456 testsuite: Be robust against broken focus
When we start cycling on a subset, abort
after a while.
2019-06-11 17:14:42 +00:00
Matthias Clasen
cfebff5dcf testsuite: more focus-chain output
Differentiate between wrapping around and
stopping at the end of the focus chain.

Update the existing tests, and add two
new ones where the difference matters.
2019-06-11 14:56:38 +00:00
Matthias Clasen
436d7cc0d1 Add a focus chain test
Add a test that enumerates the focus chain by
emitting move-focus repeatedly, and compares
the result to expected output.

The test expects a ui file and a reference
file as input. The reference file can be created
using the --generate option.
2019-06-11 10:14:23 -04:00
Benjamin Otte
ec5854bb9b Merge branch 'for-master' into 'master'
testsuite: Make creating the output dir not racy

Closes #1942

See merge request GNOME/gtk!924
2019-06-09 21:35:15 +00:00
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02:00
Matthias Clasen
8452b9a13d Expand focus tests 2019-06-09 17:38:54 +00:00
Benjamin Otte
24effe45cc testsuite: Add tests for printing/parsing transforms 2019-06-03 19:12:03 +02:00
Matthias Clasen
2f7047147d gsk: Add some more transform tests
Tests around identity. Seems trivial, but
still managed to find a bug.
2019-06-03 16:20:38 +00:00
Matthias Clasen
0ab4a232b7 Move transform tests to the gsk suite
That is where they belong.
2019-06-03 16:10:09 +00:00
Timm Bäder
05ca772631 GskTransform: Ignore identity transforms
We often end up with e.g. a scale of 1 or a translation by 0/0. Ignore
those transforms since they don't do anything.
2019-06-03 17:03:02 +02:00
Matthias Clasen
3788e1dea7 testsuite: Pass --output for gsk tests
We want to keep the output from ci runs.
So we now write the .out.png and .diff.png
files to build/testsuite/gsk/compare/$RENDERER.
2019-06-03 02:09:04 +00:00
Matthias Clasen
e0bf301d34 gsk tests: Add an --output option
This will be used to save artifacts in ci.
2019-06-03 02:09:04 +00:00
Matthias Clasen
c7387a8e7f gsk: Test huge glyphs
These don't fit in the glyph cache.
2019-06-03 02:08:36 +00:00
Matthias Clasen
1c1d4f32c8 gsk: Test big glyphs
These are big, but still fit in the glyph cache.
Therefore, the test succeeds.
2019-06-03 02:08:36 +00:00
Benjamin Otte
7e9cb07a92 Merge branch 'for-master' into 'master'
For master

See merge request GNOME/gtk!903
2019-06-03 00:22:40 +00:00
Benjamin Otte
5a0c8805fc transform: Coalesce similar transforms
If somebody does a transform like
  scale(5) scale(10) translate(1,1) translate(5,0)
store it instead as
  scale(50) translate(6,1)
This way, less memory is consumed and transforms are easier to read.

In particular, this simplifies the typical transforms we do in GTK,
which are just one translation after another.
2019-06-02 21:18:56 +02:00
Timm Bäder
db548ee2a0 gl renderer: Fix scale computation
We don't need to just look at the scale of the new modelview matrix, but
at the one we get when multiplying the new one with the current one.

Test case attached.
2019-06-02 10:25:39 +02:00
Timm Bäder
f1996783ec gl renderer: Fix rounded rect intersection code
Test case attached.

Fixes #1920
2019-06-02 08:31:44 +02:00
Matthias Clasen
0c7e567c32 Merge branch 'global-coords' into 'master'
Drop global coordinates

See merge request GNOME/gtk!899
2019-06-01 03:53:13 +00:00
Matthias Clasen
e31190cf7c Update css node results 2019-06-01 03:47:19 +00:00
Matthias Clasen
0a33d74c1b tests: Fix issues with menu shells
The menu shell is no longer the direct
parent of menu items.
2019-06-01 03:32:10 +00:00
Matthias Clasen
e64e9cd520 simplify: Add a testcase for templates 2019-05-31 19:42:18 +00:00
Matthias Clasen
21491d27bb simplify: Add a testcase for dialogs 2019-05-31 19:39:17 +00:00
Matthias Clasen
2eb0333017 Add a testcase
This tests the fix in 1e7225aa1c.
2019-05-30 14:12:07 -04:00
Benjamin Otte
53f23f8ae9 rendernodeparser: Handle empty Cairo nodes
Cairo nodes can contain a NULL surface if they have never been drawn to.
Make this the default Cairo node.
2019-05-30 15:32:36 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
9abc7262b0 treeview column: Make final 2019-05-28 23:22:57 -04:00
Matthias Clasen
f0fd4843d5 iconview: Make final 2019-05-28 22:50:08 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
c3d7c947ad Add a test for the property renaming 2019-05-28 20:25:16 +00:00
Matthias Clasen
6e885abf66 testsuite: Fix some a11y output
This was affected by a recent fix to GtkAboutDialog.
2019-05-28 20:25:15 +00:00
Matthias Clasen
ebee21b248 testsuite: Fix popover-related failures 2019-05-28 20:25:15 +00:00
Matthias Clasen
07c8fd9997 Add a testcase for size allocation
This triggers a critical warning in gtk_widget_snapshot.
2019-05-28 20:25:15 +00:00
Matthias Clasen
d2951d3aac Rename surface constructors
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename

gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup

The temp surface type will disappear eventually.
2019-05-28 20:25:14 +00:00
Matthias Clasen
2ef8bd0b95 entry completion: Make final 2019-05-27 20:23:50 -04:00
Matthias Clasen
280bbfe522 Drop cellarea subclassing tests 2019-05-26 22:14:20 -04:00
Benjamin Otte
928c85ccc3 rendernodeparser: Parse Cairo nodes
We also print the script, but we don't parse it yet.
2019-05-26 00:50:13 +02:00
Krzesimir Nowak
49d994ddc2 testsuite: Fix leak 2019-05-21 19:23:00 +02:00
Benjamin Otte
63a8144e1a testsuite: Remove serialize-deserialize test
The serialize-deserialize test is completely handled via the new
nodeparser tests.

So move those tests over and delete the old test binary.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0a32305f01 testsuite: Add render tests for all the empty nodes
Test that rendering empty nodes succees. For a lot of nodes the
resulting rendering isn't clearly defined, in those cases we overdraw
those regions (sometimes the whole image) with black.
2019-05-21 06:43:59 +02:00
Benjamin Otte
eb386134e3 testuite: Improve compare-render binary
- Remove remains of g_test_*() functions
  We're not a glib test, we're a simple binary.
- Handle nonexistence of reference image properly
  Don't assert, but create the output image and the error out.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b37c2216fc testsuite: Add empty node tests
For every node type, add a test that creates it empty and ensure that
it prints the reference output.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b90a66cab5 rendernodeparser: Allow parsing strings
Instead of only allowing for glyph indexes, allow ASCII characters as
replacements. So this glyph sequence
  glyphs: 65 8, 66 8, 67 8
Can be replaced by
  glyphs: "ABC"
provided that the glyph for "A", "B" and "C" are 65, 66 and 67
respectively and their advance is exactly 8.
x offset and y offset must always be 0 and every glyph must start a
cluster.
2019-05-21 06:43:59 +02:00
Benjamin Otte
1a65a6ce76 rendernodeparser: Update to new rules
Update to the docs outlined in #1887.

In particular, the changes do:

1. Require no property, have a working default for everything
2. Be clear about what gets printed and how.

Tests ahve been adapted to still pass.
2019-05-21 06:43:59 +02:00
Benjamin Otte
a1d08b4b52 rendernode: Take a graphene_point_t for the offset
... instead of 2 floats.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0fd0be4f9a testsuite: Redo node-parser
Base the rewrite on testsuite/css/parser/test-css-parser - we now
require the node file to match a reference node and track the errors it
triggers.
We also no longer use gtester.
2019-05-21 06:43:59 +02:00
Benjamin Otte
ed0ecf0ff0 rendernodeparser: Allow single values instead of 4
This allows writing:
  colors: red;
instead of
  colors: red red red red;
to draw a red border.
2019-05-21 06:43:59 +02:00
Benjamin Otte
c8fc40e793 rendernodeparser: Print properties alphabetically
Because now we have a rule.

Also update some tests to the new order.
2019-05-21 06:43:59 +02:00
Benjamin Otte
6e2df85ec8 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #1900

See merge request GNOME/gtk!854
2019-05-18 15:19:29 +00:00
Benjamin Otte
04da31f5f5 build: Convert CSS parser tests to single meson tests 2019-05-18 17:06:08 +02:00
Matthias Clasen
9d16715eb3 Merge branch 'menubutton-no-button' into 'master'
Menubutton: don't derive from GtkButton

See merge request GNOME/gtk!853
2019-05-18 13:13:48 +00:00
Matthias Clasen
83d9e7a1c3 Adapt tests
We no longer have a clicked signal on GtkMenuButton.
2019-05-18 13:06:33 +00:00
Timm Bäder
2979aea3ae testsuite: Add a color matrix test case
Color matrix nodes with an identity matrix and no offset should still
produce the expected image.
2019-05-18 13:47:59 +02:00
Carlos Garnacho
c2d92794e2 gdk/x11: Drop GdkDeviceManagerCore
Keep only the XInput2 device manager, which handles "modern" stuff
like scroll and touch.
2019-05-15 01:05:29 +02:00
Benjamin Otte
6f6b07aaae testsuite: Stop using g_test_bug()
The calls used old bugzilla URLs and nobody cared about that.
So apparently they are very unused.

There's also a potential conflict between gitlab and bugzilla URLs and
what base bug to use there.

The old usages have been converted to comments.
2019-05-12 17:28:18 +02:00
Benjamin Otte
63578d832a testsuite: Don't die on the first error
Continue running the test, just mark it as a failure.
2019-05-12 17:27:01 +02:00
Benjamin Otte
3a373b9b33 rendernodeparser: Parse images differently
Instead of encoding the raw data, encode the full image to a PNG.
And instead of stuffing that encoding into a string, use a full
data: url.
And then remove the width and height properties, because they're now
implicitly included in the data.
And then change the parser to match.
And because the parser now parses regular urls on top of data: urls, we
can now load any random file.
2019-05-12 17:27:01 +02:00
Benjamin Otte
8be95ca348 css: Add data URL parsing to images 2019-05-12 17:27:01 +02:00
Benjamin Otte
5da58ba47d css: Add gtk_css_data_url_parse()
This surprisingly decodes data URLs.
2019-05-12 17:27:01 +02:00
Benjamin Otte
b651a355ab build: Fix
I did somethig wrong there. Whoops
2019-05-08 01:15:17 +02:00
Benjamin Otte
dd299c50bf csstokenizer: Add more testcases 2019-05-08 00:58:52 +02:00
Benjamin Otte
bc7972dfa7 csstokenizer: Handle backslash at end of document
Testcases included.
2019-05-08 00:58:52 +02:00
Timm Bäder
730b52b084 testsuite: Add blur node testcase
Renderers need to handle blur radius 0 as well. Currently broken in GL
and (I guess, unless it's my driver) Vulkan.
2019-05-07 17:21:16 +02:00
Matthias Clasen
a0c6d88858 Mark a failing reftest as xfail
I don't know why we expect different window types
to render identically in the first place.
2019-05-07 03:27:04 +00:00
Matthias Clasen
68560a941a Update a11y tests 2019-05-07 02:21:30 +00:00
Timm Bäder
c8865459fc testsuite: Add blend-difference test case
Comparing blend nodes with mode: difference
2019-05-06 17:34:48 +02:00
Timm Bäder
8559593a18 testsuite: Add a blend node test case
This is currently broken in the GL renderer.
2019-05-06 17:34:48 +02:00
Benjamin Otte
562e492056 csstokenizer: Consume the \ when encountering an error
Otherwise we infinitely end up with the error again.

Testcases added.
2019-05-06 05:56:06 +02:00
Matthias Clasen
d61e77dab4 Add some tests
These test various aspects of ui file conversion.
2019-05-05 17:13:38 +00:00
Matthias Clasen
82eee65334 testsuite: Add tests for ui file rewriting
Add a test script that runs
gtk4-builder-tool simplify --3to4.
No actual tests yet.
2019-05-05 17:13:13 +00:00
Matthias Clasen
4f6cc46278 Fix the simplify test
The script was returning the wrong number of tests.
2019-05-05 15:21:58 +00:00
Benjamin Otte
43a5ff8e01 testsuite: Add serialize test for debug node 2019-05-05 07:18:39 +02:00
Benjamin Otte
da5b99f807 testsuite: Add rounded-rect parsing test 2019-05-05 07:18:39 +02:00
Benjamin Otte
b4f5baf4fa rendernode: Parse and print blend nodes properly 2019-05-05 07:18:39 +02:00
Timm Bäder
8c04129b94 testsuite: Add nodeparser test case
A serialized frame from the widget factory!
2019-05-05 07:18:39 +02:00
Timm Bäder
dde69802cd Add error func to node deserialization 2019-05-05 07:18:39 +02:00
Benjamin Otte
5530331b35 testsuite: Black out parts of reftest 2019-05-05 07:18:39 +02:00
Timm Bäder
a55ebf2350 testsuite: Remove old cairo/vulkan tests
They are still in the old binary format and haven't worked for a while.
2019-05-05 07:18:39 +02:00
Timm Bäder
58666c6210 testsuite: Add another gl renderer test 2019-05-05 07:18:39 +02:00
Benjamin Otte
3a9fa035ee testsuite: Remove gl_tests infrastructure
They're now completely migrated to the new compare infrastructure, that
also tests Vulkan and Cairo.
2019-05-05 07:18:39 +02:00
Timm Bäder
1000d971f9 testsuite: Add cross-fade-in-opacity test
Making sure that an opacity node doesn't end up reviving a node that's
hidden because the cross-fade has progress 0 or 1.
2019-05-05 07:18:39 +02:00
Timm Bäder
349e6af2c8 testsuite: Remove broken GL comparison tests
These only work on special hardware, which not even I have anymore.
We'll need to redo them in a way that works on different systems.
2019-05-05 07:18:39 +02:00
Timm Bäder
44b3b8937a testsuite: Print serialized nodes when parsing fails 2019-05-05 07:18:39 +02:00
Timm Bäder
9598e16753 testsuite: add shadow node parser test 2019-05-05 07:18:39 +02:00
Timm Bäder
61a963d78d testsuite: add another nodeparser crash test 2019-05-05 07:18:39 +02:00
Timm Bäder
e31856fe1b testsuite: Add serialize-deserialize tests
Check that we can successfully deserialize a node, then serialize it
again and deserialize that result once more.
2019-05-05 07:18:39 +02:00
Benjamin Otte
1d6134f87d testsuite: Add a broken test
This also adds some build magic so all tests that contain "-3d" in them
won't be added to the Cairo renderer.

Of course, this new test is such a test.
2019-05-05 07:18:39 +02:00
Benjamin Otte
08e9725797 Move working tests to new directory
These are tests that are working on both GL and Cairo now.

Some tests got black boxes over the areas that aren't easy to compare.
2019-05-05 07:18:39 +02:00
Timm Bäder
4d98e96124 testsuite: Port gl tests to text-based format 2019-05-05 07:18:39 +02:00
Benjamin Otte
50e10cd771 testsuite: Delete some node tests
These are the tests that aren't going to be made to work, so let's just
delete them.
2019-05-05 07:18:39 +02:00
Benjamin Otte
b6838cb9f4 testsuite: Add tests for the new node parsing code
This adds a test tool gsk/node-parser that takes node files and parses
them.

A few of these node files have been added, for crashes I encountered while
developing the new parsing code.
2019-05-05 07:18:39 +02:00
Matthias Clasen
6f25168db3 Make the newly added test a bit more robust
Follow the style of the other tests and provide
style for both the test and ref.
2019-05-03 02:15:07 +00:00
Matthias Clasen
7037ff8f3d 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 01:44:29 +00:00
Matthias Clasen
30942c4e3d Fix builder parser tests
The line numbers changed here because we
removed some properties.
2019-04-28 23:44:07 +00:00
Matthias Clasen
bf7d1e7b5a tests: Fix a default-related test
The test was setting has-default, but testing
receives-default.
2019-04-28 23:40:57 +00:00
Matthias Clasen
92e21c3f1c Drop the can-default property
It was added at a time when default buttons
had a very large external border that would disrupt
aligment. Not a problem nowadays.
2019-04-28 23:28:39 +00:00
Benjamin Otte
7420f9c34a testsuite: Rewrite text diff to use GSubprocess
... instead of g_spawn(). Avoids having to create a temp file, too.
2019-04-27 06:20:30 +02:00
Benjamin Otte
2a7e4ae7f6 testsuite: Don't pretend we're a GTest
This is a meson test, not a GTest thing. So:

- Use g_print(), not g_test_message
That makes meson test --verbose print the actual log messsages.

- Don't g_assert() all the time
Instead, run tests through to the end and just return a non-0 exit
status.
2019-04-23 17:09:14 +02:00
Matthias Clasen
51b2759eb1 surface: Drop group api
This was only ever implemented on X11, and
GTK is not using it at all. Relegate it to
x11-specific api.
2019-04-20 02:28:46 +00:00
Benjamin Otte
70fb29e81a reftests: Add a reftest for rendering failure
c18d2872f2 introduced a misrendering in
the Cairo fallback rendering code while fixing another one.

This test exposes that problem.

Related: !756
2019-04-19 03:39:57 +02:00
Benjamin Otte
5cd8e0f7f1 testsuite: Add theme-validate test
The test just loads all of GTK's themes and makes sure they cause no
errors or warnings from the CSS parser.
2019-04-18 02:28:42 +02:00
Benjamin Otte
84351ba9e5 reftests: Be more graceful about errors
The nice thing about that is that we can then log messages about the
errors to the log.

And then we can read the logs of the CI machinery and actually know
what's going on.
2019-04-13 01:48:28 +02:00
Benjamin Otte
e0730bc118 testsuite: Fix label-shadows test
Use a GtkFixed to position and rotate the labels. This is necessary
because the GtkLabel::angle property was removed.
2019-04-13 01:31:49 +02:00
Benjamin Otte
07e0411b98 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-13 00:11:24 +02:00
Benjamin Otte
254feda16b Revert "reftests: Fix textview-margins test"
This reverts commit c6471ee874.

Doesn't work on CI.
2019-04-12 22:38:11 +02:00
Benjamin Otte
c6471ee874 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-12 22:15:00 +02:00
Emmanuele Bassi
f58f0732c2 ci: Cache the reftest artifacts
Keeping the reftest output images as artifacts of a job allows us to
browse them and download them straight from GitLab.
2019-04-12 20:58:29 +01:00
Emmanuele Bassi
c5a4a26f06 Merge branch 'ci-update' into 'master'
ci: Install Monospace fonts

See merge request GNOME/gtk!742
2019-04-12 19:30:31 +00:00
Emmanuele Bassi
3046358d38 ci: Update list of xfail tests
The label tests do not fail any more, because the CI image has Monospace
fonts; the textview-margins test started to fail on the CI image,
though.
2019-04-12 20:21:29 +01:00
James Westman
c20360dd98 reftests: Use shared_library, not shared_module
This allows Meson to run on macOS, where shared modules cannot be linked
against.
2019-04-12 14:04:01 -05:00
Benjamin Otte
198207f1ff reftests: Mark the currently unfixed failures as XFAIL
They should be fixeed before 4.0 but the fixes are more involved. And we
want to start running the existing tests on CI, because they break
regularly and we want to catch that.
2019-04-12 19:34:29 +02:00
Benjamin Otte
6120f11ed3 reftests: Fix GtkFixed layout properties
GtkFixed was still using "x" and "y", when it should have been using
"position".
2019-04-12 19:34:29 +02:00
Benjamin Otte
0a440a804f reftests: Fix CSS for various tests
* :nth-child(first) => :first-child
* :nth-child(last) => :last-child
* Add semicolons at end of declarations
* Remove spaces between color functions (shade, alpha, ...) and args
2019-04-12 19:34:29 +02:00
Benjamin Otte
023b695422 testsuite: Fix stylecontext test
Update the test to the stricter interpretation of the CSS specification
and the removal of custom additions.
2019-04-12 19:34:29 +02:00
Benjamin Otte
ec6ce0707a testsuite: Update references for style test
We have more accurate section printouts now and they are used here.
2019-04-12 19:34:29 +02:00
Benjamin Otte
f37573f8dc testsuite: Check errors not just for line, but for full range
Instead of just checking that the line of the error message is correct,
assert that start and end position are on the correct character offset.

Also fix all the tests to conform to this.
2019-04-12 19:34:29 +02:00
Benjamin Otte
49f8b571b9 testsuite: Update integer test
Make the test use an actual integer property that accepts negative
numbers (opacity) instead of one that wants units (margin-top) or
can't deal with negative numbers (everything else).
2019-04-12 19:34:29 +02:00
Benjamin Otte
a8f712b09a cssection: Return locations, not numbers
Now that we have GtkCssLocation, actually use it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
acaec5f186 testsuite: Update parser tests to new errors
Some errors are now properly detected as unknown values when previously
they were just treated as syntax errors.
2019-04-12 19:34:28 +02:00
Benjamin Otte
c8589a9a2f testsuite: Handle warnings in CSS tests 2019-04-12 19:34:28 +02:00
Benjamin Otte
a31e5f7a8c cssshadow: Use gtk_css_parser_consume_any()
This way, the arguments can now really be speicified in any order.

A new testcase testing all the ordering possibilities has been added.
2019-04-12 19:34:28 +02:00
Benjamin Otte
93b643c44d css: Make font-weight an integer
This conforms to what Pango does and to the CSS4 spec. And it makes the
parsing code easier. So let's go for it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
3988847a05 reftests: Add a cross-fade syntax-checking reftest
Making sure all this newfangled code does what it says.
2019-04-12 19:34:28 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Matthias Clasen
7699b43ffe testsuite: Remove packing property tests
These test files were for checking that
GtkBuilder parses <packing> properly.
We no longer support <packing>, so these
can go.
2019-04-05 12:01:43 +00:00
Emmanuele Bassi
c9d8ff21d2 testsuite/css: Change the active RadioButton
The `buttons` test for CSS nodes sets the second RadioButton as the
active one, whereas the first RadioButton is not set as active.
Nevertheless, the reference output says that the first radio button
should match the `:checked` selector, whereas the second radio button
should not.

The fact that the test currently passes is a mystery.
2019-04-05 01:42:37 +01:00
Emmanuele Bassi
824743a395 testsuite/css: Update UI files
Run the UI files through `gtk-builder-tool simplify --3to4` to update
the layout properties.
2019-04-05 01:01:40 +01:00
Emmanuele Bassi
5d778175ee testsuite/reftests: Update UI files
Run the UI files through `gtk-builder-tool simplify --3to4` to update
the layout properties.
2019-04-05 00:33:12 +01:00
Emmanuele Bassi
358ad227d5 testsuite/a11y: Update GtkGrid definitions in UI files 2019-04-05 00:24:49 +01:00
Emmanuele Bassi
b79220ca19 tests: Update the GtkGrid suite
We don't use child properties any more.
2019-04-04 22:43:07 +01:00
Emmanuele Bassi
447dfc029f Remove GtkLayout
The need of a specialised fixed layout container that can be placed into
a GtkScrolledWindow ceased to exist once GtkScrolledWindow gained the
ability to automatically interpose a GtkViewport when adding a child
that does not implement GtkScrollable.

All the other justifications that led to the existence of GtkLayout as a
separate widget from GtkFixed have been largely made irrelevant in the
20 years since its inception.
2019-04-02 15:29:20 +01:00
Chun-wei Fan
68af572ba4 test/reftests: Fix build on Visual Studio
As we are building the gtkreftestprivate and reftest test libraries as
DLLs, we need to export the symbols in there so that things will link.

Decorate the symbols with G_MODULE_EXPORT for this purpose.
2019-04-01 12:14:45 +08:00
Timm Bäder
fb4ffa468c build: Don't use 'continue'
It does not exist in meson 0.48 apparently.
2019-03-31 06:37:10 +02:00
Emmanuele Bassi
ba3a502079 build: Do not use install argument for configure_file()
The `install` argument for configure_file() was introduced in Meson
0.50, and was ignored in earlier versions.

Since we're still using Meson 0.48 as a baseline, and since it doesn't
cost us nothing to use a conditional in the only place where we used the
`install` argument, let's drop it. This avoids a warning in newer
releases of Meson.
2019-03-29 14:30:57 +00:00
Benjamin Otte
a8dccef507 build: The private reftest library needs to be shared
Otherwise the module and gtk-reftest will each have their own copy and
that'll mean all symbols - and inhibiting the shutdown - will exist
twice. Not good.
2019-03-29 09:56:52 +01:00
Benjamin Otte
90f460c236 reftests: Remove notebook-childproperties test
Notebooks have no child properties anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
e5e516468a reftests: Fix textview-tags test
The test was timeouting on X11.

I'm still not sure it does what it should do, but at least that
problem's gone.
2019-03-29 09:56:52 +01:00
Benjamin Otte
b88c9439aa reftests: Fix label-sizing test
Set border, padding and margin to 0, not just padding.
2019-03-29 09:56:52 +01:00
Benjamin Otte
95f9c8a5eb reftests: Remove box-packing test
Boxes have no packing flags anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
fbc8bb979d reftests: Fix grid-empty-with-spacing test
Widgets are visible by default now, so make sure the ones that should be
invisible are marked as such.
2019-03-29 09:56:52 +01:00
Benjamin Otte
e861b0d6c1 reftests: Fix grid-spacing2 test
The expand flag needs to be set on widgets when previously it was a
packing property.
2019-03-29 09:56:52 +01:00
Benjamin Otte
7918eaf677 picture: Don't cause warnings on load failures
When a file set via gtk_picture_set_file() can't be loaded, just
silently don't load it.

Reftest picture-load-invalid-file added for that case.
2019-03-29 09:56:52 +01:00
Benjamin Otte
bf2a93ca0e reftests: Fix image-load-from-file test
- Images are always correctly sized
- Use a GtkPicture for the large file
2019-03-29 09:56:52 +01:00
Benjamin Otte
606aea2302 reftests: Fix iconview-empty test
Images have a static size now, use a GtkPicture instead.
2019-03-29 09:56:52 +01:00
Benjamin Otte
fee8f6b9be reftests: Fix shorthand-entry-border test
We weren't setting CSS back to defaults, so the border highlight
transition would be at different stages when the 2 snapshots happened.
2019-03-29 09:56:52 +01:00
Benjamin Otte
3a8a9fc2bd reftests: Remove style-properties-nth-child test
Style properties don't exist anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
866bc13557 reftests: Fix statusbar-remove-all test 2019-03-29 09:56:52 +01:00
Benjamin Otte
3c44f83909 Fix textview-margins reftest
Draw something, otherwise the test will timeout
2019-03-29 09:56:52 +01:00
Benjamin Otte
9ca5495380 reftests: Fix inherit-and-initial test
Run gtk-builder-tool --3to4 over it. As the test cares about the
"initial" and "inherit" CSS keywords, the actual widgets aren't that
important. It's just important to have many of them.
2019-03-29 09:56:52 +01:00
Benjamin Otte
822791d8a9 reftests: Remove info-bar-message-types test
- The test doesn't properly test infobars. An infobar is not a box.

- Infobar message types aren't styled anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
f070872b36 reftests: Fix notebook-tab-position test
The tab-fill child property is gone, don't use it.
2019-03-29 09:56:52 +01:00
Benjamin Otte
f3e47ee92e reftests: Fix icon-style-basics test
Add a type-func to the GThemedIcon and GEmeblemedIcon usages so
GtkBuilder finds them.
2019-03-29 09:56:52 +01:00
Benjamin Otte
e612b55bd4 reftests: Fix css-match-name test
- Replace GtkImage::pixbuf with GtkImage::paintable
- Use a GtkPicture so the sizing is correct
2019-03-29 09:56:52 +01:00
Benjamin Otte
6d38f1dcb5 reftests: Fix css-match-type test
- Replace GtkImage::pixbuf with GtkImage::paintable
- Use a GtkPicture so the sizing is correct
2019-03-29 09:56:52 +01:00
Benjamin Otte
d4df5211f3 reftests: Fix border-image-excess-size.ui test
The old reftests drew an opaque image, the new image is transparent.

This test drew the reference image as black and the test as transparent
black, and those are now different.
2019-03-29 09:56:52 +01:00
Benjamin Otte
2e67c2eb8f reftests: Delete removed tests from testdata 2019-03-29 09:56:52 +01:00
Benjamin Otte
47d4b06eca reftests: Fix css-currentcolor-alpha.ui test
The test did not draw anything, which fails now.
2019-03-29 09:56:52 +01:00
Benjamin Otte
5ddce32e1a reftests: Fix css-match-class test
- Replace GtkImage::pixbuf with GtkImage::paintable
- Use a GtkPicture so the sizing is correct
2019-03-29 09:56:52 +01:00
Benjamin Otte
8846f28369 reftests: Fix background-size-zero test
We were drawing nothing, causing a timeout.
2019-03-29 09:56:52 +01:00
Benjamin Otte
62d0bd7153 reftests: Fix nth-child test
Box children no longer have a "position" child property.
2019-03-29 09:56:52 +01:00
Benjamin Otte
d5175526f9 reftests: Fix treeview-fixed-height test
Convert -gtk-gradient() to linear-gradient in the CSS.
2019-03-29 09:56:52 +01:00
Benjamin Otte
7935f9d3b8 reftests: Actually build a module
Reftests are expecting a module called libreftest.so, so don't build a
static libgtkreftest.a but what they expect.
2019-03-29 09:56:52 +01:00
Benjamin Otte
7cc5e51a92 reftests: Fix actionbar test
Boxes have no pack-type anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
8542ac2c42 reftests: Fix window-height-for-width test
The dialog's vbox internal child is now called content_area
2019-03-29 09:56:52 +01:00
Benjamin Otte
b3eddbb45d reftests: Fix grid-spacing1 test 2019-03-29 09:56:52 +01:00
Benjamin Otte
e3dbf8d524 reftests: Fix unresolvable.ui test
- Make sure we draw something
- Don't use -gtk-gradient() but linear-gradient instead
2019-03-29 09:56:52 +01:00
Benjamin Otte
d3be32f8ea reftest: Be more careful about snapshotting
Instead of waiting for the first invalidate-contents signal, wait until
we get a render node. This will break spectacularly for reftests not
drawing anything at all, but we just hope that won't happen.
2019-03-29 09:56:52 +01:00
Benjamin Otte
0c81ea2f28 reftests: Make meson run every test separately
This way, we don't get an abort once the first test gets a warning.

We also can use meson test to run individual tests.

Unfortunately, only ~60% of tests pass.
2019-03-29 09:56:52 +01:00
Benjamin Otte
c564a349e5 testsuite: Make reftests work again
Well, the testrunner works again, the tests don't all succeed.

So exclude them from CI.
2019-03-29 09:56:52 +01:00
Benjamin Otte
42d580dc07 reftests: Remove image-recording-surface test
It's no longer possible to set surfaces on a GtkImage, so we don't need
to test that setting a recording surface works.
2019-03-29 09:56:52 +01:00
Matthias Clasen
700183e5b6 Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-28 16:37:21 -04:00
Matthias Clasen
396deb44fa Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 21:48:12 -04:00
Matthias Clasen
e5722367b3 Merge branch 'fixed-layout' into 'master'
Add GtkFixedLayout

See merge request GNOME/gtk!668
2019-03-27 18:51:04 +00:00
Matthias Clasen
7ac250dea7 Convert all ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 13:36:24 -04:00
Matthias Clasen
27c286773c tests: Stop using gtk_window_move
It is going away.
2019-03-26 17:55:29 -04:00
Emmanuele Bassi
fc33bf2d1f Skip all LayoutChild when testing
GtkLayoutChild instances are created on demand once we have a widget, a
GtkLayoutManager, and a child widget. This makes testing their creation
fairly tricky.

Let's skip them, for the time being.
2019-03-26 18:46:55 +00:00
Benjamin Otte
799cb39e08 Remove win32 themeing support
It was unused through all of GTK 3, so it is not worth supporting.

The best Windows themes do not make use of it at all.
2019-03-22 22:30:01 +01:00
Matthias Clasen
898728fb2d a11y tests: Clean up the placeholder-text test
This was relying on setting has-focus for initial focus.
2019-03-16 22:46:34 -04:00
Matthias Clasen
ad3773b2e1 a11y tests: Update expected results
The changes here are all related to initial focus.
2019-03-16 21:49:24 -04:00
Matthias Clasen
8619b109cc Update the focus test
Check that we get the expected sequences of focus
change events for the nonlinear, inferior and ancestor
cases.

It would be nice to do the same checks for crossing
events, but we have no gtk_window_set_hover().
2019-03-16 21:31:56 -04:00
Matthias Clasen
7c19ab66ee single selection: Skip tests properly
Do runtime checks for the GLib version,
instead of compiling out tests.
This avoids compiler warnings.
2019-03-16 21:23:28 -04:00
Benjamin Otte
3a3b325f8e transform: Add perspective()
This commit adds gsk_transform_perspective(), gtk_snapshot_perspective()
and support for perspective() in the CSS syntax.
2019-03-05 20:46:00 +01:00
Benjamin Otte
bd113aa85c transform: Redo querying API
Make the API expect a tranform of the proper category instead of
doing the check ourselves and returning TRUE/FALSE.

The benefit is that the mai use case is switch (transform->category)
statements and in those we know the category and don't need to check
TRUE/FALSE.

Using the wrong matrix will now cause a g_warning().
2019-03-04 23:41:51 +01:00
Benjamin Otte
3545abc7a1 transform: Implement gsk_transform_invert()
And use it.

And test it.
2019-03-04 23:41:51 +01:00
Benjamin Otte
979e9bec27 testsuite: Add a transforms test
In particular, check that to_matrix() and to_2d(), to_affine() and
to_translate() return the same values.

This also requires a recent Graphene version or the tests will fail.
2019-03-04 23:41:27 +01:00
Benjamin Otte
3a3c2d14ab rendernode: Make the transform node take a GskTransform
This is an attempt to push GskTransform deeper into the stack.
2019-03-04 23:15:07 +01:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
1469d01e2e testsuite: Stop using grab-focus as a keybinding signal
We don't have that signal anymore.
2019-02-26 08:16:48 -05:00
Timm Bäder
74ab3cdf75 compare-render: Assert that no error has been set
Much better error message than just the one from the node != NULL
assertion in the next line.
2019-02-25 08:37:06 +01:00
Matthias Clasen
69b1a348c6 a11y tests: Update output for entries 2019-02-23 22:24:50 -05:00
Matthias Clasen
837d9bf39e Remove css test for key bindings 2019-02-21 12:29:46 -05:00
Matthias Clasen
f95ed63b88 Merge branch 'nbpage' into 'master'
Notebook child metas

See merge request GNOME/gtk!594
2019-02-21 05:50:05 +00:00
Matthias Clasen
3eda783d0a tests: Update property tests
The pages property must be skipped.
2019-02-21 00:31:17 -05:00
Matthias Clasen
27f008de44 builder test: Update notebooks 2019-02-21 00:31:17 -05:00
Matthias Clasen
7d69430ebd css tests: Update ui files for notebooks 2019-02-21 00:31:17 -05:00
Matthias Clasen
05f8319270 a11y tests: Update ui files
Notebooks have changed.
2019-02-21 00:31:17 -05:00
Matthias Clasen
572142b950 css tests: Update expected output for entries
Flat is gone.
2019-02-21 00:30:48 -05:00
Chun-wei Fan
a339a5d617 testsuite/gtk/singleselection.c: Avoid VLA usage
It is unfortunate that Visual Studio is unlikely to support VLA usage,
so replace it with g_newa().
2019-02-21 10:37:27 +08:00
Matthias Clasen
ac445229d0 a11y text test: Use a GtkText instead 2019-02-19 00:25:59 -05:00
Matthias Clasen
3422edff6c a11y tests: Update expected output
GtkText makes an appearance in many places now.
2019-02-19 00:25:59 -05:00
Matthias Clasen
102c0ce696 focus test: Use a GtkText instead
Thats where the focus is nowadays.
2019-02-19 00:25:59 -05:00
Matthias Clasen
996a4246fb defaultvalue test: Exempt GtkText::buffer
It gets created on-demand, so isn't NULL.
2019-02-19 00:25:59 -05:00
Matthias Clasen
613f8ceacf testsuite: update css node tests
The entries have changed. Reflect that.
2019-02-19 00:25:59 -05:00
Matthias Clasen
76be7a5025 a11y: Update assistant test output
This changed as part of the recent cleanup that removed
some internal boxing.
2019-02-17 15:54:24 -05:00
Matthias Clasen
74d6d81db9 Merge branch 'assistant-cleanup' into 'master'
Assistant cleanup

See merge request GNOME/gtk!581
2019-02-15 15:54:53 +00:00
Matthias Clasen
aa552229c9 singleselection: Make tests build without warnings 2019-02-15 10:23:48 -05:00
Benjamin Otte
07722582ef simpleselection: Improve items-changed
Make items-changed never emit 2 signals, instead, always emit only one,
potentially by extending the range reported in items-changed.

And be a lot more exhaustive about autoselect tests.
2019-02-15 06:46:04 +01:00
Benjamin Otte
1f56f5c2e9 selectionmodel: Change prototype of query_range()
1. Do not make position an inout variable
The function is meant to return a range for a given position, not modify
a position. So it makes no conceptual sense to use an inout variable.
2. Pass the selected state as an out variable
Using a boolean return value - in particular in an interface full of
boolean return values - makes the return value intuitively feel like a
success/failure return. Using an out variable clarifies the usage.
3. Allow passing every position value
Define what happens when position >= list.n_items
4. Clarify the docs about how this function should behave
In particular, mention the case from point (3)
5. Add more tests
Again, (3) needs testing.
2019-02-15 06:28:35 +01:00
Matthias Clasen
ae9a29f8ce Exempt "pages" properties from defaultvalue test
Ironically, these properties are too good - they always
give you a proper value, which is unfortunately different
from the declared default value, which is NULL. So, don't
check these.
2019-02-13 18:14:48 -05:00
Matthias Clasen
4fb342fb03 Update check-icon-names tests
Drop icons that are only used by demos, and check for ones
that are actually used in gtk.
2019-02-12 21:37:02 -05:00
Matthias Clasen
ec6458db16 testsuite: Consider bookmark-new as required icon
This was missing from the list.
2019-02-12 17:34:07 -05:00
Matthias Clasen
78da8e4dc5 Exclude some tests on too-old glib
I'm coming to the conclusion that the ci test
failures are due to a recently fixed bug in
GListStore.
2019-02-10 23:14:59 -05:00
Matthias Clasen
f496b4c072 add more autoselect tests 2019-02-10 22:19:28 -05:00
Matthias Clasen
2e1a204c49 Reorder tests
Trying to get to the bottom of a ci failure
2019-02-10 21:28:53 -05:00
Matthias Clasen
cdb729441e selection tests: Plug a memory leak 2019-02-10 21:08:44 -05:00
Matthias Clasen
976664c004 a11y tests: Adapt to changes
The buttons in the stack switcher are now toggle buttons, no
longer radio buttons. Update expected output for that.
2019-02-10 18:43:59 -05:00