* [meta-oe][oe-core][PATCH V4] bc: Add ptest.
@ 2022-10-27 3:09 yanxk.fnst
2022-10-31 9:58 ` Alexander Kanavin
0 siblings, 1 reply; 3+ messages in thread
From: yanxk.fnst @ 2022-10-27 3:09 UTC (permalink / raw)
To: openembedded-core; +Cc: fnstml-fujitsuten, Yan Xinkuan
From: Yan Xinkuan <yanxk.fnst@fujitsu.com>
Add package test function for OSS 'bc',
using bc in the system to do calculation
jobs according to the .b files from the
source code file of 'bc'.
Test example as below:
......
.00673400673400673400
“PASS: bc/div.b”
9983640860328357366034714556282968349582
7909199408566065153345558783\
9427595471.89114392327665123852
“PASS: bc/exp.b”
length(b)= 1406
“PASS: bc/fact.b”
......
If bc runs the .b files and does not crash,
it would 'PASS', otherwise it would 'FAIL'.
Tested in qemux86-64, with kvm enabled, test
cost 12 secs, so it should be a fast test.
Thanks to Ross Burton and Alexander Kanavin
for the professional guidance.
Signed-off-by: Yan Xinkuan <yanxk.fnst@fujitsu.com>
---
meta/conf/distro/include/ptest-packagelists.inc | 1 +
meta/recipes-extended/bc/bc/run-ptest | 9 +++++++++
meta/recipes-extended/bc/bc_1.07.1.bb | 9 +++++++--
3 files changed, 17 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..0a52a48ef1 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -69,6 +69,7 @@ PTESTS_FAST = "\
slang-ptest \
wayland-ptest \
zlib-ptest \
+ bc-ptest \
"
PTESTS_FAST:append:libc-glibc = " glibc-tests-ptest"
PTESTS_PROBLEMS:remove:libc-glibc = "glibc-tests-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..da2156f8cd
--- /dev/null
+++ b/meta/recipes-extended/bc/bc/run-ptest
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+for TEST in *.b; do
+ if bc -l $TEST </dev/null; then
+ echo “PASS: bc/$TEST”
+ else
+ echo “FAIL: bc/$TEST”
+ fi
+done
diff --git a/meta/recipes-extended/bc/bc_1.07.1.bb b/meta/recipes-extended/bc/bc_1.07.1.bb
index 1bec76bb2a..178588f11b 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,10 @@ do_compile:prepend() {
cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h
}
+do_install_ptest() {
+ install ${S}/Test/*.b ${D}${PTEST_PATH}
+}
+
ALTERNATIVE:${PN} = "bc dc"
ALTERNATIVE_PRIORITY = "100"
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [meta-oe][oe-core][PATCH V4] bc: Add ptest.
2022-10-27 3:09 [meta-oe][oe-core][PATCH V4] bc: Add ptest yanxk.fnst
@ 2022-10-31 9:58 ` Alexander Kanavin
2022-10-31 23:33 ` Yan Xin Kuan
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kanavin @ 2022-10-31 9:58 UTC (permalink / raw)
To: Yan Xin Kuan; +Cc: openembedded-core, fnstml-fujitsuten
On Mon, 31 Oct 2022 at 10:55, Yan Xin Kuan <yanxk.fnst@fujitsu.com> wrote:
> @@ -69,6 +69,7 @@ PTESTS_FAST = "\
> slang-ptest \
> wayland-ptest \
> zlib-ptest \
> + bc-ptest \
> "
This needs to be inserted in alphabetical order, otherwise looks good.
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [meta-oe][oe-core][PATCH V4] bc: Add ptest.
2022-10-31 9:58 ` Alexander Kanavin
@ 2022-10-31 23:33 ` Yan Xin Kuan
0 siblings, 0 replies; 3+ messages in thread
From: Yan Xin Kuan @ 2022-10-31 23:33 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Got it.
Can be seen in v5.
[-- Attachment #2: Type: text/html, Size: 33 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-31 23:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-27 3:09 [meta-oe][oe-core][PATCH V4] bc: Add ptest yanxk.fnst
2022-10-31 9:58 ` Alexander Kanavin
2022-10-31 23:33 ` Yan Xin Kuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox