On Fri, 1 Apr 2016 12:57:18 +0000
"Wagner, Michael" <[email protected]> wrote:

> Hi,
> 
> I am currently looking into possibilities for unit testing our
> client whether it calls wayland functions in the correct
> form (order, content, etc.)
> 
> So I wanted to use fake wl_* functions for mocking
> purposes. This seems to be not possible as all the
> wayland-scanner generated protocol functions carry
> the function definition already in the header file.
> This leads to compiler errors (multiple definition).
> 
> My question would be, what is the reasoning behind
> putting all definitions already in the header?

This way we do not need to distribute a shim library along with every
protocol extension. See all the extensions in the wayland-protocols
repository.

> Maybe I'm completely looking into the wrong direction,
> and you have any suggestions on how to unit test a
> client application, any hints would be appreciated.

How about mocking libwayland-client ABI (wayland-client-core.h) instead
of the generated protocol API?

Or, maybe use the real deal and mock up a server instead? Though maybe
that's not unit-testing anymore.

You could also look for inspiration in the Wayland test suite, even
though it is quite ad hoc.


Thanks,
pq

Attachment: pgpMaXOzKYY7r.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to