From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106668 invoked by alias); 31 May 2018 12:40:38 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 106106 invoked by uid 89); 31 May 2018 12:40:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 12:40:35 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id E973B3000702; Thu, 31 May 2018 14:40:32 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 9C9C840B9DED; Thu, 31 May 2018 14:40:32 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] tests: Split self_test_files into an exe, lib and obj list. Date: Thu, 31 May 2018 12:40:00 -0000 Message-Id: <1527770431-13854-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q2/txt/msg00124.txt.bz2 Introduce testrun_on_self_exe and testrun_on_self_lib. Some tests cannot handle (unrelocated) ET_REL object files. run-get-units-split.sh and run-unit-info.sh only handle executables and shared libraries. This allows running the whole testsuite on an elfutils build done with CFLAGS="-gdwarf-4 -gsplit-dwarf -O2". Signed-off-by: Mark Wielaard --- tests/ChangeLog | 10 ++++++++++ tests/run-get-units-split.sh | 5 +++-- tests/run-unit-info.sh | 5 +++-- tests/test-subr.sh | 39 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index c03db54..1c1ef4e 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,15 @@ 2018-05-31 Mark Wielaard + * test-subr.sh (self_test_files): Split into self_test_files_exe, + self_test_files_lib and self_test_obj. + (testrun_on_self_exe): New function. + (testrun_on_self_lib): Likewise. + * run-get-units-split.sh: Replace testrun_on_self with + testrun_on_self_exe and testrun_on_self_lib. + * run-unit-info.sh: Likewise. + +2018-05-31 Mark Wielaard + * low_high_pc.c (handle_die): Handle NULL name. Print offset and name of die. (main): Check if the cu DIE is a skeleton, then get and handle diff --git a/tests/run-get-units-split.sh b/tests/run-get-units-split.sh index 7b13694..7a43c67 100755 --- a/tests/run-get-units-split.sh +++ b/tests/run-get-units-split.sh @@ -59,7 +59,8 @@ Found a skeleton unit, with split die: world.c EOF -# Self test -testrun_on_self ${abs_builddir}/get-units-split +# Self test (Not on obj files since those need relocation first). +testrun_on_self_exe ${abs_builddir}/get-units-split +testrun_on_self_lib ${abs_builddir}/get-units-split exit 0 diff --git a/tests/run-unit-info.sh b/tests/run-unit-info.sh index f4ce427..328fe78 100755 --- a/tests/run-unit-info.sh +++ b/tests/run-unit-info.sh @@ -74,7 +74,8 @@ Iterate no info, compare recorded info with dwarf_cu_info. EOF -# Self test -testrun_on_self ${abs_builddir}/unit-info +# Self test (not on obj files, since those need relocation first). +testrun_on_self_exe ${abs_builddir}/unit-info +testrun_on_self_lib ${abs_builddir}/unit-info exit 0 diff --git a/tests/test-subr.sh b/tests/test-subr.sh index a765db6..ff60076 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -115,16 +115,25 @@ program_transform() echo "$*" | sed "${program_transform_name}" } -self_test_files=`echo ${abs_top_builddir}/src/addr2line \ +self_test_files_exe=`echo ${abs_top_builddir}/src/addr2line \ ${abs_top_builddir}/src/elfcmp ${abs_top_builddir}/src/elflint \ ${abs_top_builddir}/src/nm ${abs_top_builddir}/src/objdump \ ${abs_top_builddir}/src/readelf \ -${abs_top_builddir}/src/size.o ${abs_top_builddir}/src/strip.o \ ${abs_top_builddir}/libelf/libelf.so \ ${abs_top_builddir}/libdw/libdw.so \ ${abs_top_builddir}/backends/libebl_i386.so \ ${abs_top_builddir}/backends/libebl_x86_64.so` +self_test_files_lib=`echo ${abs_top_builddir}/libelf/libelf.so \ +${abs_top_builddir}/libdw/libdw.so \ +${abs_top_builddir}/backends/libebl_i386.so \ +${abs_top_builddir}/backends/libebl_x86_64.so` + +self_test_files_obj=`echo ${abs_top_builddir}/src/size.o \ +${abs_top_builddir}/src/strip.o` + +self_test_files="$self_test_files_exe $self_test_files_lib $self_test_files_obj" + # Provide a command to run on all self-test files with testrun. testrun_on_self() { @@ -139,6 +148,32 @@ testrun_on_self() if test $exit_status != 0; then exit $exit_status; fi } +testrun_on_self_exe() +{ + exit_status=0 + + for file in $self_test_files_exe; do + testrun $* $file \ + || { echo "*** failure in $* $file"; exit_status=1; } + done + + # Only exit if something failed + if test $exit_status != 0; then exit $exit_status; fi +} + +testrun_on_self_lib() +{ + exit_status=0 + + for file in $self_test_files_lib; do + testrun $* $file \ + || { echo "*** failure in $* $file"; exit_status=1; } + done + + # Only exit if something failed + if test $exit_status != 0; then exit $exit_status; fi +} + # Compress the files first. Compress both debug sections and symtab. testrun_on_self_compressed() { -- 1.8.3.1