Skip to contentSkip to conversation

bc: Add ptest.

PATCH Superseded [email protected] 2 participants 5 messages Oct 31, 2022 1 message not in the archive

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 bc: Add ptest.

From: Yan Xinkuan <[email protected]>

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” 99836408603283573660347145562829683495827909199408566065153345558783\
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'.

I ran ptest with Intel CORE i5 4450, in qemux86-64, the whole test took up to 124 seconds, so it should be a slow test.

Thanks to Ross Burton for the professional guidance.

---
 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
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 56088e4e66..5cbed54cc5 100644
@@ -100,6 +100,7 @@ PTESTS_SLOW = "\
     tcl-ptest \
     util-linux-ptest \
     valgrind-ptest \
+    bc-ptest \
 "
 
 PTESTS_SLOW:remove:riscv64 = "valgrind-ptest"
meta/recipes-extended/bc/bc/run-ptest new file +9 -0
new file mode 100644
index 0000000000..da2156f8cd
@@ -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
meta/recipes-extended/bc/bc_1.07.1.bb +7 -2
index 1bec76bb2a..178588f11b 100644
@@ -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

#1 lore raw

Was kvm enabled in qemu?

Alex

Quoted 109 lines · Yan Xin Kuan

From: Yan Xinkuan <[email protected]>

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” 99836408603283573660347145562829683495827909199408566065153345558783\
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'.

I ran ptest with Intel CORE i5 4450, in qemux86-64, the whole test took up to 124 seconds, so it should be a slow test.

Thanks to Ross Burton for the professional guidance.

---
 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
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 56088e4e66..5cbed54cc5 100644
@@ -100,6 +100,7 @@ PTESTS_SLOW = "\
     tcl-ptest \
     util-linux-ptest \
     valgrind-ptest \
+    bc-ptest \
 "
 
 PTESTS_SLOW:remove:riscv64 = "valgrind-ptest"
meta/recipes-extended/bc/bc/run-ptest new file +9 -0
new file mode 100644
index 0000000000..da2156f8cd
@@ -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
meta/recipes-extended/bc/bc_1.07.1.bb +2 -1
index 1bec76bb2a..178588f11b 100644
@@ -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"

meta/recipes-extended/bc/bc_1.07.1.bb +5 -2
-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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#172291):
https://lists.openembedded.org/g/openembedded-core/message/172291
Mute This Topic: https://lists.openembedded.org/mt/94680520/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [OE-core] Public: Re: [meta-oe][PATCH V3] bc: Add ptest.

In that case, the benchmark for the test was not performed correctly. You need to use the kvm parameter.

Alex

Quoted 2 lines · Yan Xin Kuan

runqemu was used, but no kvm parameter passed.

#4 lore raw

Public: Re: [meta-oe][oe-core][PATCH V3] bc: Add ptest.

In reply to Alexander Kanavin

Sure.

I did not intend to make it private.

I just do not know how, it takes time for new commers to get used to this mailling list kind of management.

I will find myself some docs to look into.

Maybe this is not working, for I can not see our conversation on the website:
"Public: Re: [meta-oe][PATCH V3] bc: Add ptest."

I switched it to this:
Public: Re: [meta-oe][oe-core][PATCH V3] bc: Add ptest.

Not pretty sure weather it works or not.

Nevermind, I would find some guidence in oe docs.

#5 lore raw

Re: Public: Re: [meta-oe][oe-core][PATCH V3] bc: Add ptest.

This conversation is on the mailing list now.

When writing a response, you need to check the list of recipients in your message (typically in the 'To:' field), which should include [email protected] and then it will go to the list.

Alex

Quoted 26 lines · Yan Xin Kuan

Sure.

I did not intend to make it private.

I just do not know how, it takes time for new commers to get used to this mailling list kind of management.

I will find myself some docs to look into.

Maybe this is not working, for I can not see our conversation on the website:
"Public: Re: [meta-oe][PATCH V3] bc: Add ptest."

I switched it to this:
Public: Re: [meta-oe][oe-core][PATCH V3] bc: Add ptest.

Not pretty sure weather it works or not.

Nevermind, I would find some guidence in oe docs.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#172298): https://lists.openembedded.org/g/openembedded-core/message/172298
Mute This Topic: https://lists.openembedded.org/mt/94681666/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-