libinput has support for an installable test, so this should not be difficult.
Patch: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akanavin/package-version-updates-later&id=803c27e0e68ce66d804a14c1a0bc55f2860541ce Not sure if it's worth adding due to the 17 minutes it adds to slow ptests.
Added to oe-core.