[autotests] Add tests for DRM platform plugin
ClosedPublic

Authored by graesslin on Nov 12 2017, 8:07 PM.

Details

Summary

The addition of the test infrastructure is motivated by the regressions
caused by adding mode switching and transformation support.
A contributing factor to these regression is the fact that the DRM
platform does not have any tests. It is difficult to test this code as
it needs to work with hardware, thus we cannot use the real DRM library.
Instead we need to use mocking.

This change sets up some first basic tests with the help of a mockDrm
library. In order to better test the code as units the Drm classes are
slightly refactored. Most importantly the dependency to DrmBackend is
removed wherever possible and replaced by a simple int fd which is mostly
the only element used by the classes.

This first test introduces basic testing of a DrmObject. It is intended
to extend this to at least also test DrmPlane as a central piece of our
Drm platform plugin. This will also extend the tests of DrmObject.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Nov 12 2017, 8:07 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 12 2017, 8:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson accepted this revision.Nov 15 2017, 7:26 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
autotests/drm/mock_drm.h
1

I assume this is just phab being stupid?

This revision is now accepted and ready to land.Nov 15 2017, 7:26 PM
graesslin added inline comments.Nov 15 2017, 8:19 PM
autotests/drm/mock_drm.h
1

yes or git being stupid. I did not copy any files around but created a new empty file. Ok, I admit I copied the copyright header, but certainly one with my copyright - I'm lazy ;-)

This revision was automatically updated to reflect the committed changes.