From: Mark Wielaard Date: Thu, 31 May 2018 12:35:34 +0000 (+0200) Subject: tests: Split self_test_files into an exe, lib and obj list. X-Git-Tag: elfutils-0.171~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00d89086c97a8782620da14ec2fab67d5bd57038;p=thirdparty%2Felfutils.git tests: Split self_test_files into an exe, lib and obj list. 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 --- diff --git a/tests/ChangeLog b/tests/ChangeLog index c03db54cc..1c1ef4ede 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,13 @@ +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 diff --git a/tests/run-get-units-split.sh b/tests/run-get-units-split.sh index 7b13694ba..7a43c670c 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 f4ce427b5..328fe78be 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 a765db639..ff600760d 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() {