diff options
author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2017-09-28 09:33:40 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2017-10-06 21:38:48 +0200 |
commit | a5d5f65d9a493ae17ccaca89d927875ece7eac69 (patch) | |
tree | 2328728e5dc3e69b74f2d1f687fb0a65aa06882b | |
parent | bd121d61b6772149d1a5c8bfdaa5605199a55fec (diff) | |
download | elfutils-a5d5f65d9a493ae17ccaca89d927875ece7eac69.tar.gz |
Add support for dwarflint testing
* dwarflint/tests: Update all scripts and makefiles to work
with current test environment.
* dwarflint/Makefile.am: Add support for dwarflint testing.
* tests/test-subr.sh: Update to be used in dwarflint/tests.
* tests/test-wrapper.sh: Likewise.
* tests/run-dwarflint-self.sh: Return back into tests/.
Signed-off-by: Djordje Todorovic <djordje.todorovic@rt-rk.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
-rw-r--r-- | dwarflint/Makefile.am | 37 | ||||
-rwxr-xr-x | dwarflint/tests/run-DW_AT-later-version.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-DW_AT_high_pc-below.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-DW_AT_high_pc-relative.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-aranges_terminate_early.sh | 6 | ||||
-rwxr-xr-x | dwarflint/tests/run-bad.sh | 38 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_debug_info_refs.sh | 10 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_duplicate_DW_tag_variable.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_range_out_of_scope.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_self_referential_die.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-libdl-2.12.so.debug.sh | 6 | ||||
-rwxr-xr-x | dwarflint/tests/run-location-leaks.sh | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-nodebug.sh | 20 | ||||
-rwxr-xr-x | dwarflint/tests/run-test-all-dies-it.sh | 8 | ||||
-rwxr-xr-x | dwarflint/tests/run-upper.sh | 4 | ||||
-rwxr-xr-x | tests/run-dwarflint-self.sh | 46 | ||||
-rw-r--r-- | tests/test-subr.sh | 5 | ||||
-rwxr-xr-x | tests/test-wrapper.sh | 2 |
19 files changed, 143 insertions, 71 deletions
diff --git a/dwarflint/Makefile.am b/dwarflint/Makefile.am index 1f10a5fb..58b3ed1a 100644 --- a/dwarflint/Makefile.am +++ b/dwarflint/Makefile.am @@ -55,7 +55,7 @@ dwarflint_SOURCES = \ files.cc files.hh \ highlevel_check.cc highlevel_check.hh highlevel_check_i.hh \ locus.cc locus.hh \ - main.cc \ + main.cc main.hh \ messages.cc messages.hh \ misc.cc misc.hh \ option.cc option.hh option_i.hh \ @@ -127,11 +127,14 @@ EXTRA_DIST = $(EXTRA_TESTS) \ tests/crc7.ko.debug.bz2 \ tests/location-leaks.bz2 \ tests/nodebug.bz2 \ + tests/null.o.bz2 \ tests/check_range_out_of_scope-1.bz2 \ tests/check_debug_info_refs-1.bz2 \ - tests/aranges_terminate_early.bz2 + tests/check_debug_info_refs-2.bz2 \ + tests/aranges_terminate_early.bz2 \ tests/libdl-2.12.so.debug.bz2 \ tests/hello.bad-1.bz2 \ + tests/hello.bad-2.bz2 \ tests/hello.bad-3.bz2 \ tests/empty-1.bz2 \ tests/garbage-1.bz2 \ @@ -154,18 +157,36 @@ EXTRA_DIST = $(EXTRA_TESTS) \ installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ - $(top_srcdir)/tests/test-wrapper.sh \ - installed $(tests_rpath) \ - $(program_transform_name) + LC_ALL=C; LANG=C; \ + abs_srcdir=$(abs_srcdir); \ + abs_builddir=$(abs_builddir); \ + abs_top_builddir=$(abs_top_builddir); \ + export abs_srcdir; export abs_builddir; \ + export abs_top_builddir; \ + export libdir; export bindir; \ + export LC_ALL; export LANG; \ + NM=$(NM); export NM; +installed_LOG_COMPILER = $(top_srcdir)/tests/test-wrapper.sh \ + installed $(tests_rpath) \ + '$(program_transform_name)' if STANDALONE TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT) +LOG_COMPILER = $(installed_LOG_COMPILER) else !STANDALONE -TESTS_ENVIRONMENT = $(top_srcdir)/tests/test-wrapper.sh \ - ../libdw:../backends:../libelf:../libasm +TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; \ + abs_srcdir=$(abs_srcdir); abs_builddir=$(abs_builddir); \ + abs_top_builddir=$(abs_top_builddir); \ + export abs_srcdir; export abs_builddir; \ + export abs_top_builddir; \ + export LC_ALL; export LANG; \ + NM=$(NM); export NM; +LOG_COMPILER = $(abs_srcdir)/../tests/test-wrapper.sh \ + $(abs_top_builddir)/libdw:$(abs_top_builddir)/backends:$(abs_top_builddir)/libelf:$(abs_top_builddir)/libasm installcheck-local: $(MAKE) $(AM_MAKEFLAGS) \ - TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT)' check-TESTS + TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" + LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS endif !STANDALONE if BUILD_STATIC diff --git a/dwarflint/tests/run-DW_AT-later-version.sh b/dwarflint/tests/run-DW_AT-later-version.sh index d662502b..57fef112 100755 --- a/dwarflint/tests/run-DW_AT-later-version.sh +++ b/dwarflint/tests/run-DW_AT-later-version.sh @@ -19,9 +19,9 @@ srcdir=$srcdir/tests -testfiles DW_AT-later-version +testfiles tests/DW_AT-later-version -testrun_compare ./dwarflint --nognu DW_AT-later-version <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --nognu DW_AT-later-version <<EOF warning: .debug_abbrev: abbr. 0x11, attr. endianity: attribute from later DWARF version. warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_info: DIE 0x29: variable has decl_file, but NOT decl_line diff --git a/dwarflint/tests/run-DW_AT_high_pc-below.sh b/dwarflint/tests/run-DW_AT_high_pc-below.sh index 4b4d6eac..15567050 100755 --- a/dwarflint/tests/run-DW_AT_high_pc-below.sh +++ b/dwarflint/tests/run-DW_AT_high_pc-below.sh @@ -21,8 +21,8 @@ srcdir=$srcdir/tests # Hand-crafted file that has 0,0 pair in aranges presented before the # actual end of the table. -testfiles DW_AT_high_pc-below +testfiles tests/DW_AT_high_pc-below -testrun_compare ./dwarflint --check=@low DW_AT_high_pc-below <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low DW_AT_high_pc-below <<EOF warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc. EOF diff --git a/dwarflint/tests/run-DW_AT_high_pc-relative.sh b/dwarflint/tests/run-DW_AT_high_pc-relative.sh index 8757ba0e..b2925665 100755 --- a/dwarflint/tests/run-DW_AT_high_pc-relative.sh +++ b/dwarflint/tests/run-DW_AT_high_pc-relative.sh @@ -21,8 +21,8 @@ srcdir=$srcdir/tests # Hand-crafted file that has 0,0 pair in aranges presented before the # actual end of the table. -testfiles DW_AT_high_pc-relative +testfiles tests/DW_AT_high_pc-relative -testrun_compare ./dwarflint --check=@low DW_AT_high_pc-relative <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low DW_AT_high_pc-relative <<EOF No errors EOF diff --git a/dwarflint/tests/run-aranges_terminate_early.sh b/dwarflint/tests/run-aranges_terminate_early.sh index 43b2ec2c..40753239 100755 --- a/dwarflint/tests/run-aranges_terminate_early.sh +++ b/dwarflint/tests/run-aranges_terminate_early.sh @@ -21,14 +21,14 @@ srcdir=$srcdir/tests # Hand-crafted file that has 0,0 pair in aranges presented before the # actual end of the table. -testfiles aranges_terminate_early +testfiles tests/aranges_terminate_early -testrun_compare ./dwarflint --strict aranges_terminate_early <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --strict aranges_terminate_early <<EOF warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes. warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CU DIEs, but not with aranges. EOF -testrun_compare ./dwarflint --check=check_debug_aranges --strict aranges_terminate_early <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_debug_aranges --strict aranges_terminate_early <<EOF warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes. warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CU DIEs, but not with aranges. EOF diff --git a/dwarflint/tests/run-bad.sh b/dwarflint/tests/run-bad.sh index ebe3873a..255eca90 100755 --- a/dwarflint/tests/run-bad.sh +++ b/dwarflint/tests/run-bad.sh @@ -19,16 +19,16 @@ srcdir=$srcdir/tests -testfiles hello.bad-1 hello.bad-3 empty-1 \ - garbage-1 garbage-2 garbage-3 garbage-4 \ - garbage-5 garbage-6 garbage-7 garbage-8 \ - garbage-9 garbage-10 garbage-11 garbage-12 +testfiles tests/hello.bad-1 tests/hello.bad-3 tests/empty-1 \ + tests/garbage-1 tests/garbage-2 tests/garbage-3 tests/garbage-4 \ + tests/garbage-5 tests/garbage-6 tests/garbage-7 tests/garbage-8 \ + tests/garbage-9 tests/garbage-10 tests/garbage-11 tests/garbage-12 -testrun_compare ./dwarflint hello.bad-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint hello.bad-1 <<EOF error: .debug_info: DIE 0x83: abbrev section at 0x0 doesn't contain code 83. EOF -testrun_compare ./dwarflint --check=@low hello.bad-3 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low hello.bad-3 <<EOF error: .debug_info: DIE 0x2d: This DIE had children, but no DW_AT_sibling attribute. error: .debug_info: DIE 0xb: This DIE had children, but no DW_AT_sibling attribute. error: .debug_info: DIE 0x91: toplevel DIE chain contains more than one DIE. @@ -38,39 +38,39 @@ error: .debug_info: DIE 0xa4: toplevel DIE chain contains more than one DIE. error: .debug_info: DIE 0xab: toplevel DIE chain contains more than one DIE. EOF -testrun_compare ./dwarflint empty-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint empty-1 <<EOF warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_line: table 0: no CU uses this line table. error: .debug_info: DIE 0x29, attr. decl_file: references .debug_line table, but CU DIE lacks DW_AT_stmt_list. EOF -testrun_compare ./dwarflint garbage-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-1 <<EOF error: Broken ELF: offset out of range. error: .debug_abbrev: data not found. error: .debug_info: data not found. EOF -testrun_compare ./dwarflint garbage-2 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-2 <<EOF error: .debug_info: CU 0: toplevel DIE must be either compile_unit or partial_unit. error: .debug_info: DIE 0xab: DIE chain not terminated with null entry. EOF -testrun_compare ./dwarflint --check=@low garbage-3 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low garbage-3 <<EOF error: .debug_abbrev: abbr. attribute 0xc: invalid attribute code 0. EOF -testrun_compare ./dwarflint garbage-4 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-4 <<EOF error: .debug_info: DIE 0x6c: this DIE claims that its sibling is 0x80000085 but it's actually 0x85. error: .debug_info: DIE 0xab: DIE chain not terminated with null entry. EOF -testrun_compare ./dwarflint garbage-5 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-5 <<EOF error: .debug_info: DIE 0xab: DIE chain not terminated with null entry. error: .debug_line: offset 0x3e: not enough data to read an opcode of length 5. error: .debug_info: DIE 0xb, attr. stmt_list: unresolved reference to .debug_line table 0x0. EOF -testrun_compare ./dwarflint garbage-6 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-6 <<EOF error: .debug_info: CU 0: invalid address size: 9 (only 4 or 8 allowed). error: .debug_info: couldn't load CU headers for processing .debug_abbrev; assuming latest DWARF flavor. error: .debug_abbrev: abbr. 0x0, attr. stmt_list: attribute with invalid form DW_FORM_data4. @@ -78,31 +78,31 @@ error: .debug_abbrev: abbr. 0x13, attr. frame_base: attribute with invalid form error: .debug_abbrev: abbr. 0x2c, attr. location: attribute with invalid form DW_FORM_block1. EOF -testrun_compare ./dwarflint garbage-7 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-7 <<EOF warning: .debug_abbrev: abbr. attribute 0x7e: invalid or unknown name 0x703. error: .debug_abbrev: abbr. 0x7a, attr. 0x703: invalid form 0x0. error: .debug_abbrev: missing zero to mark end-of-table. EOF -testrun_compare ./dwarflint garbage-8 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-8 <<EOF error: .debug_info: DIE 0x6c, attr. sibling: has a value of 0. error: .debug_info: DIE 0x6c: This DIE had children, but no DW_AT_sibling attribute. error: .debug_info: DIE 0xab: DIE chain not terminated with null entry. EOF -testrun_compare ./dwarflint garbage-9 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-9 <<EOF error: .debug_info: DIE 0x84, attr. type: invalid reference outside the CU: 0xef00ab. error: .debug_info: DIE 0x6c: is the last sibling in chain, but has a DW_AT_sibling attribute. error: .debug_info: DIE 0xab: DIE chain not terminated with null entry. EOF -testrun_compare ./dwarflint garbage-10 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-10 <<EOF warning: .rela 0xc of .debug_info: DIE 0xb, attr. producer: relocation formed using STT_SECTION symbol with non-zero value. error: .rela 0x11 of .debug_info: DIE 0xb, attr. comp_dir: couldn't obtain symbol #7208969: invalid section index. warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc. EOF -testrun_compare ./dwarflint garbage-11 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-11 <<EOF error: .rela 0x600 of .debug_info: invalid relocation 2560 (<INVALID RELOC>). error: .rela 0xc00 of .debug_info: invalid relocation 2560 (<INVALID RELOC>). error: .rela 0x1100 of .debug_info: invalid relocation 2560 (<INVALID RELOC>). @@ -119,7 +119,7 @@ error: .debug_line: table 0: header claims that it has a size of 542, but in fac error: .debug_info: DIE 0xb, attr. stmt_list: unresolved reference to .debug_line table 0x0. EOF -testrun_compare ./dwarflint garbage-12 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint garbage-12 <<EOF error: Broken ELF: invalid section header. error: .debug_abbrev: data not found. error: .debug_info: data not found. diff --git a/dwarflint/tests/run-check_debug_info_refs.sh b/dwarflint/tests/run-check_debug_info_refs.sh index 4e790b88..74c68571 100755 --- a/dwarflint/tests/run-check_debug_info_refs.sh +++ b/dwarflint/tests/run-check_debug_info_refs.sh @@ -19,19 +19,21 @@ srcdir=$srcdir/tests -testfiles check_debug_info_refs-{1,2} +testfiles tests/check_debug_info_refs-1 -testrun_compare ./dwarflint --check=check_debug_info_refs check_debug_info_refs-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_debug_info_refs check_debug_info_refs-1 <<EOF error: .debug_aranges: table 48 (CU DIE 95): there has already been arange section for this CU. warning: .debug_info: CU 0: no aranges table is associated with this CU. EOF -testrun_compare ./dwarflint --check=check_debug_info_refs check_debug_info_refs-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_debug_info_refs check_debug_info_refs-1 <<EOF error: .debug_aranges: table 48 (CU DIE 95): there has already been arange section for this CU. warning: .debug_info: CU 0: no aranges table is associated with this CU. EOF -testrun_compare ./dwarflint --check=check_debug_info_refs check_debug_info_refs-2 <<EOF +testfiles tests/check_debug_info_refs-2 + +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_debug_info_refs check_debug_info_refs-2 <<EOF warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_info: CU 0: no aranges table is associated with this CU. EOF diff --git a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh index c5622872..1a5bc5aa 100755 --- a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh +++ b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh @@ -19,9 +19,9 @@ srcdir=$srcdir/tests -testfiles crc7.ko.debug +testfiles tests/crc7.ko.debug -testrun_compare ./dwarflint --dups=0 --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --dups=0 --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF warning: .debug_info: DIE 0x40f1: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_info: CU 16614: no aranges table is associated with this CU. warning: .debug_info: DIE 0x3d21: Redeclaration of variable 'console_printk', originally seen at DIE 37f3. diff --git a/dwarflint/tests/run-check_range_out_of_scope.sh b/dwarflint/tests/run-check_range_out_of_scope.sh index fa3b2de2..902fcf3d 100755 --- a/dwarflint/tests/run-check_range_out_of_scope.sh +++ b/dwarflint/tests/run-check_range_out_of_scope.sh @@ -19,9 +19,9 @@ srcdir=$srcdir/tests -testfiles check_range_out_of_scope-1 +testfiles tests/check_range_out_of_scope-1 -testrun_compare ./dwarflint --check=check_range_out_of_scope check_range_out_of_scope-1 <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_range_out_of_scope check_range_out_of_scope-1 <<EOF error: .debug_info: DIE 0x8b: PC range [0x4004d0, 0x4004d1) is not a sub-range of containing scope. error: .debug_info: DIE 0x7a: in this context: [0x4004d4, 0x4004db) EOF diff --git a/dwarflint/tests/run-check_self_referential_die.sh b/dwarflint/tests/run-check_self_referential_die.sh index 7fe83c63..b1ce9c1e 100755 --- a/dwarflint/tests/run-check_self_referential_die.sh +++ b/dwarflint/tests/run-check_self_referential_die.sh @@ -19,8 +19,8 @@ srcdir=$srcdir/tests -testfiles check_self_referential_die +testfiles tests/check_self_referential_die -testrun_compare ./dwarflint --check=check_self_referential_die --ignore-bloat check_self_referential_die <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=check_self_referential_die --ignore-bloat check_self_referential_die <<EOF warning: .debug_info: DIE 0x19dc2: structure_type attribute containing_type references DIE itself. EOF diff --git a/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh b/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh index b189bee4..9edb4a00 100755 --- a/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh +++ b/dwarflint/tests/run-debug_abbrev-duplicate-attribute.sh @@ -19,9 +19,9 @@ srcdir=$srcdir/tests -testfiles debug_abbrev-duplicate-attribute +testfiles tests/debug_abbrev-duplicate-attribute -testrun_compare ./dwarflint debug_abbrev-duplicate-attribute <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint debug_abbrev-duplicate-attribute <<EOF error: .debug_abbrev: abbr. attribute 0x19: duplicate attribute byte_size (first was at 0x13). error: .debug_abbrev: abbr. attribute 0x1b: duplicate attribute decl_file (first was at 0x15). error: .debug_abbrev: abbr. attribute 0x1d: duplicate attribute decl_line (first was at 0x17). diff --git a/dwarflint/tests/run-libdl-2.12.so.debug.sh b/dwarflint/tests/run-libdl-2.12.so.debug.sh index f9f33635..977e7b74 100755 --- a/dwarflint/tests/run-libdl-2.12.so.debug.sh +++ b/dwarflint/tests/run-libdl-2.12.so.debug.sh @@ -19,10 +19,10 @@ srcdir=$srcdir/tests -testfiles libdl-2.12.so.debug +testfiles tests/libdl-2.12.so.debug # Here we test that dwarflint can tolerate invalid attribute name. -testrun_compare ./dwarflint --check=@low --nognu --ignore-bloat libdl-2.12.so.debug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low --nognu --ignore-bloat libdl-2.12.so.debug <<EOF warning: .debug_abbrev: abbr. attribute 0xbe: invalid or unknown name 0x2107. warning: .debug_abbrev: abbr. attribute 0x330: invalid or unknown name 0x2107. warning: .debug_abbrev: abbr. attribute 0xa28: invalid or unknown name 0x2107. @@ -35,7 +35,7 @@ warning: .debug_info: CU 56524: no aranges table is associated with this CU. EOF # Here we test proper support for DW_AT_GNU_vector -testrun_compare ./dwarflint --check=@low --ignore-bloat libdl-2.12.so.debug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=@low --ignore-bloat libdl-2.12.so.debug <<EOF warning: .debug_info: DIE 0xd9a8: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_info: DIE 0xdcd7: DW_AT_low_pc value not below DW_AT_high_pc. warning: .debug_info: CU 55709: no aranges table is associated with this CU. diff --git a/dwarflint/tests/run-location-leaks.sh b/dwarflint/tests/run-location-leaks.sh index a8eb63f9..b2213bfa 100755 --- a/dwarflint/tests/run-location-leaks.sh +++ b/dwarflint/tests/run-location-leaks.sh @@ -19,9 +19,9 @@ srcdir=$srcdir/tests -testfiles location-leaks +testfiles tests/location-leaks -testrun_compare ./dwarflint location-leaks <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint location-leaks <<EOF warning: .debug_loc: loclist 0x38: entry covers no range. error: .debug_info: DIE 0x62: attribute \`location': PC range [0x400495, 0x40049a) outside containing scope. error: .debug_info: DIE 0x51: in this context: [0x400498, 0x4004b2). diff --git a/dwarflint/tests/run-nodebug.sh b/dwarflint/tests/run-nodebug.sh index 1b67a706..1335794c 100755 --- a/dwarflint/tests/run-nodebug.sh +++ b/dwarflint/tests/run-nodebug.sh @@ -19,33 +19,33 @@ srcdir=$srcdir/tests -testfiles nodebug null.o +testfiles tests/nodebug tests/null.o -testrun_compare ./dwarflint nodebug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint nodebug <<EOF error: .debug_abbrev: data not found. error: .debug_info: data not found. EOF -testrun_compare ./dwarflint -i nodebug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint -i nodebug <<EOF No errors EOF -testrun_compare ./dwarflint -q -i nodebug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint -q -i nodebug <<EOF EOF # This has nothing to do with the nodebug test, but we can just as # well stick it in there. -testrun_compare ./dwarflint --check=oentuh -q nodebug <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=oentuh -q nodebug <<EOF warning: the rule \`oentuh' never matched. EOF # ... and since we are testing this here, also check that we don't get # this message in situations where it makes no sense. -LANG=C testrun_compare ./dwarflint --check=oentuh -q noeuht <<EOF +LANG=C testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=oentuh -q noeuht <<EOF error: Cannot open input file: No such file or directory. EOF -LANG=C testrun_compare ./dwarflint --check=oentuh -q noeuht nodebug <<EOF +LANG=C testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=oentuh -q noeuht nodebug <<EOF noeuht: error: Cannot open input file: No such file or directory. @@ -54,7 +54,7 @@ nodebug: warning: the rule \`oentuh' never matched. EOF -LANG=C testrun_compare ./dwarflint --check=oentuh -q nodebug nodebug <<EOF +LANG=C testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --check=oentuh -q nodebug nodebug <<EOF nodebug: @@ -62,12 +62,12 @@ nodebug: warning: the rule \`oentuh' never matched. EOF -testrun_compare ./dwarflint null.o <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint null.o <<EOF warning: .debug_abbrev: [0x0, 0x1): unnecessary padding with zero bytes. warning: .debug_abbrev: no abbreviations. error: .debug_info: data not found. EOF -testrun_compare ./dwarflint --ignore-bloat --nodebug:ignore null.o <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --ignore-bloat --nodebug:ignore null.o <<EOF No errors EOF diff --git a/dwarflint/tests/run-test-all-dies-it.sh b/dwarflint/tests/run-test-all-dies-it.sh index fdcf63fd..5d21edb4 100755 --- a/dwarflint/tests/run-test-all-dies-it.sh +++ b/dwarflint/tests/run-test-all-dies-it.sh @@ -19,12 +19,12 @@ srcdir=$srcdir/tests -testfiles hello.bad-2 +testfiles tests/hello.bad-2 -../src/readelf -winfo ./tests/test-all-dies-it | grep '^ \[ *[0-9a-f]*\]' | +../../src/readelf -winfo ../tests/test-all-dies-it | grep '^ \[ *[0-9a-f]*\]' | sed 's/ \[ *\([0-9a-f]\+\).*/0x\1/' | - testrun_compare ./tests/test-all-dies-it ./tests/test-all-dies-it + testrun_compare ../tests/test-all-dies-it ../tests/test-all-dies-it -testrun_compare ./tests/test-all-dies-it hello.bad-2 <<EOF +testrun_compare ../tests/test-all-dies-it hello.bad-2 <<EOF 0xb EOF diff --git a/dwarflint/tests/run-upper.sh b/dwarflint/tests/run-upper.sh index d1ed96ac..e85b2277 100755 --- a/dwarflint/tests/run-upper.sh +++ b/dwarflint/tests/run-upper.sh @@ -42,7 +42,7 @@ srcdir=$srcdir/tests # } # # This would crash the low-level check_debug_info in the past. -testfiles upper +testfiles tests/upper -testrun_compare ./dwarflint --quiet --check=@low upper <<EOF +testrun_compare ${abs_top_builddir}/dwarflint/dwarflint --quiet --check=@low upper <<EOF EOF diff --git a/tests/run-dwarflint-self.sh b/tests/run-dwarflint-self.sh new file mode 100755 index 00000000..6796a544 --- /dev/null +++ b/tests/run-dwarflint-self.sh @@ -0,0 +1,46 @@ +#! /bin/sh +# Copyright (C) 2009, 2010 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. $srcdir/test-subr.sh + +status=0 +runtest() +{ + for file; do + if [ -f $file ]; then + testrun ../dwarflint/dwarflint -q -i --check=@low $file || + { echo "*** failure in $file"; status=1; } + fi + done +} + +runtest ../src/addr2line +runtest ../src/dwarfcmp +runtest ../src/elfcmp +runtest ../src/elflint +runtest ../src/findtextrel +runtest ../src/ld +runtest ../src/nm +runtest ../src/objdump +runtest ../src/readelf +runtest ../src/size +runtest ../src/strip +runtest ../src/unstrip +runtest ../*/*.so +runtest ../dwarflint/dwarflint + +exit $status diff --git a/tests/test-subr.sh b/tests/test-subr.sh index a765db63..0856ac02 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -47,8 +47,9 @@ tempfiles() testfiles() { for file; do - bunzip2 -c ${abs_srcdir}/${file}.bz2 > ${file} || exit 77 - remove_files="$remove_files $file" + file_name=$(basename $file) + bunzip2 -c ${abs_srcdir}/${file}.bz2 > $file_name || exit 77 + remove_files="$remove_files $file_name" done } diff --git a/tests/test-wrapper.sh b/tests/test-wrapper.sh index 09b4d49f..376b03e4 100755 --- a/tests/test-wrapper.sh +++ b/tests/test-wrapper.sh @@ -55,6 +55,8 @@ case "$1" in LD_LIBRARY_PATH="${libdir}:${libdir}/elfutils$old_path" fi export LD_LIBRARY_PATH + export elfutils_testrun program_transform_name + export elfutils_tests_rpath ;; esac |