diff mbox series

[5/5] elfutils: use upstream's parallel test harness for ptest

Message ID 20261204120821.88472-6-jaipaul.cheernam@est.tech
State New
Headers show
Series elfutils recipe cleanup and improvements | expand

Commit Message

Jaipaul Cheernam Dec. 4, 2026, 12:08 p.m. UTC
run-ptest uses installcheck-local, so serial-tests is no longer needed.
Install config/test-driver, pass AWK=awk and print test-suite.log on
failure.

core-image-ptest-elfutils on qemux86-64, passed before -> after:
  glibc: 261 -> 257, 0 failed
  musl:  254 -> 250, 0 failed

The 4 dropped passes were PASS: lines printed by elf-from-memory and
ar-getarsym-mem, miscounted as tests. Both still run and pass.

AI-Generated: Uses Kiro CLI (claude-opus-5.5)
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 .../elfutils/elfutils_0.197.bb                |  3 ++-
 .../elfutils/files/ptest.patch                | 23 ++++---------------
 .../recipes-devtools/elfutils/files/run-ptest |  7 +++++-
 3 files changed, 12 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.197.bb b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
index 07b74bc1e45..02b336c2343 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.197.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
@@ -60,7 +60,7 @@  do_compile_ptest() {
 	cxxflags="$(makefile-getvar Makefile CXXFLAGS) -Wno-error"
 	# test-nlist has a custom rule using test_nlist_CFLAGS (-g -O0), which lacks
 	# the debug prefix maps and leaks build paths; use the standard CFLAGS
-	oe_runmake buildtest-TESTS oecheck "CFLAGS=$cflags" "CXXFLAGS=$cxxflags" \
+	oe_runmake oecheck "CFLAGS=$cflags" "CXXFLAGS=$cxxflags" \
 		'test_nlist_CFLAGS=$(CFLAGS)'
 }
 PTEST_PARALLEL_MAKE = ""
@@ -107,6 +107,7 @@  do_install_ptest() {
 	cp -r ${B}/tests/*                      ${D}${PTEST_PATH}/tests
 	cp -r ${B}/config.h                     ${D}${PTEST_PATH}
 	cp -r ${B}/config/profile.sh            ${D}${PTEST_PATH}/config
+	cp ${S}/config/test-driver               ${D}${PTEST_PATH}/config
 	cp -r ${B}/backends                     ${D}${PTEST_PATH}
 	cp -r ${B}/debuginfod                   ${D}${PTEST_PATH}
 	sed -i '/^Makefile:/c Makefile:'        ${D}${PTEST_PATH}/tests/Makefile
diff --git a/meta/recipes-devtools/elfutils/files/ptest.patch b/meta/recipes-devtools/elfutils/files/ptest.patch
index 771a6470ac5..9dfa21eae2e 100644
--- a/meta/recipes-devtools/elfutils/files/ptest.patch
+++ b/meta/recipes-devtools/elfutils/files/ptest.patch
@@ -3,36 +3,21 @@  From: Richard Purdie <richard.purdie@linuxfoundation.org>
 Date: Wed, 1 May 2019 16:37:48 +0100
 Subject: [PATCH] Changes to allow ptest to run standalone on target:
 
-a) Run the tests serially
-b) Use the standalone test mode which allows the tests to be run in their
+a) Use the standalone test mode which allows the tests to be run in their
   'installled' locations on target (but not any of the standalone build pieces)
-c) We want to use the binaries from their installed locations so the run-subr
+b) We want to use the binaries from their installed locations so the run-subr
    script needs tweaking to run them like that. The rpath conditional isn't
    enough since we want the second entry in the case statement.
-d) Add an oecheck make target which we can use to build the test binaries we need
+c) Add an oecheck make target which we can use to build the test binaries we need
 
 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 
 Upstream-Status: Inappropriate [oe specific]
 ---
- configure.ac       | 2 +-
  tests/Makefile.am  | 2 ++
  tests/test-subr.sh | 6 ------
- 3 files changed, 3 insertions(+), 7 deletions(-)
+ 2 files changed, 2 insertions(+), 6 deletions(-)
 
-diff --git a/configure.ac b/configure.ac
-index d3c0292..76bdda2 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -43,7 +43,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2026 The elfutils developers.])
- AC_PREREQ(2.69)			dnl Minimum Autoconf version required.
- 
- dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
--AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
-+AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip serial-tests])
- AM_MAINTAINER_MODE
- 
- AM_SILENT_RULES([yes])
 diff --git a/tests/Makefile.am b/tests/Makefile.am
 index 261649f..bb36d3a 100644
 --- a/tests/Makefile.am
diff --git a/meta/recipes-devtools/elfutils/files/run-ptest b/meta/recipes-devtools/elfutils/files/run-ptest
index 3c6c14e47f9..4be9ff7f035 100644
--- a/meta/recipes-devtools/elfutils/files/run-ptest
+++ b/meta/recipes-devtools/elfutils/files/run-ptest
@@ -3,4 +3,9 @@ 
 #This script is used to run elfutils test suites
 cd tests
 
-make -k installcheck-local CC=gcc abs_srcdir=$PWD abs_builddir=$PWD srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed elfutils_tests_rpath=no program_transform_name=s,^,eu-, XFAIL_TESTS="@XFAIL_TESTS@"
+make -k installcheck-local CC=gcc AWK=awk abs_srcdir=$PWD abs_builddir=$PWD srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed elfutils_tests_rpath=no program_transform_name=s,^,eu-, XFAIL_TESTS="@XFAIL_TESTS@" || {
+	rc=$?
+	# The parallel harness writes test output to log files; show it on failure
+	[ -f test-suite.log ] && cat test-suite.log
+	exit $rc
+}