]> code.ossystems Code Review - openembedded-core.git/commitdiff
libinput: add ptest
authorAlexander Kanavin <alex.kanavin@gmail.com>
Tue, 5 May 2020 13:01:10 +0000 (15:01 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 May 2020 11:11:03 +0000 (12:11 +0100)
The test takes about 17 minutes, and fully passes.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-graphics/wayland/libinput/run-ptest [new file with mode: 0644]
meta/recipes-graphics/wayland/libinput_1.15.2.bb

index c13ff724b164fdc648f4fe96a858350f05a369be..ab44757a11dae51f85da16db7f61e088da4ba872 100644 (file)
@@ -72,6 +72,7 @@ PTESTS_SLOW = "\
     glib-2.0-ptest \
     gstreamer1.0-ptest \
     libevent-ptest \
+    libinput-ptest \
     lttng-tools-ptest \
     openssh-ptest \
     openssl-ptest \
diff --git a/meta/recipes-graphics/wayland/libinput/run-ptest b/meta/recipes-graphics/wayland/libinput/run-ptest
new file mode 100644 (file)
index 0000000..5a84c56
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+/usr/libexec/libinput/libinput-test-suite
+if [ $? -eq 0 ]; then
+  echo 'PASS: libinput-test-suite'
+else
+  echo 'FAIL: libinput-test-suite'
+fi
+
index 810532774ea4a39758b593c01c5c9f27abaa1b66..fd236f75dd46cb180d5497476d1f503cc29f0e79 100644 (file)
@@ -10,9 +10,10 @@ SECTION = "libs"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=1f2ea9ebff3a2c6d458faf58492efb63"
 
-DEPENDS = "libevdev udev mtdev"
+DEPENDS = "libevdev udev mtdev libcheck"
 
 SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
+           file://run-ptest \
            file://determinism.patch \
            "
 SRC_URI[md5sum] = "eb6bd2907ad33d53954d70dfb881a643"
@@ -20,7 +21,15 @@ SRC_URI[sha256sum] = "971c3fbfb624f95c911adeb2803c372e4e3647d1b98f278f660051f834
 
 UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
 
-inherit meson pkgconfig lib_package
+inherit meson pkgconfig lib_package ptest
+
+# Patch out build directory, otherwise it leaks into ptest binary
+do_configure_append() {
+    sed -i -e "s,${WORKDIR},,g" config.h
+    if [ -e "litest-config.h" ]; then
+        sed -i -e "s,${WORKDIR},,g" litest-config.h
+    fi
+}
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[libwacom] = "-Dlibwacom=true,-Dlibwacom=false,libwacom"
@@ -30,7 +39,7 @@ UDEVDIR = "`pkg-config --variable=udevdir udev`"
 
 EXTRA_OEMESON += "-Dudev-dir=${UDEVDIR} \
                   -Ddocumentation=false \
-                  -Dtests=false \
+                  ${@bb.utils.contains('PTEST_ENABLED', '1', '-Dtests=true -Dinstall-tests=true', '-Dtests=false -Dinstall-tests=false', d)} \
                   -Dzshcompletiondir=no"
 
 # package name changed in 1.8.1 upgrade: make sure package upgrades work
@@ -38,3 +47,4 @@ RPROVIDES_${PN} = "libinput"
 RREPLACES_${PN} = "libinput"
 RCONFLICTS_${PN} = "libinput"
 
+FILES_${PN}-ptest += "${libexecdir}/libinput/libinput-test-suite"