diff mbox series

[2/2] cpio: improve ptests

Message ID 20250606151544.3892443-2-ross.burton@arm.com
State New
Headers show
Series [1/2] tar: clean up run-ptest | expand

Commit Message

Ross Burton June 6, 2025, 3:15 p.m. UTC
We don't need to run 'make check' across the source tree.

Forcibly regenerate tests/testsuite so it supports the --am-fmt option
that we patch into autoconf.

Add coreutils to ptest RDEPENDS as the symlink-bad-length test needs
base64.

Clean up run-ptest: there's no need to run atconfig manually, and use
--am-fmt instead of manually sedding the output.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-extended/cpio/cpio_2.15.bb  | 10 +++++-----
 meta/recipes-extended/cpio/files/test.sh |  9 ++-------
 2 files changed, 7 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-extended/cpio/cpio_2.15.bb b/meta/recipes-extended/cpio/cpio_2.15.bb
index 77fb019af95..fa011251e27 100644
--- a/meta/recipes-extended/cpio/cpio_2.15.bb
+++ b/meta/recipes-extended/cpio/cpio_2.15.bb
@@ -37,10 +37,10 @@  do_install () {
 }
 
 do_compile_ptest() {
-    oe_runmake -C ${B}/gnu/ check
-    oe_runmake -C ${B}/lib/ check
-    oe_runmake -C ${B}/rmt/ check
-    oe_runmake -C ${B}/src/ check
+    # Forcibly regenerate this script so we get our --am-fmt option
+    rm -f ${S}/tests/testsuite
+    oe_runmake -C ${B}/tests/ testsuite
+
     oe_runmake -C ${B}/tests/ genfile
 }
 
@@ -69,7 +69,7 @@  do_install_ptest_base:append() {
 DEPENDS:append:class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'ptest-runner', '', d)}"
 PACKAGE_WRITE_DEPS:append:class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'ptest-runner', '', d)}"
 
-RDEPENDS:${PN}-ptest += "ptest-runner"
+RDEPENDS:${PN}-ptest += "ptest-runner coreutils"
 
 PACKAGES =+ "${PN}-rmt"
 
diff --git a/meta/recipes-extended/cpio/files/test.sh b/meta/recipes-extended/cpio/files/test.sh
index f027574e864..e966ed91f89 100644
--- a/meta/recipes-extended/cpio/files/test.sh
+++ b/meta/recipes-extended/cpio/files/test.sh
@@ -1,10 +1,5 @@ 
 #!/bin/sh
 
-# Define cpio test work dir
-WORKDIR=@PTEST_PATH@/tests/
+cd @PTEST_PATH@/tests/
 
-# Run test
-cd ${WORKDIR}
-./atconfig ./atlocal ./testsuite
-
-./testsuite 2>&1 | grep -E '[0-9]{1,3}: ' | sed -e 's/^.....//' -e '/[ok]$/s/^/PASS: /;/FAILED (.*)/s/^/FAIL: /;/skipped (.*)/s/^/SKIP: /;/expected failure/ s/^/PASS: /;/UNEXPECTED PASS/s/^/FAIL: /' -e 's/ok$//g' -e 's/FAILED.*//g' -e 's/skipped.*//g' -e 's/expected failure.*//g' -e 's/UNEXPECTED PASS.*//g'
+./testsuite --am-fmt