summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <Mingli.Yu@windriver.com>2019-04-16 16:05:00 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-23 23:30:19 +0100
commit073556fa8c6e95ebd1cd97d5226b8b9e743fe4e0 (patch)
treea0d1f632f06533adf4d75f658ac14db4c337122c
parentf0d4ef3cdcf803aab2acf3c40dea8bfec44dc01c (diff)
downloadpoky-073556fa8c6e95ebd1cd97d5226b8b9e743fe4e0.tar.gz
elfutils: add ptest support
Add testsuite-ignore-elflint.diff from debian (http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz) to fix below ptest failure: | ./run-strip-strmerge.sh: line 33: testrun_on_self_skip: command not found | FAIL: run-strip-strmerge.sh Add check for gcc for two test cases such as run-strip-nothing.sh and run-strip-g.sh which depends on gcc at run time. (From OE-Core rev: 240e6b8819aab3bf74cdde92934be337e766aa75) Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.176.bb27
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch45
-rw-r--r--meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff52
-rw-r--r--meta/recipes-devtools/elfutils/files/run-ptest6
-rw-r--r--meta/recipes-devtools/elfutils/files/serial-tests.patch28
5 files changed, 157 insertions, 1 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.176.bb b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
index cd824e2901..031c00fb28 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.176.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
@@ -27,16 +27,24 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
27 file://debian/hurd_path.patch \ 27 file://debian/hurd_path.patch \
28 file://debian/ignore_strmerge.diff \ 28 file://debian/ignore_strmerge.diff \
29 file://debian/disable_werror.patch \ 29 file://debian/disable_werror.patch \
30 file://debian/testsuite-ignore-elflint.diff \
31 file://0001-skip-the-test-when-gcc-not-deployed.patch \
32 file://run-ptest \
33 file://serial-tests.patch \
30 " 34 "
31SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch" 35SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
32 36
33SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9" 37SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9"
34SRC_URI[sha256sum] = "eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023" 38SRC_URI[sha256sum] = "eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023"
35 39
36inherit autotools gettext 40inherit autotools gettext ptest
37 41
38EXTRA_OECONF = "--program-prefix=eu- --without-lzma" 42EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
39EXTRA_OECONF_append_class-native = " --without-bzlib" 43EXTRA_OECONF_append_class-native = " --without-bzlib"
44# gcc has been added to blacklist, we will find workaround solution
45RDEPENDS_${PN}-ptest = "libasm libelf bash"
46
47EXTRA_OECONF_append_class-target += "--enable-tests-rpath"
40 48
41do_install_append() { 49do_install_append() {
42 if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then 50 if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
@@ -44,6 +52,23 @@ do_install_append() {
44 fi 52 fi
45} 53}
46 54
55do_compile_ptest() {
56 cd ${B}/tests
57 oe_runmake buildtest-TESTS
58}
59
60do_install_ptest() {
61 if [ ${PTEST_ENABLED} = "1" ]; then
62 cp -r ${S}/tests/ ${D}${PTEST_PATH}
63 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
64 cp -r ${B}/src ${D}${PTEST_PATH}
65 cp -r ${B}/config.h ${D}${PTEST_PATH}
66 cp -r ${B}/backends ${D}${PTEST_PATH}
67 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
68 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
69 fi
70}
71
47EXTRA_OEMAKE_class-native = "" 72EXTRA_OEMAKE_class-native = ""
48EXTRA_OEMAKE_class-nativesdk = "" 73EXTRA_OEMAKE_class-nativesdk = ""
49 74
diff --git a/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch b/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
new file mode 100644
index 0000000000..67ca0e4c77
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
@@ -0,0 +1,45 @@
1From 61939d2e552e7645ecd671fa01cf1c7a72caa82a Mon Sep 17 00:00:00 2001
2From: Mingli Yu <Mingli.Yu@windriver.com>
3Date: Fri, 12 Apr 2019 16:29:58 +0800
4Subject: [PATCH] skip the test when gcc not deployed
5
6Skip the tests which depend on gcc when
7gcc not deployed.
8
9Upstream-Status: Inappropriate [oe specific]
10
11Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
12---
13 tests/run-strip-g.sh | 2 ++
14 tests/run-strip-nothing.sh | 2 ++
15 2 files changed, 4 insertions(+)
16
17diff --git a/tests/run-strip-g.sh b/tests/run-strip-g.sh
18index 1303819..a943dec 100755
19--- a/tests/run-strip-g.sh
20+++ b/tests/run-strip-g.sh
21@@ -24,6 +24,8 @@
22
23 tempfiles a.out strip.out debug.out readelf.out
24
25+# skip the test if gcc deployed
26+which gcc || exit 77
27 echo Create debug a.out.
28 echo "int main() { return 1; }" | gcc -g -xc -
29
30diff --git a/tests/run-strip-nothing.sh b/tests/run-strip-nothing.sh
31index 914fdfb..d03f734 100755
32--- a/tests/run-strip-nothing.sh
33+++ b/tests/run-strip-nothing.sh
34@@ -22,6 +22,8 @@
35
36 tempfiles a.out strip.out debug.out
37
38+# skip the case if no gcc deployed
39+which gcc || exit 77
40 # Create no-debug a.out.
41 echo "int main() { return 1; }" | gcc -s -xc -
42
43--
442.7.4
45
diff --git a/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff
new file mode 100644
index 0000000000..c4ce20c8a3
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff
@@ -0,0 +1,52 @@
1From 03a343c6b1b72598fce654b8a638f106da44abfb Mon Sep 17 00:00:00 2001
2From: OpenEmbedded <oe.patch@oe>
3Date: Fri, 12 Apr 2019 08:05:50 +0000
4Subject: [PATCH] On many architectures this test fails because binaries/libs
5 produced by binutils don't pass elflint. However elfutils shouldn't FTBFS
6 because of this.
7
8So we run the tests on all archs to see what breaks, but if it breaks we ignore
9the result (exitcode 77 means: this test was skipped).
10
11Upstream-Status: Inappropriate [oe specific]
12
13Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
14---
15 tests/run-elflint-self.sh | 2 +-
16 tests/test-subr.sh | 15 +++++++++++++++
17 2 files changed, 16 insertions(+), 1 deletion(-)
18
19diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh
20index 58fa7d0..85d21a5 100755
21--- a/tests/run-elflint-self.sh
22+++ b/tests/run-elflint-self.sh
23@@ -18,5 +18,5 @@
24
25 . $srcdir/test-subr.sh
26
27-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
28+testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
29 testrun_on_self_compressed ${abs_top_builddir}/src/elflint --quiet --gnu-ld
30diff --git a/tests/test-subr.sh b/tests/test-subr.sh
31index 09f428d..26f61f1 100644
32--- a/tests/test-subr.sh
33+++ b/tests/test-subr.sh
34@@ -201,3 +201,18 @@ testrun_on_self_quiet()
35 # Only exit if something failed
36 if test $exit_status != 0; then exit $exit_status; fi
37 }
38+
39+# Same as testrun_on_self(), but skip on failure.
40+testrun_on_self_skip()
41+{
42+ exit_status=0
43+
44+ for file in $self_test_files; do
45+ testrun $* $file \
46+ || { echo "*** failure in $* $file"; exit_status=77; }
47+ done
48+
49+ # Only exit if something failed
50+ if test $exit_status != 0; then exit $exit_status; fi
51+}
52+
diff --git a/meta/recipes-devtools/elfutils/files/run-ptest b/meta/recipes-devtools/elfutils/files/run-ptest
new file mode 100644
index 0000000000..770a62e731
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/run-ptest
@@ -0,0 +1,6 @@
1#!/bin/sh
2#
3#This script is used to run elfutils test suites
4cd tests
5
6make -k runtest-TESTS abs_srcdir=$PWD abs_builddir=$PWD bindir=$PWD/../src/ srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed
diff --git a/meta/recipes-devtools/elfutils/files/serial-tests.patch b/meta/recipes-devtools/elfutils/files/serial-tests.patch
new file mode 100644
index 0000000000..4b448cd50a
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/serial-tests.patch
@@ -0,0 +1,28 @@
1From 48e111a17e8d5f10690716a63c17670f1406b56c Mon Sep 17 00:00:00 2001
2From: "Hongjun.Yang" <hongjun.yang@windriver.com>
3Date: Wed, 28 Oct 2015 13:24:54 +0800
4Subject: [PATCH] Add serial-tests support, ptest need it.
5
6Add serial-tests support, ptest need it.
7
8Upstream-Status: Inappropriate [oe specific]
9
10Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
11
12---
13 configure.ac | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/configure.ac b/configure.ac
17index b4e012d..2eb0417 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -45,7 +45,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2018 The elfutils developers.])
21 AC_PREREQ(2.63) dnl Minimum Autoconf version required.
22
23 dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
24-AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
25+AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip serial-tests])
26 AM_MAINTAINER_MODE
27
28 AM_SILENT_RULES([yes])