Commit Graph

134 Commits

Author SHA1 Message Date
Matthias Clasen
509db01319 tests: Centralize our test setup a bit
Put all of the constant environment into the
toplevel meson.build file, to reduce repetition
and copy-paste errors.
2020-05-15 14:11:53 -04:00
Matthias Clasen
c22af88235 tests: Allow setting a subdir for output
meson seems somewhat weak when it comes to handling
test output. We need to get the output from different
test runs into different locations, and the only
way to communicate from a test setup with the actual
test code seems the environment, so use that.

Make all tests that produce output in files respect
a TEST_OUTPUT_SUBDIR environment variable which specifies
the name of a subdirectory to use. This is combined
with the existing --output argument, which specifies
a per-test location.

Affected tests are reftests, css performance tests
and gsk compare tests.
2020-05-15 14:11:53 -04:00
Timm Bäder
b9ed957af3 gl renderer: Fix nested rounded clip rendering
If the inner clip intersects with the corners of the outer clip, we
potentially need a texture. We should add more fine-grained checks for
this in the future though.

Test case included.
2020-05-13 08:07:55 +02:00
Matthias Clasen
cbb0ca4902 testsuite: Tell meson we use TAP
This makes meson actually parse the individual test
results. Most of the time, it does not make a difference,
but one case where it does is when all the individual
tests of a binary are skipped, meson will mark the
test as skipped.
2020-03-20 11:55:26 -04:00
Timm Bäder
83982a28e7 testuite/gsk: Add common_cflags to build
And fix all the warnings and errors.
2020-03-06 18:22:01 +01:00
Benjamin Otte
7597f6b594 transform: Don't crash for gsk_transform_transform (id, id)
See attached tests
2020-02-21 18:30:13 +01:00
Benjamin Otte
b50093d044 transform: Make sure the identity transform is equal to NULL 2020-02-21 18:25:05 +01:00
Benjamin Otte
75b130ed6b testsuite: Add tests for rounded rect code
... including the bug that was fixed in the parent commit.
2020-02-13 07:36:38 +01:00
Benjamin Otte
16e38701b6 testsuite: Don't use gdk_cairo_get_clip_rectangle()
I want to remove it.
2020-02-13 06:15:44 +01:00
Benjamin Otte
9d8ceb0cb2 testsuite: Don't destroy surfaces that are still used
Coercing the surfaces must not unref the old surface, because the old
surface is going to be saved to a file.
2020-02-13 06:15:44 +01:00
Alexander Larsson
a3be0ec5f0 Don't use xsettings or xft defaults in testsuite
This adds a GDK_DEBUG=default-settings flag which disables reads
from xsettings and Xft resources, and enables this for the testsuite.

This is one less way to get different testresults depending on the
environment. In particular, it was failing the css tests for me
due to getting the wrong font size because i have a different dpi.
2020-02-03 15:11:35 +01:00
Benjamin Otte
93cf76b068 testsuite: Improve diff_with_file() function
Properly handle diff(1) failing.

In this particular case, the test passed a NULL input file to the diff
(that was fixed, too) and then diff only found one input file and
aborted.

But without this fix, we'd also not catch other abortion reasons for
diff() - as long as it exited in any way, we were happy.
2020-01-28 02:17:03 +01:00
Timm Bäder
ac4e98f16a testsuite: Add test cases for last commit
Easy enough to test
2020-01-24 06:19:16 +01:00
Timm Bäder
262ac4247a testsuite: Add a testcase for blend nodes with invisible children 2020-01-07 17:27:19 +01:00
Timm Bäder
1dd31d58fb testsuite: Add a test case for rotated border node 2020-01-07 17:27:17 +01:00
Timm Bäder
ac1497eb2d testsuite: Add an inset shadow rendering test case 2019-12-03 08:40:35 +01:00
Timm Bäder
4f532224e0 testsuite: Add another repeat node test case 2019-11-26 09:09:25 +01:00
Timm Bäder
39a48de025 testsuite: Add a testcase for repeat nodes that don't repeat 2019-11-19 10:45:35 +01:00
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
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
fd7f6ca7ad tests: improve error handling 2019-07-25 13:51:34 -04:00
Timm Bäder
b9b5072668 gl renderer: Fix opacity nodes with overlapping child nodes 2019-07-14 10:08:04 +02: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
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02: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
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
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