[oe-commits] [openembedded-core] 18/19: wayland: add ptest

git at git.openembedded.org git at git.openembedded.org
Sun Feb 23 23:35:19 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 34cf80418eeb3f759f42b40c7a755d6d2f7c25a3
Author: Alexander Kanavin <alex.kanavin at gmail.com>
AuthorDate: Sun Feb 23 23:11:11 2020 +0100

    wayland: add ptest
    
    Sadly, meson makes it very difficult to install tests: the test
    configuration is written into host-specific binary files, which
    can't be transferred to the target. (unlike autotools where
    at least everything happens via Makefiles which can be patched
    and tweaked via sed and env vars)
    
    So the configuration has to be entirely recreated in shell.
    I managed this for wayland, but weston proved too difficult.
    
    I had filed bugs asking upstream to make the tests installable:
    https://gitlab.freedesktop.org/wayland/wayland/issues/146
    https://gitlab.freedesktop.org/wayland/weston/issues/368
    
    Signed-off-by: Alexander Kanavin <alex.kanavin at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/conf/distro/include/ptest-packagelists.inc |  1 +
 meta/recipes-graphics/wayland/wayland/run-ptest | 17 +++++++++++++++++
 meta/recipes-graphics/wayland/wayland_1.18.0.bb | 14 +++++++++++++-
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 6e77085..4afac58 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -47,6 +47,7 @@ PTESTS_FAST = "\
     quilt-ptest \
     sed-ptest \
     slang-ptest \
+    wayland-ptest \
     zlib-ptest \
 "
 
diff --git a/meta/recipes-graphics/wayland/wayland/run-ptest b/meta/recipes-graphics/wayland/wayland/run-ptest
new file mode 100644
index 0000000..7e8d9de
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export WAYLAND_SCANNER=wayland-scanner
+export TEST_DATA_DIR=tests/data
+export TEST_OUTPUT_DIR=tests/output
+export SED=sed
+export WAYLAND_EGL_LIB=/usr/lib/libwayland-egl.so.1
+export NM=nm
+
+for i in `ls tests/*-test tests/wayland-egl-symbols-check tests/scanner-test.sh`; do
+    $i
+    if [ $? -eq 0 ]; then
+        echo "PASS: $i"
+    else
+        echo "FAIL: $i"
+    fi
+done
diff --git a/meta/recipes-graphics/wayland/wayland_1.18.0.bb b/meta/recipes-graphics/wayland/wayland_1.18.0.bb
index 5dc3116..00be3aa 100644
--- a/meta/recipes-graphics/wayland/wayland_1.18.0.bb
+++ b/meta/recipes-graphics/wayland/wayland_1.18.0.bb
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
 DEPENDS = "expat libffi wayland-native"
 
 SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+           file://run-ptest \
            file://0002-meson.build-find-the-native-wayland-scanner-directly.patch \
            file://0002-Do-not-hardcode-the-path-to-wayland-scanner.patch \
            file://0001-build-Fix-strndup-detection-on-MinGW.patch \
@@ -23,7 +24,7 @@ SRC_URI[sha256sum] = "4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c
 
 UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
 
-inherit meson pkgconfig
+inherit meson pkgconfig ptest
 
 PACKAGECONFIG ??= "dtd-validation"
 PACKAGECONFIG[dtd-validation] = "-Ddtd_validation=true,-Ddtd_validation=false,libxml2,,"
@@ -39,6 +40,15 @@ do_install_append_class-native() {
       -i ${D}/${datadir}/aclocal/wayland-scanner.m4
 }
 
+do_install_ptest() {
+    mkdir -p ${D}${PTEST_PATH}/tests/data
+    cp -rf ${B}/tests/*-test ${B}/tests/*-checker ${D}${PTEST_PATH}/tests
+    cp -rf ${B}/tests/*-checker ${D}${PTEST_PATH}
+    cp -rf ${S}/tests/scanner-test.sh ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/data/* ${D}${PTEST_PATH}/tests/data/
+    cp -rf ${S}/egl/wayland-egl-symbols-check ${D}${PTEST_PATH}/tests/
+}
+
 sysroot_stage_all_append_class-target () {
 	rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
 	cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
@@ -48,3 +58,5 @@ FILES_${PN} = "${libdir}/*${SOLIBS}"
 FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
 
 BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS_${PN}-ptest += "binutils sed"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list