diff options
author | Yan Xinkuan <yanxk.fnst@fujitsu.com> | 2022-11-01 07:55:11 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-02 09:21:29 +0000 |
commit | b0c0783e31134f70122404c9c74d770836840745 (patch) | |
tree | 158a45ec0e90c6914a68de26b6563f693d8f65fa /meta/recipes-extended/bc/bc_1.07.1.bb | |
parent | e33afcd0dca526c1991f5ed0062764481fe70e52 (diff) | |
download | poky-b0c0783e31134f70122404c9c74d770836840745.tar.gz |
bc: Add ptest.
Add ptest for OSS 'bc' by using 'bc' in the system to do calculation jobs according to the .b files from the source file.
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 '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.
(From OE-Core rev: 98b058a039ae8a49437c306f684f919c93df55fd)
Signed-off-by: Yan Xinkuan <yanxk.fnst@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/bc/bc_1.07.1.bb')
-rw-r--r-- | meta/recipes-extended/bc/bc_1.07.1.bb | 9 |
1 files changed, 7 insertions, 2 deletions
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" | |||
15 | SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ | 15 | SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ |
16 | file://no-gen-libmath.patch \ | 16 | file://no-gen-libmath.patch \ |
17 | file://libmath.h \ | 17 | file://libmath.h \ |
18 | file://0001-dc-fix-exit-code-of-q-command.patch" | 18 | file://0001-dc-fix-exit-code-of-q-command.patch \ |
19 | file://run-ptest" | ||
19 | SRC_URI[md5sum] = "cda93857418655ea43590736fc3ca9fc" | 20 | SRC_URI[md5sum] = "cda93857418655ea43590736fc3ca9fc" |
20 | SRC_URI[sha256sum] = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a" | 21 | SRC_URI[sha256sum] = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a" |
21 | 22 | ||
22 | inherit autotools texinfo update-alternatives | 23 | inherit autotools texinfo update-alternatives ptest |
23 | 24 | ||
24 | PACKAGECONFIG ??= "readline" | 25 | PACKAGECONFIG ??= "readline" |
25 | PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" | 26 | PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" |
@@ -29,6 +30,10 @@ do_compile:prepend() { | |||
29 | cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h | 30 | cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h |
30 | } | 31 | } |
31 | 32 | ||
33 | do_install_ptest() { | ||
34 | install ${S}/Test/*.b ${D}${PTEST_PATH} | ||
35 | } | ||
36 | |||
32 | ALTERNATIVE:${PN} = "bc dc" | 37 | ALTERNATIVE:${PN} = "bc dc" |
33 | ALTERNATIVE_PRIORITY = "100" | 38 | ALTERNATIVE_PRIORITY = "100" |
34 | 39 | ||