Commit graph

14 commits

Author SHA1 Message Date
Simon Ser
6849a6af1f
test: refactor build
Put the tests definition inside a big dictionary (with the executable test name
and the subtests). This allows to easily add more executables.
2019-10-14 18:44:48 +03:00
Simon Ser
5115e96cd9
test: add composition tests 2019-10-11 14:31:17 +03:00
Simon Ser
7382dfd346
Add intersection check for layers over the current one
Make sure we don't use planes with lower zpos for layers over the previous ones,
unless there is no collision.

This adds the last intersection check.

Closes: https://github.com/emersion/libliftoff/issues/3
2019-09-15 23:54:29 +03:00
Simon Ser
c63c8c0d15
test: add zpos-4x-disjoint-alt
And restore the original zpos-4x-disjoint test. Depending on the constraints on
the last two layers, one branch of the layer zpos check or the other is taken.

Fixes: 8617ddfd05 ("Add intersection check for planes under the current one")
2019-09-15 23:48:10 +03:00
Simon Ser
8617ddfd05
Add intersection check for planes under the current one
References: https://github.com/emersion/libliftoff/issues/3
2019-09-15 22:31:10 +03:00
Simon Ser
c5d22e1310
Add intersection checks for composited layer on top check
has_composited_layer_on_top is now less strict and performs plane intersection
checks before returning true.

This allows for more layers to be assigned to planes, the relevant tests have
been enabled.

References: https://github.com/emersion/libliftoff/issues/3
2019-09-15 17:08:32 +03:00
Simon Ser
8c93a6fc88
test: add alloc@zpos-4x-domino-partial
This is a variant of alloc@zpos-4x-domino-fail, with plane ordering changed so
that one layer can be mapped to a plane.
2019-09-14 21:18:20 +03:00
Simon Ser
a93ea4a300
test: add alloc@zpos-4x-domino-fail
This test makes sure composited layers make layers underneath fall back to
composition too, in a transitive manner. That is, if plane A is under plane B
which is itself under plane C, plane A falling back to composition means that
both planes B and C fall back to composition too (even if C isn't directly
underneath A).
2019-09-14 21:05:14 +03:00
Simon Ser
07e04a50b6
Make composited layers prevent plane allocation underneath
If a layer cannot be mapped to a plane, make it so all layers under it also fail
plane allocation so that they can be properly composited on the primary plane.

A test was incorrect and has been fixed. Another test had two possible solutions
and has been updated with the one libliftoff yields.
2019-09-14 21:03:30 +03:00
Simon Ser
a3b8bc33ea
test: add various zpos tests
Some of these are failing, so they are disabled for now.
2019-09-14 12:59:37 +03:00
Simon Ser
3200016033
test: add basic zpos tests
zpos-3x maps three layers to primary, cursor and one of the overlays planes.

zpos-4x-partial sets up 4 layers but is only able to find a plane for 3 layers,
because ordering between the two overlay planes is undefined.
2019-09-13 22:53:15 +03:00
Simon Ser
de8175c998
test: add an alloc test with 3 layers 2019-09-13 22:35:23 +03:00
Simon Ser
fccdebfd6e
test: introduce structured alloc tests
This is a new kind of tests defined by a static structure. The structure
contains the layers and planes to setup as well as the expected result.
2019-09-13 19:47:00 +03:00
Simon Ser
5afeeb531a
Add test framework
When testing the library, the libdrm dependency is swapped with a mock libdrm.
The test sets up the mock libdrm's internal state and then runs the test.
2019-09-13 10:33:49 +03:00