summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-05-31 14:35:34 +0200
committerMark Wielaard <[email protected]>2018-06-01 13:14:39 +0200
commit00d89086c97a8782620da14ec2fab67d5bd57038 (patch)
tree7a51e3164d963265004d7c9c5a0905fcd900d1e2
parent60d2bfc2ea7250de8e02ef02cae761821dd53de2 (diff)
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 <[email protected]>
-rw-r--r--tests/ChangeLog10
-rwxr-xr-xtests/run-get-units-split.sh5
-rwxr-xr-xtests/run-unit-info.sh5
-rw-r--r--tests/test-subr.sh39
4 files changed, 53 insertions, 6 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c03db54c..1c1ef4ed 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,15 @@
2018-05-31 Mark Wielaard <[email protected]>
+ * 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 <[email protected]>
+
* 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 7b13694b..7a43c670 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 f4ce427b..328fe78b 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 a765db63..ff600760 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()
{