Message ID | 1685609536-23934-1-git-send-email-duep.fnst@fujitsu.com |
---|---|
State | New |
Headers | show |
Series | [meta-oe,V1] xz: add ptest support | expand |
On Thu, 1 Jun 2023 at 10:52, duep.fnst@fujitsu.com <duep.fnst@fujitsu.com> wrote: > +From: Du Erpei <duep.fnst@fujitsu.com> > +Subject: [PATCH] tests/Makefile.am: add target of 'build-PROGRAMS' > + > +Add target 'build-PROGRAMS' to only compile the test set under > +'/tests' and not run locally. > + > +Upstream-Status: Pending Please submit this patch to xz upstream first and include the link to that submission. https://github.com/tukaani-project/xz Alex
Hello Alex I have modified the patch again, and the new patch does not need to modify the upstream xz. The link of the new patch: https://lists.openembedded.org/g/openembedded-core/message/182481 Du -----邮件原件----- 发件人: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> 代表 Alexander Kanavin 发送时间: 2023年6月1日 17:03 收件人: Du, Erpei/杜 二佩 <duep.fnst@fujitsu.com> 抄送: openembedded-core@lists.openembedded.org; FNST fnstml-fujitsuten <fnstml-fujitsuten@fujitsu.com> 主题: Re: [OE-core] [meta-oe][PATCH V1] xz: add ptest support On Thu, 1 Jun 2023 at 10:52, duep.fnst@fujitsu.com <duep.fnst@fujitsu.com> wrote: > +From: Du Erpei <duep.fnst@fujitsu.com> > +Subject: [PATCH] tests/Makefile.am: add target of 'build-PROGRAMS' > + > +Add target 'build-PROGRAMS' to only compile the test set under > +'/tests' and not run locally. > + > +Upstream-Status: Pending Please submit this patch to xz upstream first and include the link to that submission. https://github.com/tukaani-project/xz Alex
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index d60ebb38fc..9aa68c75ea 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -70,6 +70,7 @@ PTESTS_FAST = "\ sed \ slang \ wayland \ + xz \ zlib \ " PTESTS_FAST:append:libc-glibc = " glibc-tests" diff --git a/meta/recipes-extended/xz/xz/0001-build-PROGRAMS.patch b/meta/recipes-extended/xz/xz/0001-build-PROGRAMS.patch new file mode 100644 index 0000000000..f97a75030a --- /dev/null +++ b/meta/recipes-extended/xz/xz/0001-build-PROGRAMS.patch @@ -0,0 +1,20 @@ +From: Du Erpei <duep.fnst@fujitsu.com> +Subject: [PATCH] tests/Makefile.am: add target of 'build-PROGRAMS' + +Add target 'build-PROGRAMS' to only compile the test set under +'/tests' and not run locally. + +Upstream-Status: Pending + +--- a/tests/Makefile.am 2023-01-12 00:51:42.000000000 +0800 ++++ b/tests/Makefile.am 2023-05-30 14:49:34.507313644 +0800 +@@ -74,6 +74,9 @@ if COND_SCRIPTS + TESTS += test_scripts.sh + endif + ++build-PROGRAMS: all-am ++ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) ++ + clean-local: + -rm -f compress_generated_* \ + xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz diff --git a/meta/recipes-extended/xz/xz/run-ptest b/meta/recipes-extended/xz/xz/run-ptest new file mode 100644 index 0000000000..ebde965d5c --- /dev/null +++ b/meta/recipes-extended/xz/xz/run-ptest @@ -0,0 +1,5 @@ +#!/bin/sh +cd ./tests +for i in `ls test*`; do + ./$i +done diff --git a/meta/recipes-extended/xz/xz_5.4.1.bb b/meta/recipes-extended/xz/xz_5.4.1.bb index 71bf4b540a..14808b1714 100644 --- a/meta/recipes-extended/xz/xz_5.4.1.bb +++ b/meta/recipes-extended/xz/xz_5.4.1.bb @@ -24,13 +24,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=97d554a32881fee0aa283d96e47cb24a \ file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 \ " -SRC_URI = "https://tukaani.org/xz/xz-${PV}.tar.gz" +SRC_URI = "https://tukaani.org/xz/xz-${PV}.tar.gz \ + file://0001-build-PROGRAMS.patch \ + file://run-ptest" SRC_URI[sha256sum] = "e4b0f81582efa155ccf27bb88275254a429d44968e488fc94b806f2a61cd3e22" UPSTREAM_CHECK_REGEX = "xz-(?P<pver>\d+(\.\d+)+)\.tar" CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh" -inherit autotools gettext +inherit autotools gettext ptest PACKAGES =+ "liblzma" @@ -42,3 +44,21 @@ ALTERNATIVE:${PN} = "xz xzcat unxz \ lzma lzcat unlzma" BBCLASSEXTEND = "native nativesdk" + +do_compile_ptest(){ + oe_runmake -C ${B}/tests/ build-PROGRAMS +} + +do_install_ptest(){ + install -d ${D}${PTEST_PATH}/tests/ + find ${B}/tests/ -type f -not -name "*.o" -not -name "Makefile" \ + -exec install --mode=755 {} ${D}${PTEST_PATH}/tests/ \; + + install -d ${D}${PTEST_PATH}/tests/.libs/ + install --mode=755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests/.libs/ + + install -d ${D}${PTEST_PATH}/tests/files/ + install --mode=755 ${S}/tests/files/* ${D}${PTEST_PATH}/tests/files/ +} + +RDEPENDS:${PN}-ptest += "bash"