summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2005-08-15 21:36:27 +0000
committerUlrich Drepper <[email protected]>2005-08-15 21:36:27 +0000
commit5d83229c852a7e7359c12b58864751db2c755926 (patch)
tree1af36916be07e38cd054e1937e74c0ce26946a2c /tests
parent104532fcdb87e769d8ebf5771b9c4370e4361a7b (diff)
Implement ranlib. This required one little extension to libelf.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am10
-rwxr-xr-xtests/run-ranlib-test.sh34
-rwxr-xr-xtests/run-ranlib-test2.sh39
-rwxr-xr-xtests/run-ranlib-test3.sh17
-rwxr-xr-xtests/run-ranlib-test4.sh18
-rw-r--r--tests/testfile19.bz2bin0 -> 458 bytes
-rw-r--r--tests/testfile19.index.bz2bin0 -> 501 bytes
-rw-r--r--tests/testfile20.bz2bin0 -> 502 bytes
-rw-r--r--tests/testfile20.index.bz2bin0 -> 523 bytes
-rw-r--r--tests/testfile21.bz2bin0 -> 127 bytes
-rw-r--r--tests/testfile21.index.bz2bin0 -> 100 bytes
11 files changed, 115 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 407426a4..5490291b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -44,7 +44,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
msg_tst newscn run-strip-test.sh run-strip-test2.sh \
run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh \
- run-elflint-test.sh run-elflint-self.sh
+ run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
+ run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh
# run-show-ciefde.sh
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
@@ -58,11 +59,14 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
- run-elflint-self.sh \
+ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
+ run-ranlib-test3.sh run-ranlib-test4.sh \
testfile15.bz2 testfile15.debug.bz2 \
testfile16.bz2 testfile16.debug.bz2 \
testfile17.bz2 testfile17.debug.bz2 \
- testfile18.bz2
+ testfile18.bz2 testfile19.bz testfile19.index.bz2 \
+ testfile20.bz2 testfile20.index.bz2 \
+ testfile21.bz2 testfile21.index.bz2
if MUDFLAP
static_build=yes
diff --git a/tests/run-ranlib-test.sh b/tests/run-ranlib-test.sh
new file mode 100755
index 00000000..868e728e
--- /dev/null
+++ b/tests/run-ranlib-test.sh
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <[email protected]>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+set -e
+
+cat > ranlib-test.a <<"EOF"
+!<arch>
+foo/ 1124128960 500 500 100664 4 `
+foo
+bar/ 1124128965 500 500 100664 4 `
+bar
+EOF
+
+cp ranlib-test.a ranlib-test.a-copy
+
+LD_LIBRARY_PATH=../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
+ ../src/ranlib ranlib-test.a
+
+# The ranlib call should not have changed anything.
+cmp ranlib-test.a ranlib-test.a-copy
+
+rm -f ranlib-test.a ranlib-test.a-copy
+
+exit 0
diff --git a/tests/run-ranlib-test2.sh b/tests/run-ranlib-test2.sh
new file mode 100755
index 00000000..cce9ca7c
--- /dev/null
+++ b/tests/run-ranlib-test2.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <[email protected]>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+set -e
+
+original=${original:-testfile19}
+indexed=${indexed:-testfile19.index}
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0
+
+# Don't fail if we cannot decompress the file.
+bunzip2 -c $srcdir/$indexed.bz2 > $indexed 2>/dev/null || exit 0
+
+LD_LIBRARY_PATH=../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
+ ../src/ranlib $original
+
+if test -z "$noindex"; then
+ # The data in the index is different. The reference file has it blanked
+ # out, we do the same here.
+ echo " " |
+ dd of=$original seek=24 bs=1 count=12 conv=notrunc 2>/dev/null
+fi
+
+cmp $original $indexed
+
+rm -f $original $indexed
+
+exit 0
diff --git a/tests/run-ranlib-test3.sh b/tests/run-ranlib-test3.sh
new file mode 100755
index 00000000..f0300336
--- /dev/null
+++ b/tests/run-ranlib-test3.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <[email protected]>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+
+original=testfile20
+indexed=testfile20.index
+. $srcdir/run-ranlib-test2.sh
diff --git a/tests/run-ranlib-test4.sh b/tests/run-ranlib-test4.sh
new file mode 100755
index 00000000..78944ae9
--- /dev/null
+++ b/tests/run-ranlib-test4.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+# Copyright (C) 2005 Red Hat, Inc.
+# Written by Ulrich Drepper <[email protected]>, 2005.
+#
+# This program is Open Source software; you can redistribute it and/or
+# modify it under the terms of the Open Software License version 1.0 as
+# published by the Open Source Initiative.
+#
+# You should have received a copy of the Open Software License along
+# with this program; if not, you may obtain a copy of the Open Software
+# License version 1.0 from http://www.opensource.org/licenses/osl.php or
+# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+# 3001 King Ranch Road, Ukiah, CA 95482.
+
+original=testfile21
+indexed=testfile21.index
+noindex=1
+. $srcdir/run-ranlib-test2.sh
diff --git a/tests/testfile19.bz2 b/tests/testfile19.bz2
new file mode 100644
index 00000000..f3e6512e
--- /dev/null
+++ b/tests/testfile19.bz2
Binary files differ
diff --git a/tests/testfile19.index.bz2 b/tests/testfile19.index.bz2
new file mode 100644
index 00000000..c0a0a7ac
--- /dev/null
+++ b/tests/testfile19.index.bz2
Binary files differ
diff --git a/tests/testfile20.bz2 b/tests/testfile20.bz2
new file mode 100644
index 00000000..a379f6bf
--- /dev/null
+++ b/tests/testfile20.bz2
Binary files differ
diff --git a/tests/testfile20.index.bz2 b/tests/testfile20.index.bz2
new file mode 100644
index 00000000..08dedaf4
--- /dev/null
+++ b/tests/testfile20.index.bz2
Binary files differ
diff --git a/tests/testfile21.bz2 b/tests/testfile21.bz2
new file mode 100644
index 00000000..bab7e6d1
--- /dev/null
+++ b/tests/testfile21.bz2
Binary files differ
diff --git a/tests/testfile21.index.bz2 b/tests/testfile21.index.bz2
new file mode 100644
index 00000000..5192219b
--- /dev/null
+++ b/tests/testfile21.index.bz2
Binary files differ