All of lore.kernel.org
 help / color / mirror / Atom feed
* [oe] [meta-oe][PATCH] bc: Add ptest.
@ 2022-09-19  6:44 yanxk.fnst
  2022-09-21 11:27 ` [OE-core] " Richard Purdie
  2022-09-27 10:29 ` Ross Burton
  0 siblings, 2 replies; 3+ messages in thread
From: yanxk.fnst @ 2022-09-19  6:44 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3368 bytes --]

Provide a patch to enable the ptest function of
the OSS 'bc' by reusing the original test of the OSS
itself with small adjustment in the 'timetest' script.

This ptest was placed in the PTEST_SLOW queue since it
takes upto 48s to execute on the qemuarm.

Signed-off-by: Yan Xinkuan <yanxk.fnst@fujitsu.com>
---
.../distro/include/ptest-packagelists.inc     |  1 +
meta/recipes-extended/bc/bc/run-ptest         |  8 ++++++
meta/recipes-extended/bc/bc_1.07.1.bb         | 28 +++++++++++++++++--
3 files changed, 35 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-extended/bc/bc/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 56088e4e66..5cbed54cc5 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -100,6 +100,7 @@ PTESTS_SLOW = "\
     tcl-ptest \
     util-linux-ptest \
     valgrind-ptest \
+    bc-ptest \
"
 PTESTS_SLOW:remove:riscv64 = "valgrind-ptest"
diff --git a/meta/recipes-extended/bc/bc/run-ptest b/meta/recipes-extended/bc/bc/run-ptest
new file mode 100644
index 0000000000..7e37e9ef01
--- /dev/null
+++ b/meta/recipes-extended/bc/bc/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/bash
+cd ./bc_test
+if ./timetest; then
+     echo "PASS: bc/timetest"
+else
+     echo "FAIL: bc/timetest"
+fi
+
diff --git a/meta/recipes-extended/bc/bc_1.07.1.bb b/meta/recipes-extended/bc/bc_1.07.1.bb
index 1bec76bb2a..9d439d9312 100644
--- a/meta/recipes-extended/bc/bc_1.07.1.bb
+++ b/meta/recipes-extended/bc/bc_1.07.1.bb
@@ -15,11 +15,12 @@ DEPENDS = "flex-native"
SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
            file://no-gen-libmath.patch \
            file://libmath.h \
-           file://0001-dc-fix-exit-code-of-q-command.patch"
+           file://0001-dc-fix-exit-code-of-q-command.patch \
+           file://run-ptest"
SRC_URI[md5sum] = "cda93857418655ea43590736fc3ca9fc"
SRC_URI[sha256sum] = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a"
-inherit autotools texinfo update-alternatives
+inherit autotools texinfo update-alternatives ptest
 PACKAGECONFIG ??= "readline"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
@@ -29,6 +30,29 @@ do_compile:prepend() {
     cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h
}
+RDEPENDS:${PN}-ptest += "bash"
+
+do_compile_ptest() {
+     install -d ${B}/Test/
+     install ${S}/Test/timetest ${B}/Test/timetest
+     sed -i "6,8d" ${B}/Test/timetest
+}
+
+do_install_ptest() {
+     install -d ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/atan.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/div.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/exp.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/fact.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/jn.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/ln.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/mul.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/raise.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/sine.b ${D}${PTEST_PATH}/bc_test/
+     install ${S}/Test/sqrt.b ${D}${PTEST_PATH}/bc_test/
+     install ${B}/Test/timetest ${D}${PTEST_PATH}/bc_test/
+}
+
ALTERNATIVE:${PN} = "bc dc"
ALTERNATIVE_PRIORITY = "100"
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 11673 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [oe] [meta-oe][PATCH] bc: Add ptest.
  2022-09-19  6:44 [oe] [meta-oe][PATCH] bc: Add ptest yanxk.fnst
@ 2022-09-21 11:27 ` Richard Purdie
  2022-09-27 10:29 ` Ross Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2022-09-21 11:27 UTC (permalink / raw)
  To: Yanxinkuan.FNST, openembedded-core

On Mon, 2022-09-19 at 06:44 +0000, Yanxinkuan.FNST wrote:
> Provide a patch to enable the ptest function of
> the OSS 'bc' by reusing the original test of the OSS
> itself with small adjustment in the 'timetest' script.
>  
> This ptest was placed in the PTEST_SLOW queue since it
> takes upto 48s to execute on the qemuarm.
>  
> Signed-off-by: Yan Xinkuan <yanxk.fnst@fujitsu.com>
> ---
> .../distro/include/ptest-packagelists.inc     |  1 +
> meta/recipes-extended/bc/bc/run-ptest         |  8 ++++++
> meta/recipes-extended/bc/bc_1.07.1.bb         | 28 +++++++++++++++++-
> -
> 3 files changed, 35 insertions(+), 2 deletions(-)
> create mode 100644 meta/recipes-extended/bc/bc/run-ptest

Unfortunately the encoding on this patch was problematic and all the
leading whitespace was removed meaning it could be applied. Could you
check your email configuration please and resend?

Thanks,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [oe] [meta-oe][PATCH] bc: Add ptest.
  2022-09-19  6:44 [oe] [meta-oe][PATCH] bc: Add ptest yanxk.fnst
  2022-09-21 11:27 ` [OE-core] " Richard Purdie
@ 2022-09-27 10:29 ` Ross Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Ross Burton @ 2022-09-27 10:29 UTC (permalink / raw)
  To: yanxk.fnst; +Cc: openembedded-core

On 19 Sep 2022, at 07:44, Yanxinkuan.FNST via lists.openembedded.org <yanxk.fnst=fujitsu.com@lists.openembedded.org> wrote:
> +do_compile_ptest() {
> +     install -d ${B}/Test/
> +     install ${S}/Test/timetest ${B}/Test/timetest
> +     sed -i "6,8d" ${B}/Test/timetest
> +}

This sed expression is incredibly fragile.  If timetest changes in the slightest way the sed will continue to delete lines, and who knows what will happen.

If the test script needs changing, please patch it.

Ross

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-27 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19  6:44 [oe] [meta-oe][PATCH] bc: Add ptest yanxk.fnst
2022-09-21 11:27 ` [OE-core] " Richard Purdie
2022-09-27 10:29 ` Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.