Signed-off-by: Petr Machata <[email protected]>
---
 tests/ChangeLog             |    7 +++++++
 tests/Makefile.am           |    6 ++++--
 tests/archive64.a.bz2       |  Bin 0 -> 834 bytes
 tests/run-test-archive64.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 tests/archive64.a.bz2
 create mode 100755 tests/run-test-archive64.sh

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 6133048..cde71f4 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-01  Petr Machata  <[email protected]>
+
+       * test-archive64.sh: New test.
+       * archive64.a.bz2: New testfile.
+       * Makefile.am (TESTS): Add test-archive64.sh.
+       (EXTRA_DIST): Likewise.
+
 2012-07-19  Mark Wielaard  <[email protected]>
 
        * Makefile.am (check_PROGRAMS): Add test-elf_cntl_gelf_getshdr.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a8b0f16..ea0c22a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -82,7 +82,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
        run-test-flag-nobits.sh run-prelink-addr-test.sh \
        run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \
        run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \
-       run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh
+       run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
+       run-test-archive64.sh
 
 if !STANDALONE
 check_PROGRAMS += msg_tst md5-sha1-test
@@ -165,7 +166,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
             run-low_high_pc.sh testfile_low_high_pc.bz2 \
             run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \
-            run-elf_cntl_gelf_getshdr.sh
+            run-elf_cntl_gelf_getshdr.sh \
+            run-test-archive64.sh archive64.a.bz2
 
 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
                              bindir=$(DESTDIR)$(bindir) \
diff --git a/tests/archive64.a.bz2 b/tests/archive64.a.bz2
new file mode 100644
index 0000000..4b54603
Binary files /dev/null and b/tests/archive64.a.bz2 differ
diff --git a/tests/run-test-archive64.sh b/tests/run-test-archive64.sh
new file mode 100755
index 0000000..871554e
--- /dev/null
+++ b/tests/run-test-archive64.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Copyright (C) 2012 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
+
+# The test archive was produced on an s390x machine using the
+# following command sequence:
+#  echo 'int aaa(void){}' | gcc -x c /dev/stdin -c -o aaa.o
+#  echo 'int bbb(void){} int bbb2(void){}' | gcc -x c /dev/stdin -c -o bbb.o
+#  echo 'int ccc(void){} int ccc2(void){} int ccc3(void){}' \
+#    | gcc -x c /dev/stdin -c -o ccc.o
+#  ar cru archive64.a aaa.o bbb.o ccc.o
+testfiles archive64.a
+
+testrun_compare ../src/readelf -c archive64.a <<\EOF
+
+Index of archive 'archive64.a' has 7 entries:
+Archive member 'aaa.o' contains:
+       aaa
+Archive member 'bbb.o' contains:
+       bbb
+       bbb2
+Archive member 'ccc.o' contains:
+       ccc
+       ccc2
+       ccc3
+EOF
+
+exit 0
-- 
1.7.6.5

_______________________________________________
elfutils-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to