summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Rosin <peda@lysator.liu.se>2010-08-01 08:38:05 +0200
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>2010-08-09 21:34:33 +0200
commit9533d1f026a1ca8a3f77f64bc710f13cdaa1b410 (patch)
treec55034eac0aef7ec2457df8dbc3f0667c4d3d663 /tests
parent265e34202672a00d701fe337076451ae89010e59 (diff)
downloadautomake-9533d1f026a1ca8a3f77f64bc710f13cdaa1b410.tar.gz
Add new auxiliary 'ar-lib' script, wrapping Microsoft lib.
* lib/ar-lib: New auxiliary script. * lib/Makefile.am: Add above. * tests/ar-lib.test: New test. * tests/Makefile.am: Add above. * automake.in (@common_files): Distribute the 'ar-lib' script. * doc/automake.texi (Auxiliary Programs): Mention the new 'ar-lib' script. (Optional): Mention 'ar-lib' in AC_CONFIG_AUX_DIR. * NEWS: Update. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/Makefile.in1
-rwxr-xr-xtests/ar-lib.test75
3 files changed, 77 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfc5270da..01acd768e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -88,6 +88,7 @@ ansi7.test \
ansi8.test \
ansi9.test \
ansi10.test \
+ar-lib.test \
ar.test \
ar2.test \
asm.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3a3474506..ff547a0fb 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -326,6 +326,7 @@ ansi7.test \
ansi8.test \
ansi9.test \
ansi10.test \
+ar-lib.test \
ar.test \
ar2.test \
asm.test \
diff --git a/tests/ar-lib.test b/tests/ar-lib.test
new file mode 100755
index 000000000..85f82422f
--- /dev/null
+++ b/tests/ar-lib.test
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program 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 2, or (at your option)
+# any later version.
+#
+# This program 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/>.
+
+# Make sure `ar-lib' wraps the Microsoft Library Manager (lib) correctly
+
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/ar-lib" .
+# Use a dummy lib, since lib isn't readily available on all systems
+cat >lib <<'END'
+#! /bin/sh
+if test x"$2" = x-LIST -a $3 = fake.lib; then
+ echo fake.obj
+else
+ echo "lib $@"
+fi
+END
+
+chmod +x ./lib
+
+# Check if ar-lib can create an archive with "cr"
+opts=`./ar-lib ./lib cr foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
+
+# Check if ar-lib can update an existing archive with "r"
+touch foo.lib
+opts=`./ar-lib ./lib r foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib passes on @FILE with "r"
+opts=`./ar-lib ./lib r foo.lib @list`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
+
+# Check if ar-lib can delete a member from an archive with "d"
+opts=`./ar-lib ./lib d foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can delete members in an @FILE
+echo foo.obj > foolist
+opts=`./ar-lib ./lib d foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can list archive members with "t"
+opts=`./ar-lib ./lib t foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
+# Check if ar-lib can extract archive members with "x"
+touch fake.lib
+opts=`./ar-lib ./lib x fake.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
+
+# Check if ar-lib can extract specified archive members with "x"
+opts=`./ar-lib ./lib x foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract members in an @FILE
+opts=`./ar-lib ./lib x foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+: