From 86be792c727ea0c09d687e76d98739a5af23a803 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 26 Apr 2013 23:44:25 +0200 Subject: [PATCH] Enable automake parallel-tests for make check. The parallel-tests option was introduced in automake 1.11 and is the default since automake 1.13. All tests can now be ran in parallel with make check -j. To enable this all tests are ran in their own temporary directory so they don't stomp on each others input or output files. On my machine (4 cores) make check takes ~20 seconds, but now with make check -j8 takes only ~4 seconds. ChangeLog: * configure.ac (AM_INIT_AUTOMAKE): Request parallel-tests. tests/ChangeLog: * Makefile.am (installed_TESTS_ENVIRONMENT): Export environment, remove wrapper. (TESTS_ENVIRONMENT): Likewise. (installed_LOG_COMPILER): New variable defining wrapper. (LOG_COMPILER): Likewise. * run-*.sh: Fixup location of input and output files. * test-subr.sh: Create test_dir, pushd to execute test in. (trap): Remove test_dir. (testfiles): Use abs_srcdir. (installed_testrun): Match on abs_builddir or abs_top_builddir. (self_test_files): Adjust path. Signed-off-by: Mark Wielaard --- ChangeLog | 4 +++ configure.ac | 2 +- tests/ChangeLog | 14 +++++++++++ tests/Makefile.am | 39 ++++++++++++++++++++--------- tests/run-addrname-test.sh | 20 +++++++-------- tests/run-addrscopes.sh | 4 +-- tests/run-alldts.sh | 4 +-- tests/run-allfcts.sh | 2 +- tests/run-allregs.sh | 2 +- tests/run-arextract.sh | 6 ++--- tests/run-arsymtest.sh | 4 +-- tests/run-bug1-test.sh | 4 +-- tests/run-disasm-x86-64.sh | 2 +- tests/run-disasm-x86.sh | 2 +- tests/run-dwarf-getmacros.sh | 4 +-- tests/run-dwarf-getstring.sh | 2 +- tests/run-dwfl-addr-sect.sh | 4 +-- tests/run-dwfl-bug-offline-rel.sh | 2 +- tests/run-dwfl-report-elf-align.sh | 2 +- tests/run-dwfllines.sh | 6 ++--- tests/run-dwflsyms.sh | 12 ++++----- tests/run-early-offscn.sh | 2 +- tests/run-ecp-test.sh | 2 +- tests/run-ecp-test2.sh | 2 +- tests/run-elf_cntl_gelf_getshdr.sh | 6 ++--- tests/run-elflint-self.sh | 2 +- tests/run-elflint-test.sh | 12 ++++----- tests/run-find-prologues.sh | 18 ++++++------- tests/run-funcscopes.sh | 2 +- tests/run-get-aranges.sh | 2 +- tests/run-get-files.sh | 2 +- tests/run-get-lines.sh | 2 +- tests/run-get-pubnames.sh | 2 +- tests/run-line2addr.sh | 10 ++++---- tests/run-low_high_pc.sh | 10 ++++---- tests/run-macro-test.sh | 4 +-- tests/run-native-test.sh | 4 +-- tests/run-nm-self.sh | 2 +- tests/run-prelink-addr-test.sh | 24 +++++++++--------- tests/run-ranlib-test.sh | 2 +- tests/run-ranlib-test2.sh | 2 +- tests/run-readelf-aranges.sh | 4 +-- tests/run-readelf-d.sh | 2 +- tests/run-readelf-dwz-multi.sh | 6 ++--- tests/run-readelf-gdb_index.sh | 4 +-- tests/run-readelf-line.sh | 4 +-- tests/run-readelf-loc.sh | 6 ++--- tests/run-readelf-macro.sh | 2 +- tests/run-readelf-mixed-corenote.sh | 6 ++--- tests/run-readelf-s.sh | 20 +++++++-------- tests/run-readelf-self.sh | 2 +- tests/run-readelf-test1.sh | 2 +- tests/run-readelf-test2.sh | 2 +- tests/run-readelf-test3.sh | 2 +- tests/run-readelf-test4.sh | 2 +- tests/run-readelf-twofiles.sh | 2 +- tests/run-readelf-vmcoreinfo.sh | 2 +- tests/run-rerequest_tag.sh | 4 +-- tests/run-show-abbrev.sh | 2 +- tests/run-show-die-info.sh | 2 +- tests/run-strings-test.sh | 2 +- tests/run-strip-groups.sh | 8 +++--- tests/run-strip-reloc.sh | 16 ++++++------ tests/run-strip-test.sh | 12 ++++----- tests/run-test-archive64.sh | 2 +- tests/run-test-flag-nobits.sh | 2 +- tests/run-typeiter.sh | 2 +- tests/run-unstrip-n.sh | 4 +-- tests/run-unstrip-test.sh | 8 +++--- tests/test-subr.sh | 23 +++++++++++------ 70 files changed, 224 insertions(+), 184 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26b41c274..1fdcb588e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-04-26 Mark Wielaard + + * configure.ac (AM_INIT_AUTOMAKE): Request parallel-tests. + 2013-04-25 Mark Wielaard * .gitignore: Add config/test-driver as installed by automake 1.13. diff --git a/configure.ac b/configure.ac index fd30c27ff..d7c75ce02 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2012 Red Hat, Inc.]) AC_PREREQ(2.63) dnl Minimum Autoconf version required. dnl We use GNU make extensions; automake 1.10 defaults to -Wportability. -AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip]) +AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests]) AM_MAINTAINER_MODE dnl Unique ID for this build. diff --git a/tests/ChangeLog b/tests/ChangeLog index 2a065ee8b..2cbe8012c 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,17 @@ +2013-04-26 Mark Wielaard + + * Makefile.am (installed_TESTS_ENVIRONMENT): Export environment, + remove wrapper. + (TESTS_ENVIRONMENT): Likewise. + (installed_LOG_COMPILER): New variable defining wrapper. + (LOG_COMPILER): Likewise. + * run-*.sh: Fixup location of input and output files. + * test-subr.sh: Create test_dir, pushd to execute test in. + (trap): Remove test_dir. + (testfiles): Use abs_srcdir. + (installed_testrun): Match on abs_builddir or abs_top_builddir. + (self_test_files): Adjust path. + 2013-04-24 Mark Wielaard * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. diff --git a/tests/Makefile.am b/tests/Makefile.am index e10da8a4b..4b5770359 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -201,26 +201,41 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile-dwfl-report-elf-align-shlib.so.bz2 if USE_VALGRIND -valgrind_cmd="valgrind -q --trace-children=yes --error-exitcode=1 --run-libc-freeres=no" +valgrind_cmd='valgrind -q --trace-children=yes --error-exitcode=1 --run-libc-freeres=no' endif -installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ - bindir=$(DESTDIR)$(bindir) \ - LC_ALL=C LANG=C \ - VALGRIND_CMD=$(valgrind_cmd) \ - $(srcdir)/test-wrapper.sh \ - installed $(tests_rpath) \ - $(program_transform_name) + +installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \ + bindir=$(DESTDIR)$(bindir); \ + LC_ALL=C; LANG=C; \ + VALGRIND_CMD=$(valgrind_cmd); \ + 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; export VALGRIND_CMD; +installed_LOG_COMPILER = $(abs_srcdir)/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 = LC_ALL=C LANG=C VALGRIND_CMD=$(valgrind_cmd) \ - $(srcdir)/test-wrapper.sh \ - ../libdw:../backends:../libelf:../libasm +TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \ + 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; export VALGRIND_CMD; +LOG_COMPILER = $(abs_srcdir)/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 MUDFLAP diff --git a/tests/run-addrname-test.sh b/tests/run-addrname-test.sh index 99abf9dbc..9351fb2a0 100755 --- a/tests/run-addrname-test.sh +++ b/tests/run-addrname-test.sh @@ -19,7 +19,7 @@ testfiles testfile34 testfile38 testfile41 testfile49 -testrun_compare ../src/addr2line -f -e testfile34 \ +testrun_compare ${abs_top_builddir}/src/addr2line -f -e testfile34 \ 0x08048074 0x08048075 0x08048076 \ 0x08049078 0x08048080 0x08049080 <<\EOF foo @@ -36,7 +36,7 @@ _end ??:0 EOF -testrun_compare ../src/addr2line -S -e testfile38 0x02 0x10a 0x211 0x31a <<\EOF +testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile38 0x02 0x10a 0x211 0x31a <<\EOF t1_global_outer+0x2 ??:0 t2_global_symbol+0x2 @@ -47,7 +47,7 @@ t3_global_after_0+0x1 ??:0 EOF -testrun_compare ../src/addr2line -S -e testfile41 0x1 0x104 <<\EOF +testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile41 0x1 0x104 <<\EOF small_global_at_large_global+0x1 ??:0 small_global_first_at_large_global+0x1 @@ -69,7 +69,7 @@ cat > testmaps < good.regs testfiles "$@" - for f; do testrun_compare ./allregs -e $f < good.regs; done + for f; do testrun_compare ${abs_builddir}/allregs -e $f < good.regs; done test_cleanup } diff --git a/tests/run-arextract.sh b/tests/run-arextract.sh index 668b36366..44f4a525b 100755 --- a/tests/run-arextract.sh +++ b/tests/run-arextract.sh @@ -20,14 +20,14 @@ tempfiles arextract.test -archive=../libelf/libelf.a +archive=${abs_top_builddir}/libelf/libelf.a if test -f $archive; then # The file is really available (i.e., no shared-only built). echo -n "Extracting symbols... $ac_c" # The files we are looking at. - for f in ../libelf/*.o; do - testrun ./arextract $archive `basename $f` arextract.test || exit 1 + for f in ${abs_top_builddir}/libelf/*.o; do + testrun ${abs_builddir}/arextract $archive `basename $f` arextract.test || exit 1 cmp $f arextract.test || { echo "Extraction of $1 failed" exit 1 diff --git a/tests/run-arsymtest.sh b/tests/run-arsymtest.sh index 89c782198..dc016e1fe 100755 --- a/tests/run-arsymtest.sh +++ b/tests/run-arsymtest.sh @@ -18,7 +18,7 @@ . $srcdir/test-subr.sh -lib=../libelf/libelf.a +lib=${abs_top_builddir}/libelf/libelf.a okfile=arsymtest.ok tmpfile=arsymtest.tmp testfile=arsymtest.test @@ -33,7 +33,7 @@ if test -f $lib; then sort > $okfile # Now run our program using libelf. - testrun ./arsymtest $lib $tmpfile || exit 1 + testrun ${abs_builddir}/arsymtest $lib $tmpfile || exit 1 sort $tmpfile > $testfile # Compare the outputs. diff --git a/tests/run-bug1-test.sh b/tests/run-bug1-test.sh index f6510518e..1e78a18ce 100755 --- a/tests/run-bug1-test.sh +++ b/tests/run-bug1-test.sh @@ -19,7 +19,7 @@ testfiles testfile28 testfile28.rdwr -testrun ./rdwrmmap testfile28 +testrun ${abs_builddir}/rdwrmmap testfile28 cmp testfile28 testfile28.rdwr @@ -27,7 +27,7 @@ test_cleanup testfiles testfile29 testfile29.rdwr -testrun ./rdwrmmap testfile29 +testrun ${abs_builddir}/rdwrmmap testfile29 cmp testfile29 testfile29.rdwr diff --git a/tests/run-disasm-x86-64.sh b/tests/run-disasm-x86-64.sh index 96e14d911..a6be62bbc 100755 --- a/tests/run-disasm-x86-64.sh +++ b/tests/run-disasm-x86-64.sh @@ -23,6 +23,6 @@ case "`uname -m`" in tempfiles testfile45.o testfiles testfile45.S testfile45.expect gcc -m64 -c -o testfile45.o testfile45.S - testrun_compare ../src/objdump -d testfile45.o < testfile45.expect + testrun_compare ${abs_top_builddir}/src/objdump -d testfile45.o < testfile45.expect ;; esac diff --git a/tests/run-disasm-x86.sh b/tests/run-disasm-x86.sh index 399664c8a..28a3df740 100755 --- a/tests/run-disasm-x86.sh +++ b/tests/run-disasm-x86.sh @@ -23,6 +23,6 @@ case "`uname -m`" in tempfiles testfile44.o testfiles testfile44.S testfile44.expect gcc -m32 -c -o testfile44.o testfile44.S - testrun_compare ../src/objdump -d testfile44.o < testfile44.expect + testrun_compare ${abs_top_builddir}/src/objdump -d testfile44.o < testfile44.expect ;; esac diff --git a/tests/run-dwarf-getmacros.sh b/tests/run-dwarf-getmacros.sh index b748b0f5b..ddb58e83e 100755 --- a/tests/run-dwarf-getmacros.sh +++ b/tests/run-dwarf-getmacros.sh @@ -19,7 +19,7 @@ testfiles testfile51 -testrun_compare ./dwarf-getmacros testfile51 0xb <<\EOF +testrun_compare ${abs_builddir}/dwarf-getmacros testfile51 0xb <<\EOF __STDC__ 1 __STDC_HOSTED__ 1 __GNUC__ 4 @@ -152,7 +152,7 @@ __DECIMAL_BID_FORMAT__ 1 macro1 ble EOF -testrun_compare ./dwarf-getmacros testfile51 0x84 <<\EOF +testrun_compare ${abs_builddir}/dwarf-getmacros testfile51 0x84 <<\EOF __STDC__ 1 __STDC_HOSTED__ 1 __GNUC__ 4 diff --git a/tests/run-dwarf-getstring.sh b/tests/run-dwarf-getstring.sh index c765f75a5..f18f62820 100755 --- a/tests/run-dwarf-getstring.sh +++ b/tests/run-dwarf-getstring.sh @@ -19,7 +19,7 @@ testfiles testfile11 -testrun_compare ./dwarf-getstring testfile11 <<\EOF +testrun_compare ${abs_builddir}/dwarf-getstring testfile11 <<\EOF _ZNSbIwSt11char_traitsIwESaIwEE13_S_copy_charsEPwS3_S3_ itimerspec _G_int32_t diff --git a/tests/run-dwfl-addr-sect.sh b/tests/run-dwfl-addr-sect.sh index 85424fde6..80da0081a 100755 --- a/tests/run-dwfl-addr-sect.sh +++ b/tests/run-dwfl-addr-sect.sh @@ -19,13 +19,13 @@ testfiles testfile43 testfile50 -testrun_compare ./dwfl-addr-sect -e testfile43 0x64 0x8 0x98 <<\EOF +testrun_compare ${abs_builddir}/dwfl-addr-sect -e testfile43 0x64 0x8 0x98 <<\EOF address 0x64 => module "" section 4 + 0 address 0x8 => module "" section 1 + 0x8 address 0x98 => module "" section 7 + 0 EOF -testrun_compare ./dwfl-addr-sect -e testfile50 0x1 <<\EOF +testrun_compare ${abs_builddir}/dwfl-addr-sect -e testfile50 0x1 <<\EOF address 0x1 => module "" section 1 + 0x1 EOF diff --git a/tests/run-dwfl-bug-offline-rel.sh b/tests/run-dwfl-bug-offline-rel.sh index 3e19a5870..fa476c4b4 100755 --- a/tests/run-dwfl-bug-offline-rel.sh +++ b/tests/run-dwfl-bug-offline-rel.sh @@ -19,7 +19,7 @@ testfiles testfile36 testfile36.debug -testrun_compare ./dwflmodtest -e testfile36 <<\EOF +testrun_compare ${abs_builddir}/dwflmodtest -e testfile36 <<\EOF module: 00000000..00002308 testfile36 (null) module: 00000000 DWARF 0 (no error) module: 00000000..00002308 testfile36 testfile36.debug diff --git a/tests/run-dwfl-report-elf-align.sh b/tests/run-dwfl-report-elf-align.sh index d032aba93..384975324 100755 --- a/tests/run-dwfl-report-elf-align.sh +++ b/tests/run-dwfl-report-elf-align.sh @@ -38,7 +38,7 @@ testfiles testfile-dwfl-report-elf-align-shlib.so # 0x7f3560c92585 = 0x7f3560c92000 + 0x585 # where 0x585 is any address inside the shlib function: 0x57c .. 0x57c + 11 -1 -testrun ./dwfl-report-elf-align ./testfile-dwfl-report-elf-align-shlib.so \ +testrun ${abs_builddir}/dwfl-report-elf-align ./testfile-dwfl-report-elf-align-shlib.so \ 0x7f3560c92000 0x7f3560c92585 shlib exit 0 diff --git a/tests/run-dwfllines.sh b/tests/run-dwfllines.sh index df7d16ff8..b384de09e 100755 --- a/tests/run-dwfllines.sh +++ b/tests/run-dwfllines.sh @@ -19,7 +19,7 @@ testfiles testfile testfile2 -testrun_compare ./dwfllines -e testfile <<\EOF +testrun_compare ${abs_builddir}/dwfllines -e testfile <<\EOF mod: CU: [b] m.c 0 0x804842c /home/drepper/gnu/new-bu/build/ttt/m.c:5:0 time: 0, len: 0, idx: 0, b: 1, e: 0, pe: 0, eb: 0, block: 0, isa: 0, disc: 0 @@ -51,7 +51,7 @@ mod: CU: [15fc] f.c time: 0, len: 0, idx: 0, b: 1, e: 1, pe: 0, eb: 0, block: 0, isa: 0, disc: 0 EOF -testrun_compare ./dwfllines -e testfile2 <<\EOF +testrun_compare ${abs_builddir}/dwfllines -e testfile2 <<\EOF mod: CU: [b] b.c 0 0x10000470 /shoggoth/drepper/b.c:4:0 time: 0, len: 0, idx: 0, b: 1, e: 0, pe: 0, eb: 0, block: 0, isa: 0, disc: 0 @@ -83,6 +83,6 @@ mod: CU: [9e4] m.c time: 0, len: 0, idx: 0, b: 1, e: 1, pe: 0, eb: 0, block: 0, isa: 0, disc: 0 EOF -testrun_on_self_quiet ./dwfllines -e +testrun_on_self_quiet ${abs_builddir}/dwfllines -e exit 0 diff --git a/tests/run-dwflsyms.sh b/tests/run-dwflsyms.sh index 56a75804d..c440bf738 100755 --- a/tests/run-dwflsyms.sh +++ b/tests/run-dwflsyms.sh @@ -177,21 +177,21 @@ cat > testfile.minsym.in <<\EOF EOF cat testfile.symtab.in \ - | testrun_compare ./dwflsyms -e testfilebaztab + | testrun_compare ${abs_builddir}/dwflsyms -e testfilebaztab cat testfile.symtab.in \ - | testrun_compare ./dwflsyms -e testfilebazdbg + | testrun_compare ${abs_builddir}/dwflsyms -e testfilebazdbg cat testfile.dynsym.in \ - | testrun_compare ./dwflsyms -e testfilebazdyn + | testrun_compare ${abs_builddir}/dwflsyms -e testfilebazdyn cat testfile.symtab.in \ - | testrun_compare ./dwflsyms -e testfilebazmdb + | testrun_compare ${abs_builddir}/dwflsyms -e testfilebazmdb cat testfile.minsym.in \ - | testrun_compare ./dwflsyms -e testfilebazmin + | testrun_compare ${abs_builddir}/dwflsyms -e testfilebazmin -testrun_compare ./dwflsyms -e testfilebasmin <<\EOF +testrun_compare ${abs_builddir}/dwflsyms -e testfilebasmin <<\EOF 0: NOTYPE LOCAL (0) 0 1: FUNC LOCAL foo (18) 0x400168 2: SECTION LOCAL (0) 0x400120 diff --git a/tests/run-early-offscn.sh b/tests/run-early-offscn.sh index 55a38f9fa..3757bcfc5 100755 --- a/tests/run-early-offscn.sh +++ b/tests/run-early-offscn.sh @@ -19,6 +19,6 @@ testfiles testfile -testrun ./early-offscn testfile 0x500 +testrun ${abs_builddir}/early-offscn testfile 0x500 exit 0 diff --git a/tests/run-ecp-test.sh b/tests/run-ecp-test.sh index d68a873cb..d5e376a1a 100755 --- a/tests/run-ecp-test.sh +++ b/tests/run-ecp-test.sh @@ -21,7 +21,7 @@ testfiles testfile10 tempfiles testfile10.tmp -testrun ./ecp testfile10 testfile10.tmp +testrun ${abs_builddir}/ecp testfile10 testfile10.tmp cmp testfile10 testfile10.tmp diff --git a/tests/run-ecp-test2.sh b/tests/run-ecp-test2.sh index a9acbe9ad..864e0a58a 100755 --- a/tests/run-ecp-test2.sh +++ b/tests/run-ecp-test2.sh @@ -21,6 +21,6 @@ testfiles testfile2 tempfiles testfile2.tmp -testrun ./ecp testfile2 testfile2.tmp +testrun ${abs_builddir}/ecp testfile2 testfile2.tmp exit 0 diff --git a/tests/run-elf_cntl_gelf_getshdr.sh b/tests/run-elf_cntl_gelf_getshdr.sh index 41a7d15bb..d134119c4 100755 --- a/tests/run-elf_cntl_gelf_getshdr.sh +++ b/tests/run-elf_cntl_gelf_getshdr.sh @@ -18,13 +18,13 @@ . $srcdir/test-subr.sh # However we open the elf file, the shdrs should be the same. -testrun ./test-elf_cntl_gelf_getshdr READ test-elf_cntl_gelf_getshdr \ +testrun ${abs_builddir}/test-elf_cntl_gelf_getshdr READ ${abs_builddir}/test-elf_cntl_gelf_getshdr \ > test_shdr.out -testrun_compare ./test-elf_cntl_gelf_getshdr MMAP test-elf_cntl_gelf_getshdr \ +testrun_compare ${abs_builddir}/test-elf_cntl_gelf_getshdr MMAP ${abs_builddir}/test-elf_cntl_gelf_getshdr \ < test_shdr.out -testrun_compare ./test-elf_cntl_gelf_getshdr FDREAD test-elf_cntl_gelf_getshdr \ +testrun_compare ${abs_builddir}/test-elf_cntl_gelf_getshdr FDREAD ${abs_builddir}/test-elf_cntl_gelf_getshdr \ < test_shdr.out rm -f test_shdr.out diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh index 4b0100872..013109dbb 100755 --- a/tests/run-elflint-self.sh +++ b/tests/run-elflint-self.sh @@ -18,4 +18,4 @@ . $srcdir/test-subr.sh -testrun_on_self ../src/elflint --quiet --gnu-ld +testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh index 5a5c62271..68615b961 100755 --- a/tests/run-elflint-test.sh +++ b/tests/run-elflint-test.sh @@ -20,24 +20,24 @@ testfiles testfile18 -testrun_compare ../src/elflint --gnu-ld testfile18 <<\EOF +testrun_compare ${abs_top_builddir}/src/elflint --gnu-ld testfile18 <<\EOF section [ 8] '.rela.dyn': relocation 1: copy relocation against symbol of type FUNC EOF testfiles testfile32 -testrun ../src/elflint -q testfile32 +testrun ${abs_top_builddir}/src/elflint -q testfile32 testfiles testfile33 -testrun ../src/elflint -q testfile33 +testrun ${abs_top_builddir}/src/elflint -q testfile33 testfiles testfile42 -testrun ../src/elflint -q --gnu-ld testfile42 +testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42 testfiles testfile46 -testrun ../src/elflint -q testfile46 +testrun ${abs_top_builddir}/src/elflint -q testfile46 # see also run-readelf-d.sh testfiles testlib_dynseg.so -testrun ../src/elflint -q --gnu-ld testlib_dynseg.so +testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so exit 0 diff --git a/tests/run-find-prologues.sh b/tests/run-find-prologues.sh index 78caa8c49..160f07d21 100755 --- a/tests/run-find-prologues.sh +++ b/tests/run-find-prologues.sh @@ -20,13 +20,13 @@ testfiles testfile testfile11 testfile22 testfile24 \ testfile25 testfile3 testfile4 testfile5 testfile6 -testrun_compare ./find-prologues -e testfile <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile <<\EOF main 0x000000000804842c 0x0000000008048432 bar 0x000000000804845c 0x000000000804845f foo 0x0000000008048468 0x000000000804846b EOF -testrun_compare ./find-prologues -e testfile11 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile11 <<\EOF main 0x00000000080489b8 0x00000000080489cd gnu_obj_2 0x0000000008048c9e 0x0000000008048ca4 gnu_obj_3 0x0000000008048cd8 0x0000000008048cde @@ -37,27 +37,27 @@ gnu_obj_1 0x0000000008048d8a 0x0000000008048d8d ~invalid_argument 0x0000000008048db2 0x0000000008048db8 EOF -testrun_compare ./find-prologues -e testfile22 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile22 <<\EOF function 0x0000000008048348 0x000000000804834e main 0x000000000804835b 0x0000000008048377 EOF -testrun_compare ./find-prologues -e testfile24 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile24 <<\EOF incr 0x0000000008048348 0x000000000804834e main 0x0000000008048354 0x0000000008048360 EOF -testrun_compare ./find-prologues -e testfile25 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile25 <<\EOF incr 0x0000000008048348 0x000000000804834c EOF -testrun_compare ./find-prologues -e testfile3 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile3 <<\EOF main 0x000000000804842c 0x0000000008048433 bar 0x0000000008048458 0x000000000804845b foo 0x0000000008048464 0x0000000008048467 EOF -testrun_compare ./find-prologues -e testfile4 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile4 <<\EOF get 0x00000000080493fc 0x0000000008049402 main 0x0000000008049498 0x000000000804949e a 0x000000000804d85c 0x000000000804d85c @@ -65,13 +65,13 @@ __tfPCc 0x000000000804d86c 0x000000000804d872 __tfCc 0x000000000804d8a4 0x000000000804d8a4 EOF -testrun_compare ./find-prologues -e testfile5 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile5 <<\EOF bar 0x000000000804842c 0x000000000804842f foo 0x0000000008048438 0x000000000804843b main 0x0000000008048444 0x000000000804844a EOF -testrun_compare ./find-prologues -e testfile6 <<\EOF +testrun_compare ${abs_builddir}/find-prologues -e testfile6 <<\EOF main 0x00000000080489b8 0x00000000080489cd gnu_obj_2 0x0000000008048c9e 0x0000000008048ca4 gnu_obj_3 0x0000000008048cd8 0x0000000008048cde diff --git a/tests/run-funcscopes.sh b/tests/run-funcscopes.sh index a0e48c132..d236f5c3b 100755 --- a/tests/run-funcscopes.sh +++ b/tests/run-funcscopes.sh @@ -19,7 +19,7 @@ testfiles testfile25 -testrun_compare ./funcscopes -e testfile25 incr <<\EOF +testrun_compare ${abs_builddir}/funcscopes -e testfile25 incr <<\EOF testfile25: 0x8048000 .. 0x8049528 inline-test.c (0x11): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834f (/home/roland/build/stock-elfutils/inline-test.c:9) incr (0x2e): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834f (/home/roland/build/stock-elfutils/inline-test.c:9) diff --git a/tests/run-get-aranges.sh b/tests/run-get-aranges.sh index f3949f470..62cae5f80 100755 --- a/tests/run-get-aranges.sh +++ b/tests/run-get-aranges.sh @@ -20,7 +20,7 @@ testfiles testfile testfile2 -testrun_compare ./get-aranges testfile testfile2 <<\EOF +testrun_compare ${abs_builddir}/get-aranges testfile testfile2 <<\EOF 0x804842b: not in range CU name: "m.c" CU name: "m.c" diff --git a/tests/run-get-files.sh b/tests/run-get-files.sh index 6eadcd555..a2f2373b0 100755 --- a/tests/run-get-files.sh +++ b/tests/run-get-files.sh @@ -20,7 +20,7 @@ testfiles testfile testfile2 -testrun_compare ./get-files testfile testfile2 <<\EOF +testrun_compare ${abs_builddir}/get-files testfile testfile2 <<\EOF cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 191 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt" file[0] = "???" diff --git a/tests/run-get-lines.sh b/tests/run-get-lines.sh index 8c8c71e4f..5a220cab7 100755 --- a/tests/run-get-lines.sh +++ b/tests/run-get-lines.sh @@ -20,7 +20,7 @@ testfiles testfile testfile2 -testrun_compare ./get-lines testfile testfile2 <<\EOF +testrun_compare ${abs_builddir}/get-lines testfile testfile2 <<\EOF cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 191 5 lines 804842c: /home/drepper/gnu/new-bu/build/ttt/m.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no diff --git a/tests/run-get-pubnames.sh b/tests/run-get-pubnames.sh index a8a175935..912793e4a 100755 --- a/tests/run-get-pubnames.sh +++ b/tests/run-get-pubnames.sh @@ -20,7 +20,7 @@ testfiles testfile testfile2 -testrun_compare ./get-pubnames testfile testfile2 <<\EOF +testrun_compare ${abs_builddir}/get-pubnames testfile testfile2 <<\EOF [ 0] "main", die: 104, cu: 11 CU name: "m.c" object name: "main" diff --git a/tests/run-line2addr.sh b/tests/run-line2addr.sh index 768cf6962..3b6c4457f 100755 --- a/tests/run-line2addr.sh +++ b/tests/run-line2addr.sh @@ -20,28 +20,28 @@ testfiles testfile testfile2 testfile8 testfile14 testfile23 -testrun_compare ./line2addr -e testfile f.c:4 testfile f.c:8 <<\EOF +testrun_compare ${abs_builddir}/line2addr -e testfile f.c:4 testfile f.c:8 <<\EOF f.c:4 -> 0x804846b (/home/drepper/gnu/new-bu/build/ttt/f.c:4) EOF -testrun_compare ./line2addr -e testfile2 m.c:6 b.c:1 <<\EOF +testrun_compare ${abs_builddir}/line2addr -e testfile2 m.c:6 b.c:1 <<\EOF m.c:6 -> 0x100004cc (/shoggoth/drepper/m.c:6) b.c:1 -> 0x10000470 (/shoggoth/drepper/b.c:4) EOF -testrun_compare ./line2addr -e testfile8 strip.c:953 strip.c:365 <<\EOF +testrun_compare ${abs_builddir}/line2addr -e testfile8 strip.c:953 strip.c:365 <<\EOF strip.c:953 -> (.text)+0x169f (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:953) strip.c:953 -> (.text)+0x16aa (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:953) strip.c:365 -> (.text)+0x278b (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:365) strip.c:365 -> (.text)+0x2797 (/home/drepper/gnu/elfutils/build/src/../../src/strip.c:365) EOF -testrun_compare ./line2addr -e testfile14 v.c:6 <<\EOF +testrun_compare ${abs_builddir}/line2addr -e testfile14 v.c:6 <<\EOF v.c:6 -> 0x400468 (/home/drepper/local/elfutils-build/20050425/v.c:6) v.c:6 -> 0x400487 (/home/drepper/local/elfutils-build/20050425/v.c:6) EOF -testrun_compare ./line2addr -e testfile23 foo.c:2 foo.c:6 <<\EOF +testrun_compare ${abs_builddir}/line2addr -e testfile23 foo.c:2 foo.c:6 <<\EOF foo.c:2 -> (.init.text)+0xc (/home/roland/stock-elfutils-build/foo.c:2) foo.c:6 -> (.text)+0xc (/home/roland/stock-elfutils-build/foo.c:6) EOF diff --git a/tests/run-low_high_pc.sh b/tests/run-low_high_pc.sh index eb6f8cf04..ab5f2c379 100755 --- a/tests/run-low_high_pc.sh +++ b/tests/run-low_high_pc.sh @@ -25,10 +25,10 @@ # gcc -g -o main main.c testfiles testfile_low_high_pc -testrun ./low_high_pc -e ./testfile_low_high_pc -testrun ./low_high_pc -e ./low_high_pc -testrun ./low_high_pc -e ../src/strip -testrun ./low_high_pc -e ../src/strip.o -testrun ./low_high_pc -e ../libelf/libelf.so +testrun ${abs_builddir}/low_high_pc -e ./testfile_low_high_pc +testrun ${abs_builddir}/low_high_pc -e ${abs_builddir}/low_high_pc +testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/src/strip +testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/src/strip.o +testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/libelf/libelf.so exit 0 diff --git a/tests/run-macro-test.sh b/tests/run-macro-test.sh index 70a16edfe..c160968b3 100755 --- a/tests/run-macro-test.sh +++ b/tests/run-macro-test.sh @@ -34,14 +34,14 @@ testfiles testfile-macinfo testfile-macros status=0 -testrun ../src/readelf --debug-dump=info testfile-macinfo \ +testrun ${abs_top_builddir}/src/readelf --debug-dump=info testfile-macinfo \ | grep macro_info > readelf.macros.out || { echo "*** failure readelf --debug-dump=info testfile-macinfo"; status=1; } testrun_compare cat readelf.macros.out <<\EOF macro_info (sec_offset) 0 EOF -testrun ../src/readelf --debug-dump=info testfile-macros \ +testrun ${abs_top_builddir}/src/readelf --debug-dump=info testfile-macros \ | grep GNU_macros > readelf.macros.out || { echo "*** failure readelf --debug-dump=info testfile-macros"; status=1; } testrun_compare cat readelf.macros.out <<\EOF diff --git a/tests/run-native-test.sh b/tests/run-native-test.sh index ed7672fe9..b543922c3 100755 --- a/tests/run-native-test.sh +++ b/tests/run-native-test.sh @@ -70,8 +70,8 @@ native_test() test $native -eq 0 || testrun "$@" -p $native > /dev/null } -native_test ./allregs -native_test ./funcretval +native_test ${abs_builddir}/allregs +native_test ${abs_builddir}/funcretval # We do this explicitly rather than letting the trap 0 cover it, # because as of version 3.1 bash prints the "Killed" report for diff --git a/tests/run-nm-self.sh b/tests/run-nm-self.sh index 0fe0ec622..d2c124657 100755 --- a/tests/run-nm-self.sh +++ b/tests/run-nm-self.sh @@ -20,7 +20,7 @@ for what_arg in --debug-syms --defined-only --dynamic --extern-only; do for format_arg in --format=bsd --format=sysv --format=posix; do for out_arg in --numeric-sort --no-sort --reverse-sort; do - testrun_on_self_quiet ../src/nm $what_arg $format_arg $out_arg + testrun_on_self_quiet ${abs_top_builddir}/src/nm $what_arg $format_arg $out_arg done done done diff --git a/tests/run-prelink-addr-test.sh b/tests/run-prelink-addr-test.sh index 588261f9f..3398c0d13 100755 --- a/tests/run-prelink-addr-test.sh +++ b/tests/run-prelink-addr-test.sh @@ -47,7 +47,7 @@ EOF # Prior to commit 1743d7f, libdwfl would fail on the second address, # because it didn't notice that prelink added a 0x20-byte offset from # what the .debug file reports. -testrun_compare ../src/addr2line -S -M testmaps52-32 \ +testrun_compare ${abs_top_builddir}/src/addr2line -S -M testmaps52-32 \ 0x11140c 0x4100042d 0x4200040e <<\EOF foo /home/jistone/src/elfutils/tests/testfile52-32.c:2 @@ -76,7 +76,7 @@ cat > testmaps52-64 < testmaps54-32 < testmaps54-64 <..0x0804834a EOF -testrun_compare ../src/readelf --debug-dump=decodedaranges testfilefoobarbaz <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedaranges testfilefoobarbaz <<\EOF DWARF section [27] '.debug_aranges' at offset 0x1044 contains 5 entries: [0] start: 0x080482f0, length: 52, CU DIE offset: 11 diff --git a/tests/run-readelf-d.sh b/tests/run-readelf-d.sh index 3e4b7bf2e..d0b6ed246 100755 --- a/tests/run-readelf-d.sh +++ b/tests/run-readelf-d.sh @@ -32,7 +32,7 @@ testfiles testlib_dynseg.so -testrun_compare ../src/readelf -d testlib_dynseg.so <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf -d testlib_dynseg.so <<\EOF Dynamic segment contains 28 entries: Addr: 0x00000000000017e0 Offset: 0x0007e0 Link to section: [ 3] '.dynstr' diff --git a/tests/run-readelf-dwz-multi.sh b/tests/run-readelf-dwz-multi.sh index ca939f30a..44d24758d 100755 --- a/tests/run-readelf-dwz-multi.sh +++ b/tests/run-readelf-dwz-multi.sh @@ -78,7 +78,7 @@ testfiles libtestfile_multi_shared.so testfile_multi_main testfile_multi.dwz testfiles testfile-dwzstr testfile-dwzstr.multi -testrun_compare ../src/readelf --debug-dump=info testfile_multi_main <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile_multi_main <<\EOF DWARF section [28] '.debug_info' at offset 0x1078: [Offset] @@ -136,7 +136,7 @@ DWARF section [28] '.debug_info' at offset 0x1078: type (ref_udata) [ 2b] EOF -testrun_compare ../src/readelf --debug-dump=info libtestfile_multi_shared.so <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info libtestfile_multi_shared.so <<\EOF DWARF section [25] '.debug_info' at offset 0x106c: [Offset] @@ -173,7 +173,7 @@ DWARF section [25] '.debug_info' at offset 0x106c: [ 0] fbreg -24 EOF -testrun_compare ../src/readelf --debug-dump=info testfile-dwzstr <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile-dwzstr <<\EOF DWARF section [28] '.debug_info' at offset 0x1088: [Offset] diff --git a/tests/run-readelf-gdb_index.sh b/tests/run-readelf-gdb_index.sh index 31c94c14f..fcbc3c571 100755 --- a/tests/run-readelf-gdb_index.sh +++ b/tests/run-readelf-gdb_index.sh @@ -65,7 +65,7 @@ testfiles testfilegdbindex5 testfilegdbindex7 -testrun_compare ../src/readelf --debug-dump=gdb_index testfilegdbindex5 <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=gdb_index testfilegdbindex5 <<\EOF GDB section [33] '.gdb_index' at offset 0xe76 contains 8383 bytes : Version: 5 @@ -96,7 +96,7 @@ GDB section [33] '.gdb_index' at offset 0xe76 contains 8383 bytes : [ 754] symbol: int, CUs: 0 EOF -testrun_compare ../src/readelf --debug-dump=gdb_index testfilegdbindex7 <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=gdb_index testfilegdbindex7 <<\EOF GDB section [33] '.gdb_index' at offset 0xe76 contains 8399 bytes : Version: 7 diff --git a/tests/run-readelf-line.sh b/tests/run-readelf-line.sh index f0e491d69..32bcf9d5f 100755 --- a/tests/run-readelf-line.sh +++ b/tests/run-readelf-line.sh @@ -22,7 +22,7 @@ testfiles testfilefoobarbaz -testrun_compare ../src/readelf --debug-dump=line testfilefoobarbaz < testfile.temp +testrun ${abs_top_builddir}/src/readelf -r testfile3 > testfile.temp diff -u - testfile.temp </dev/null ../src/readelf -w testfile14 testfile14 +testrun >/dev/null ${abs_top_builddir}/src/readelf -w testfile14 testfile14 exit 0 diff --git a/tests/run-readelf-vmcoreinfo.sh b/tests/run-readelf-vmcoreinfo.sh index da361c85a..b1732fc65 100755 --- a/tests/run-readelf-vmcoreinfo.sh +++ b/tests/run-readelf-vmcoreinfo.sh @@ -19,7 +19,7 @@ testfiles testfile62 -testrun_compare ../src/readelf -n testfile62 <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf -n testfile62 <<\EOF Note segment of 2104 bytes at offset 0x158: Owner Data size Type diff --git a/tests/run-rerequest_tag.sh b/tests/run-rerequest_tag.sh index 3a4cb1cb1..f4372847d 100755 --- a/tests/run-rerequest_tag.sh +++ b/tests/run-rerequest_tag.sh @@ -19,7 +19,7 @@ testfiles testfile56 testfile57 -testrun ./rerequest_tag testfile56 -testrun ./rerequest_tag testfile57 +testrun ${abs_builddir}/rerequest_tag testfile56 +testrun ${abs_builddir}/rerequest_tag testfile57 exit 0 diff --git a/tests/run-show-abbrev.sh b/tests/run-show-abbrev.sh index 351730f68..40d0e3622 100755 --- a/tests/run-show-abbrev.sh +++ b/tests/run-show-abbrev.sh @@ -20,7 +20,7 @@ testfiles testfile testfile2 -testrun_compare ./show-abbrev testfile testfile2 <<\EOF +testrun_compare ${abs_builddir}/show-abbrev testfile testfile2 <<\EOF abbrev[0]: code = 1, tag = 17, children = 1 abbrev[0]: attr[0]: code = 16, form = 6, offset = 0 abbrev[0]: attr[1]: code = 18, form = 1, offset = 2 diff --git a/tests/run-show-die-info.sh b/tests/run-show-die-info.sh index cbe60f931..f92ee4889 100755 --- a/tests/run-show-die-info.sh +++ b/tests/run-show-die-info.sh @@ -20,7 +20,7 @@ testfiles testfile5 testfile2 -testrun_compare ./show-die-info testfile5 testfile2 <<\EOF +testrun_compare ${abs_builddir}/show-die-info testfile5 testfile2 <<\EOF file: testfile5 New CU: off = 0, hsize = 11, ab = 0, as = 4, os = 4 DW_TAG_compile_unit diff --git a/tests/run-strings-test.sh b/tests/run-strings-test.sh index 6bfc87e15..33f2d641f 100755 --- a/tests/run-strings-test.sh +++ b/tests/run-strings-test.sh @@ -21,7 +21,7 @@ files="testfile `seq 2 9 | while read n; do echo testfile$n; done`" testfiles $files -testrun_compare ../src/strings -tx -f $files <<\EOF +testrun_compare ${abs_top_builddir}/src/strings -tx -f $files <<\EOF testfile: f4 /lib/ld-linux.so.2 testfile: 1c9 __gmon_start__ testfile: 1d8 libc.so.6 diff --git a/tests/run-strip-groups.sh b/tests/run-strip-groups.sh index 86d1d441b..1c836a4a0 100755 --- a/tests/run-strip-groups.sh +++ b/tests/run-strip-groups.sh @@ -49,7 +49,7 @@ dbgfile=$infile.debug testfiles $infile tempfiles $outfile $dbgfile -testrun ../src/strip -o $outfile -f $dbgfile $infile -testrun ../src/elflint -q $infile -testrun ../src/elflint -q $outfile -testrun ../src/elflint -q -d $dbgfile +testrun ${abs_top_builddir}/src/strip -o $outfile -f $dbgfile $infile +testrun ${abs_top_builddir}/src/elflint -q $infile +testrun ${abs_top_builddir}/src/elflint -q $outfile +testrun ${abs_top_builddir}/src/elflint -q -d $dbgfile diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh index 603fb7c70..ec4be3fff 100755 --- a/tests/run-strip-reloc.sh +++ b/tests/run-strip-reloc.sh @@ -28,18 +28,18 @@ runtest() { outfile2=out.stripped2 debugfile2=out.debug2 - testrun ../src/strip -o $outfile1 -f $debugfile1 $infile || + testrun ${abs_top_builddir}/src/strip -o $outfile1 -f $debugfile1 $infile || { echo "*** failure strip $infile"; status=1; } - testrun ../src/strip --reloc-debug-sections -o $outfile2 \ + testrun ${abs_top_builddir}/src/strip --reloc-debug-sections -o $outfile2 \ -f $debugfile2 $infile || { echo "*** failure strip --reloc-debug-sections $infile"; status=1; } # shouldn't make any difference for stripped files. - testrun ../src/readelf -a $outfile1 > readelf.out || + testrun ${abs_top_builddir}/src/readelf -a $outfile1 > readelf.out || { echo "*** failure readelf -a outfile1 $infile"; status=1; } - testrun_compare ../src/readelf -a $outfile2 < readelf.out || + testrun_compare ${abs_top_builddir}/src/readelf -a $outfile2 < readelf.out || { echo "*** failure compare stripped files $infile"; status=1; } # debug files however should be smaller, when ET_REL. @@ -51,11 +51,11 @@ runtest() { # Strip of DWARF section lines, offset will not match. # Everything else should match. - testrun ../src/readelf -w $debugfile1 \ + testrun ${abs_top_builddir}/src/readelf -w $debugfile1 \ | grep -v ^DWARF\ section > readelf.out1 || { echo "*** failure readelf -w debugfile1 $infile"; status=1; } - testrun ../src/readelf -w $debugfile2 \ + testrun ${abs_top_builddir}/src/readelf -w $debugfile2 \ | grep -v ^DWARF\ section > readelf.out2 || { echo "*** failure readelf -w debugfile2 $infile"; status=1; } @@ -101,7 +101,7 @@ runtest hello_ppc64.ko 1 runtest hello_s390.ko 1 # self test, shouldn't impact non-ET_REL files at all. -runtest ../src/strip 0 -runtest ../src/strip.o 1 +runtest ${abs_top_builddir}/src/strip 0 +runtest ${abs_top_builddir}/src/strip.o 1 exit $status diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh index c6c7c0946..c558e90b5 100755 --- a/tests/run-strip-test.sh +++ b/tests/run-strip-test.sh @@ -27,30 +27,30 @@ test x$stripped = xtestfile.temp || testfiles $stripped $debugfile tempfiles testfile.temp testfile.debug.temp testfile.unstrip -testrun ../src/strip -o testfile.temp $debugout $original +testrun ${abs_top_builddir}/src/strip -o testfile.temp $debugout $original status=0 cmp $stripped testfile.temp || status=$? # Check elflint and the expected result. -testrun ../src/elflint -q testfile.temp || status=$? +testrun ${abs_top_builddir}/src/elflint -q testfile.temp || status=$? test -z "$debugfile" || { cmp $debugfile testfile.debug.temp || status=$? # Check elflint and the expected result. -testrun ../src/elflint -q -d testfile.debug.temp || status=$? +testrun ${abs_top_builddir}/src/elflint -q -d testfile.debug.temp || status=$? # Now test unstrip recombining those files. -testrun ../src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp +testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp # Check that it came back whole. -testrun ../src/elfcmp --hash-inexact $original testfile.unstrip +testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip } tempfiles testfile.sections -testrun ../src/readelf -S testfile.temp > testfile.sections || status=$? +testrun ${abs_top_builddir}/src/readelf -S testfile.temp > testfile.sections || status=$? fgrep ' .debug_' testfile.sections && status=1 exit $status diff --git a/tests/run-test-archive64.sh b/tests/run-test-archive64.sh index 26552ac95..43df16e44 100755 --- a/tests/run-test-archive64.sh +++ b/tests/run-test-archive64.sh @@ -26,7 +26,7 @@ # ar cru testarchive64.a aaa.o bbb.o ccc.o testfiles testarchive64.a -testrun_compare ../src/readelf -c testarchive64.a <<\EOF +testrun_compare ${abs_top_builddir}/src/readelf -c testarchive64.a <<\EOF Index of archive 'testarchive64.a' has 7 entries: Archive member 'aaa.o' contains: diff --git a/tests/run-test-flag-nobits.sh b/tests/run-test-flag-nobits.sh index 15667565c..9bedf1749 100755 --- a/tests/run-test-flag-nobits.sh +++ b/tests/run-test-flag-nobits.sh @@ -19,4 +19,4 @@ testfiles testfile -testrun ./test-flag-nobits testfile +testrun ${abs_builddir}/test-flag-nobits testfile diff --git a/tests/run-typeiter.sh b/tests/run-typeiter.sh index 3a453ab4d..b85839ce7 100755 --- a/tests/run-typeiter.sh +++ b/tests/run-typeiter.sh @@ -43,7 +43,7 @@ testfiles testfile59 -testrun_compare ./typeiter testfile59 <<\EOF +testrun_compare ${abs_builddir}/typeiter testfile59 <<\EOF ok EOF diff --git a/tests/run-unstrip-n.sh b/tests/run-unstrip-n.sh index 1353b1ddb..9c2b43b3c 100755 --- a/tests/run-unstrip-n.sh +++ b/tests/run-unstrip-n.sh @@ -33,7 +33,7 @@ testfiles testcore-rtlib testcore-rtlib-ppc -testrun_compare ../src/unstrip -n --core=testcore-rtlib <<\EOF +testrun_compare ${abs_top_builddir}/src/unstrip -n --core=testcore-rtlib <<\EOF 0x8048000+0x2000 f1c600bc36cb91bf01f9a63a634ecb79aa4c3199@0x8048178 . - [exe] 0xf77d6000+0x1000 676560b1b765cde9c2e53f134f4ee354ea894747@0xf77d6210 . - linux-gate.so.1 0xf77b3000+0x9000 c6c5b5e35ab9589d4762ac85b4bd56b1b2720e37@0xf77b3164 /lib/librt.so.1 - librt.so.1 @@ -42,7 +42,7 @@ testrun_compare ../src/unstrip -n --core=testcore-rtlib <<\EOF 0xf77d7000+0x21000 6d2cb32650054f1c176d01d48713a4a5e5e84c1a@0xf77d7124 /lib/ld-linux.so.2 - ld-linux.so.2 EOF -testrun_compare ../src/unstrip -n --core=testcore-rtlib-ppc <<\EOF +testrun_compare ${abs_top_builddir}/src/unstrip -n --core=testcore-rtlib-ppc <<\EOF 0x10000000+0x20000 979b7a26747cc09bd84a42b311b5288c704baea5@0x10000174 . - [exe] 0x100000+0x10000 708b900b05176964512a6b0fe90c2a0c9d73d726@0x100334 . - linux-vdso32.so.1 0xfd50000+0x30000 3f7d21508470322d2f47acddc20ab10516edba99@0xfd50164 /lib/librt.so.1 - librt.so.1 diff --git a/tests/run-unstrip-test.sh b/tests/run-unstrip-test.sh index 36549430b..dc7d3a423 100755 --- a/tests/run-unstrip-test.sh +++ b/tests/run-unstrip-test.sh @@ -29,15 +29,15 @@ tempfiles testfile.unstrip testfile.inplace # stripped sections that shrank in the stripped file. strip # no longer does that, but unstrip must still handle it. -testrun ../src/unstrip -o testfile.unstrip $stripped $debugfile +testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip $stripped $debugfile -testrun ../src/elfcmp --hash-inexact $original testfile.unstrip +testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip # Also test modifying the file in place. rm -f testfile.inplace cp $debugfile testfile.inplace chmod 644 testfile.inplace -testrun ../src/unstrip $stripped testfile.inplace +testrun ${abs_top_builddir}/src/unstrip $stripped testfile.inplace -testrun ../src/elfcmp --hash-inexact $original testfile.inplace +testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.inplace diff --git a/tests/test-subr.sh b/tests/test-subr.sh index 19a9836a0..7bf1f71d3 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -22,11 +22,16 @@ set -e +# Each test runs in its own directory to make sure they can run in parallel. +test_dir="test-$$" +mkdir -p "$test_dir" +pushd "$test_dir" > /dev/null + #LC_ALL=C #export LC_ALL remove_files= -trap 'rm -f $remove_files' 0 +trap 'rm -f $remove_files; popd > /dev/null; rmdir $test_dir' 0 tempfiles() { @@ -36,7 +41,7 @@ tempfiles() testfiles() { for file; do - bunzip2 -c $srcdir/${file}.bz2 > ${file} 2>/dev/null || exit 77 + bunzip2 -c ${abs_srcdir}/${file}.bz2 > ${file} 2>/dev/null || exit 77 remove_files="$remove_files $file" done } @@ -80,13 +85,13 @@ installed_testrun() program="$1" shift case "$program" in - ./*) + ${abs_builddir}/*) if [ "x$elfutils_tests_rpath" != xno ]; then echo >&2 installcheck not possible with --enable-tests-rpath exit 77 fi ;; - ../*) + ${abs_top_builddir}/src/*) program=${bindir}/`program_transform ${program##*/}` ;; esac @@ -104,10 +109,12 @@ program_transform() echo "$*" | sed "${program_transform_name}" } -self_test_files=`echo ../src/addr2line ../src/elfcmp ../src/elflint \ -../src/findtextrel ../src/ld ../src/nm ../src/objdump ../src/readelf \ -../src/size ../src/strip ../libelf/libelf.so ../libdw/libdw.so \ -../libasm/libasm.so ../backends/libebl_*.so` +self_test_files=`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 \ +${abs_top_builddir}/src/strip ${abs_top_builddir}/libelf/libelf.so \ +${abs_top_builddir}/libdw/libdw.so ${abs_top_builddir}/backends/libebl_*.so` # Provide a command to run on all self-test files with testrun. testrun_on_self() -- 2.47.2