Commit Graph

1117 Commits

Author SHA1 Message Date
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