Add ptest for less
cover Add ptest for less
Hi all,
This series is adding ptest support for less.
As of today, release tarball are fetched from
http://www.greenwoodsoftware.com/ but the less test code is not bundled within these releases. A github issue has been opened asking for maintainer to add the test code into the release [1].
So before test code gets bundled into the release tarballs, switch to github URI.
Here is the output when running the ptest on the target:
FAIL: chinese1.lt
PASS: colorbars.lt
PASS: github216.lt
PASS: github265.lt
PASS: github329.lt
PASS: hdr-unicode1.lt
PASS: hdr-unicode.lt
PASS: proc-special.lt
PASS: seq200.lt
PASS: table-50x200.lt
FAIL: utf8-2.txt.lt
PASS: version.c.lt
============================================================================
Testsuite summary for less
============================================================================
# TOTAL: 12
# PASS: 10
# FAIL: 2
============================================================================
I am building a core-image-minimal image with poky DISTRO and run it into qemu. I have 2 FAIL. All tests PASS on my computer.
I suspect a locale issue here but I may need some help on this.
I opened a pull request on less for Makefile modification [2]
And I also opened a github issue [3] to ask a reformating of the less test summary to follow Automake simple test format to simplify the run-ptest script.
My branch is available on poky-contrib repository [4]
[YOCTO #15073]
Best
Julien
[1]: https://github.com/gwsw/less/issues/344
[2]: https://github.com/gwsw/less/pull/398
[3]: https://github.com/gwsw/less/issues/399
[4]: https://git.yoctoproject.org/poky-contrib/log/?h=jstephan/add-ptest-for-less
Julien Stephan (1):
less: add ptest support
.../distro/include/ptest-packagelists.inc | 1 + ...akefile-allow-CFLAGS-to-be-overitten.patch | 28 +++++++++++++ ...esstest-Makefile-add-LDFLAGS-support.patch | 41 +++++++++++++++++++ meta/recipes-extended/less/files/run-ptest | 25 +++++++++++ meta/recipes-extended/less/less_633.bb | 37 ++++++++++++++--- 5 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 meta/recipes-extended/less/files/0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch create mode 100644 meta/recipes-extended/less/files/0002-lesstest-Makefile-add-LDFLAGS-support.patch create mode 100644 meta/recipes-extended/less/files/run-ptest
Signature · 1 line
2.41.0
PATCH 1/1 less: add ptest support
as of today, release tarball are fetched from
http://www.greenwoodsoftware.com/ but the less test code is not bundled within these releases. A github issue has been opened asking for maintainer to add the test code into the release [1].
So before test code gets bundled into the release tarballs, switch to github URI.
[YOCTO #15073]
[1]: https://github.com/gwsw/less/issues/344
--- .../distro/include/ptest-packagelists.inc | 1 + ...akefile-allow-CFLAGS-to-be-overitten.patch | 28 +++++++++++++ ...esstest-Makefile-add-LDFLAGS-support.patch | 41 +++++++++++++++++++ meta/recipes-extended/less/files/run-ptest | 25 +++++++++++ meta/recipes-extended/less/less_633.bb | 37 ++++++++++++++--- 5 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 meta/recipes-extended/less/files/0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch create mode 100644 meta/recipes-extended/less/files/0002-lesstest-Makefile-add-LDFLAGS-support.patch create mode 100644 meta/recipes-extended/less/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
@@ -95,6 +95,7 @@ PTESTS_SLOW = "\ glib-2.0 \ gnutls \ gstreamer1.0 \ + less \ libevent \ libgcrypt \ libmodule-build-perl \
meta/recipes-extended/less/files/0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 6499e388a0af8c4531f845ccc58f30ffb1a03c51 Mon Sep 17 00:00:00 2001 +From: Julien Stephan <[email protected]> +Date: Tue, 4 Jul 2023 11:43:14 +0200 +Subject: [PATCH 1/2] lesstest: Makefile: allow CFLAGS to be overitten + +use weak assignment for CFLAGS so user can set its CFLAGS and still have +a sane default value + +Upstream-Status: Submitted [https://github.com/gwsw/less/pull/398] + +Signed-off-by: Julien Stephan <[email protected]> +--- + lesstest/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lesstest/Makefile b/lesstest/Makefile +index 387b7ae..a231900 100644 +--- a/lesstest/Makefile ++++ b/lesstest/Makefile +@@ -1,5 +1,5 @@ + CC ?= gcc +-CFLAGS = -Wall -O2 ++CFLAGS ?= -Wall -O2 + TERMLIB = -lncurses + + all: lesstest lt_screen +-- +2.41.0
meta/recipes-extended/less/files/0002-lesstest-Makefile-add-LDFLAGS-support.patch new file +41 -0
41 lines not on this page · raw message
meta/recipes-extended/less/files/run-ptest new file +25 -0
@@ -0,0 +1,25 @@ +#! /bin/sh + +fail=0 +pass=0 + +for i in lt/*; do + ./runtest -l /usr/bin/less -t lesstest $i &> /dev/null + + if [[ $? -eq 0 ]]; then + echo "PASS: $(basename $i)" + pass=$((pass+1)) + else + echo "FAIL: $(basename $i)" + fail=$((fail+1)) + fi +done + +echo "============================================================================" +echo Testsuite summary for less +echo "============================================================================" +echo "# TOTAL: $((fail+pass))" +echo "# PASS: $pass" +echo "# FAIL: $fail" +echo "============================================================================" +
meta/recipes-extended/less/less_633.bb +32 -5
@@ -23,19 +23,46 @@ LICENSE = "GPL-3.0-or-later | BSD-2-Clause" LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ file://LICENSE;md5=1b2446f5c8632bf63a97d7a49750e1c6 \ " -DEPENDS = "ncurses" +DEPENDS = "ncurses groff-native" -SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz" +SRC_URI = "git://github.com/gwsw/less.git;protocol=https;branch=master \ + file://run-ptest \ + file://0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch \ + file://0002-lesstest-Makefile-add-LDFLAGS-support.patch \ + " +SRCREV = "0d7ca880375bde651313f03f7115d26921b43722" -SRC_URI[sha256sum] = "2f201d64b828b88af36dfe6cfdba3e0819ece2e446ebe6224813209aaefed04f" +S = "${WORKDIR}/git" -UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html" +inherit autotools ptest update-alternatives -inherit autotools update-alternatives +EXTRA_OEMAKE += " LESSTEST=1" + +# According to the README of the project when getting code from git we should run +# the following command before running the configure script +do_configure:prepend () { + cd ${S} + make -f Makefile.aut distfiles + cd - +} + +do_compile_ptest () { + cd ${S}/lesstest + oe_runmake +} do_install () { oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install } +do_install_ptest () { + cp ${S}/lesstest/lesstest ${D}${PTEST_PATH} + cp ${S}/lesstest/runtest ${D}${PTEST_PATH} + cp ${S}/lesstest/lt_screen ${D}${PTEST_PATH} + cp -r ${S}/lesstest/lt ${D}${PTEST_PATH} +} + +RDEPENDS:${PN}-ptest:append = " perl-module-getopt-std perl-module-cwd" + ALTERNATIVE:${PN} = "less" ALTERNATIVE_PRIORITY = "100"
Signature · 1 line
2.41.0
Hi Julien,
Quoted 4 lines · Julien Stephan via lists.openembedded.org
So before test code gets bundled into the release tarballs, switch to github URI.
Please split this into a separate commit, so we can review the change to git separately from the addition of ptest.
Quoted 2 lines
FAIL: chinese1.lt
FAIL: utf8-2.txt.lt
If there’s a way to make the tests more verbose when they fail then that’s really useful, being able to see what the error actually is helps a lot.
As you say, these are locale issues, so you _probably_ need to RDEPEND on the right packages. For example, glib-2.0-ptest RDEPENDS on glibc-gconv-utf-32 and locale-base-fr-fr to pull in UTF-32 encoding and fr_FR locale support.
Ross
Quoted 9 lines · Ross Burton
Hi Julien,
Quoted 4 lines · Julien Stephan via lists.openembedded.org
So before test code gets bundled into the release tarballs, switch to github URI.
Please split this into a separate commit, so we can review the change to git separately from the addition of ptest.
Hi Ross,
done in v2!
Quoted 5 lines
Quoted 2 lines
FAIL: chinese1.lt
FAIL: utf8-2.txt.ltIf there’s a way to make the tests more verbose when they fail then that’s really useful, being able to see what the error actually is helps a lot.
I found an option to be verbose an error, I'll add it in a v4.
Quoted 2 lines
As you say, these are locale issues, so you _probably_ need to RDEPEND on the right packages. For example, glib-2.0-ptest RDEPENDS on glibc-gconv-utf-32 and locale-base-fr-fr to pull in UTF-32 encoding and
fr_FRlocale support.
thank you for pointing this out. I fixed the issue using locale-base-en-us as RDEPENDS. Fixed in v3.
Best
Julien
Quoted 1 line
Ross