before running the self tests. This fixes a spurious failure
present only when the test was run by hand.
-2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
-
- tests: use `$SHELL' to run the shell scripts from `lib/'
- This should offer greater testsuite coverage for those developers
- that override CONFIG_SHELL at configure time in order to test more
- shells on a single system, instead of just the default `/bin/sh'.
- This change also fixes few spurious failures in tests using the
- `xsi-shell' requirement, where inconsistencies could crop up if
- the shell probed for XSI features (which, by default, is $SHELL)
- was not the same shell later used to run the scripts using those
- features (which was hard-coded to `/bin/sh'). Such failures have
- already occurred in practice, for examples on Solaris systems
- which had also GNU Bash installed.
- * tests/ar-lib.test: Run the `ar-lib' script with `$SHELL', rather
- than directly with `./ar-lib', which would make run unconditionally
- with `/bin/sh'.
- * tests/compile.test: Likewise, but for the `compile' script.
- * tests/compile2.test: Likewise.
- * tests/compile3.test: Likewise.
- * tests/compile4.test: Likewise.
- * tests/compile5.test: Likewise.
- * tests/compile6.test: Likewise.
- * tests/instsh2.test: Likewise, but for the `install' script.
- * tests/instsh3.test: Likewise.
- * tests/mkinst3.test: Likewise, but for the `mkinstalldirs' script.
- * tests/missing.test: Likewise, but for the `missing' script.
- * tests/missing2.test: Likewise.
- * tests/missing3.test: Likewise.
- * tests/missing5.test: Likewise.
-
2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
silent-rules tests: fix spurious failures with Sun Studio C++
chmod +x ./lib
# Check if ar-lib can create an archive with "cr"
-opts=`$SHELL ar-lib ./lib cr foo.lib foo.obj`
+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=`$SHELL ar-lib ./lib r foo.lib foo.obj`
+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=`$SHELL ar-lib ./lib r foo.lib @list`
+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=`$SHELL ar-lib ./lib d foo.lib foo.obj`
+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=`$SHELL ar-lib ./lib d foo.lib @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=`$SHELL ar-lib ./lib t foo.lib`
+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=`$SHELL ar-lib ./lib x 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=`$SHELL ar-lib ./lib x foo.lib foo.obj`
+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=`$SHELL ar-lib ./lib x foo.lib @foolist`
+opts=`./ar-lib ./lib x foo.lib @foolist`
test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib passes -lib and -LTCG through to the wrappee
-opts=`$SHELL ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib can extract backslashed members
touch fake2.lib
-opts=`$SHELL ar-lib ./lib x fake2.lib`
+opts=`./ar-lib ./lib x fake2.lib`
test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
:
# -o 'a c' should not be stripped because 'a c' is not an object
# (it does not matter whether touch creates ./-- or not)
-$SHELL compile touch a.o -- -o 'a c' a.c
+./compile touch a.o -- -o 'a c' a.c
test -f 'a c'
test -f ./-o
test -f a.o
rm -f 'a c' ./-o a.o a.c
-$SHELL compile touch a.o -- -o 'a c.o' a.c
+./compile touch a.o -- -o 'a c.o' a.c
test -f 'a c.o'
test ! -f ./-o
test ! -f a.o
test -f a.c
# Make sure `compile' works for .obj too.
-$SHELL compile touch a.obj -- -o ac.obj a.c
+./compile touch a.obj -- -o ac.obj a.c
test ! -f a.obj
test ac.obj
export amtest_source amtest_object amtest_obj amtest_lock
: > "$amtest_source"
-$SHELL compile ./mycc -c "$amtest_source" -o "$amtest_object"
+./compile ./mycc -c "$amtest_source" -o "$amtest_object"
test -f "$amtest_object"
export amtest_source amtest_object amtest_obj amtest_lock
: > "$amtest_source"
-$SHELL compile ./mycc -c "$amtest_source" -o "$amtest_object"
+./compile ./mycc -c "$amtest_source" -o "$amtest_object"
test -f "$amtest_object"
:
chmod +x ./cl
# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
-opts=`LIB='' $SHELL compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
+opts=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
# Check if compile handles "-o foo.obj"
-opts=`$SHELL compile ./cl -c foo.c -o foo.obj -Ibaz`
+opts=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
# Check if compile handles "-o foo.o"
-opts=`$SHELL compile ./cl -c foo.c -o foo.o -Ibaz`
+opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
# Check if compile handles "foo.cc" as C++.
-opts=`$SHELL compile ./cl -c foo.cc -o foo.o -Ibaz`
+opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
# Check if compile clears the "eat" variable properly.
-opts=`eat=1 $SHELL compile ./cl -c foo.c -o foo.obj -Ibaz`
+opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
:
./configure
$MAKE
-$SHELL compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
# cl expects archives to be named foo.lib, not libfoo.a so
# make a simple copy here if needed. This is a severe case
cp sub/libfoo.a sub/foo.lib
fi
-$SHELL compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
+./compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
./main
# Check if "compile cl" transforms absolute file names to
# host format (e.g /somewhere -> c:/msys/1.0/somewhere).
-res=`$SHELL ./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
+res=`./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
case $res in
?:[\\/]*)
:> lib/bar.dll.lib
# Check if compile library search correctly
-opts=`$SHELL compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
# Check if -static makes compile avoid bar.dll.lib
-opts=`$SHELL compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
:> syslib/bar.lib
:> syslib/bar.dll.lib
# Check if compile finds bar.dll.lib in syslib
-opts=`$SHELL compile ./cl foo.c -o foo -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
# Check if compile prefers -L over $LIB
-opts=`$SHELL compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
mkdir lib2
:> lib2/bar.dll.lib
# Check if compile avoids bar.dll.lib in lib2 when -static
-opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
# Check if compile gets two different bar libraries when -static
# is added in the middle
-opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
# Check if compile gets the correct bar.dll.lib
-opts=`$SHELL compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
# Check if compile gets the correct bar.dll.lib
-opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
mkdir "sys lib2"
# Check if compile handles spaces in $LIB and that it prefers the order
# in a multi-component $LIB.
-opts=`$SHELL compile ./cl foo.c -o foo -lfoo`
+opts=`./compile ./cl foo.c -o foo -lfoo`
test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
# Check if compile handles the 2nd directory in a multi-component $LIB.
-opts=`$SHELL compile ./cl foo.c -o foo -static -lfoo`
+opts=`./compile ./cl foo.c -o foo -static -lfoo`
test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
:
. ./defs || Exit 1
# Basic errors
-$SHELL install-sh && Exit 1
-$SHELL install-sh -m 644 dest && Exit 1
+./install-sh && Exit 1
+./install-sh -m 644 dest && Exit 1
# Directories
# It should be OK to create no directory. We sometimes need
# this when directory are conditionally defined.
-$SHELL install-sh -d
+./install-sh -d
# One directory.
-$SHELL install-sh -d d0
+./install-sh -d d0
test -d d0
# Multiple directories (for make installdirs).
-$SHELL install-sh -d d1 d2 d3 d4
+./install-sh -d d1 d2 d3 d4
test -d d1
test -d d2
test -d d3
test -d d4
# Subdirectories
-$SHELL install-sh -d p1/p2/p3 p4//p5//p6//
+./install-sh -d p1/p2/p3 p4//p5//p6//
test -d p1/p2/p3
test -d p4/p5/p6
# Files.
: > x
-$SHELL install-sh -c -m 644 x y
+./install-sh -c -m 644 x y
test -f x
test -f y
-$SHELL install-sh -m 644 y z
+./install-sh -m 644 y z
test -f y
test -f z
# Multiple files
-$SHELL install-sh -m 644 -c x z d1
+./install-sh -m 644 -c x z d1
test -f x
test -f z
test -f d1/x
test -f d1/z
-$SHELL install-sh -m 644 x z d2//
+./install-sh -m 644 x z d2//
test -f x
test -f z
test -f d2/x
test -f d2/z
-$SHELL install-sh -t d3 -m 644 x z
+./install-sh -t d3 -m 644 x z
test -f x
test -f z
test -f d3/x
test -f d3/z
-$SHELL install-sh -t d4// -m 644 x z
+./install-sh -t d4// -m 644 x z
test -f x
test -f z
test -f d4/x
test -f d4/z
-$SHELL install-sh -T x d3/y
+./install-sh -T x d3/y
test -f x
test -f d3/y
-$SHELL install-sh -T x d3 && Exit 1
-$SHELL install-sh -T x d4// && Exit 1
+./install-sh -T x d3 && Exit 1
+./install-sh -T x d4// && Exit 1
# Ensure that install-sh works with names that include spaces.
touch 'a b'
mkdir 'x y'
-$SHELL install-sh 'a b' 'x y'
+./install-sh 'a b' 'x y'
test -f x\ \ y/a\ \ b
test -f 'a b'
# Ensure we do not run into `test' operator precedence bugs with Tru64 sh.
for c in = '(' ')' '!'; do
- $SHELL install-sh $c 2>stderr && { cat stderr >&2; Exit 1; }
+ ./install-sh $c 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'test: ' stderr && Exit 1
# Skip tests if the file system is not capable.
mkdir ./$c || continue
rmdir ./$c
- $SHELL install-sh -d $c/$c/$c
+ ./install-sh -d $c/$c/$c
rm -rf ./$c
- $SHELL install-sh -d $c d5/$c/$c
+ ./install-sh -d $c d5/$c/$c
test -d ./$c
test -d d5/$c/$c
- $SHELL install-sh x $c
+ ./install-sh x $c
test -f ./$c/x
rm -f ./$c/x
- $SHELL install-sh -t $c x
+ ./install-sh -t $c x
test -f ./$c/x
rm -rf ./$c
( : > ./$c ) || continue
- $SHELL install-sh $c x d5/$c/$c
+ ./install-sh $c x d5/$c/$c
test -f d5/$c/$c/x
test -f d5/$c/$c/$c
rm -f d5/$c/$c/?
- $SHELL install-sh -t d5/$c/$c $c x
+ ./install-sh -t d5/$c/$c $c x
test -f d5/$c/$c/x
test -f d5/$c/$c/$c
done
touch -t $old_timestamp foo \
|| skip_ "touch utility doesn't accept '-t' option"
-$SHELL install-sh -d d1
+./install-sh -d d1
# Do not change the timestamps when using -C.
echo foo >file
-$SHELL install-sh -C file d1
+./install-sh -C file d1
TZ=UTC0 touch -t $old_timestamp d1/file
-$SHELL install-sh -C file d1
+./install-sh -C file d1
is_newest file d1/file
echo foo1 >file
-$SHELL install-sh -C file d1
+./install-sh -C file d1
diff file d1/file
# Rights must be updated.
-$SHELL install-sh -C -m 444 file d1
+./install-sh -C -m 444 file d1
test -r d1/file
test ! -w d1/file
-
-:
# Make sure we do use missing, even if the user exported AUTOCONF.
# (We cannot export this new value, because it would be used by Automake
# when tracing, and missing is no good for this.)
-MYAUTOCONF="$SHELL ./missing --run $AUTOCONF"
+MYAUTOCONF="./missing --run $AUTOCONF"
unset AUTOCONF
./configure AUTOCONF="$MYAUTOCONF"
$AUTOMAKE --add-missing
# See missing.test for explanations about this.
-MYAUTOCONF="$SHELL missing --run $AUTOCONF"
+MYAUTOCONF="./missing --run $AUTOCONF"
unset AUTOCONF
./configure AUTOCONF="$MYAUTOCONF"
# b7cb8259 assumed not to exist.
-$SHELL missing b7cb8259 --version 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing b7cb8259 --version 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep . stderr && Exit 1
-$SHELL missing b7cb8259 --grep 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep WARNING stderr
-$SHELL missing --run b7cb8259 --version && Exit 1
-$SHELL missing --run b7cb8259 --grep 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing --run b7cb8259 --version && Exit 1
+./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep WARNING stderr
# missing itself it known to exist :)
-$SHELL missing ./missing --version 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing ./missing --version 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep . stderr && Exit 1
-$SHELL missing ./missing --grep 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep WARNING stderr
-$SHELL missing --run ./missing --version 2>stderr \
- || { cat stderr >&2; Exit 1; }
+./missing --run ./missing --version 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep . stderr && Exit 1
-$SHELL missing --run ./missing --grep 2>stderr \
- && { cat stderr >&2; Exit 1; }
+./missing --run ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep WARNING stderr && Exit 1
grep Unknown stderr
-
-:
EOF
for tool in $needed_tools; do
- unindent >$tool.in <<EOF
- #! /bin/sh
- exec @$tool@ "\$@"
+ cat >$tool.in <<EOF
+#! /bin/sh
+exec @$tool@ "\$@"
EOF
done
save_PATH=$PATH
PATH=.
export PATH
-$SHELL missing --help
-$SHELL missing --version
+missing --help
+missing --version
for tool in autom4te help2man makeinfo; do
- $SHELL missing --run $tool -o my--output--file-o input
- $SHELL missing --run $tool --output my--output--file-o input
+ missing --run $tool -o my--output--file-o input
+ missing --run $tool --output my--output--file-o input
done
PATH=$save_PATH
export PATH
diff output-file my--output--file-o
test ! -f ./--file-o
test ! -f input
-
-:
# Test mkinstalldirs with the installed mkdir.
-$SHELL mkinstalldirs '~a b/-x y'
+./mkinstalldirs '~a b/-x y'
test -d '~a b/-x y'
rm -rf '~a b'
# Test mkinstalldirs without mkdir -p.
-$SHELL mkinstalldirs '~a b/-x y'
+./mkinstalldirs '~a b/-x y'
test -d '~a b/-x y'
rm -rf '~a b'
-$SHELL mkinstalldirs "`pwd`///~a b//-x y"
+./mkinstalldirs "`pwd`///~a b//-x y"
test -d "`pwd`/~a b/-x y"
rm -rf '~a b'
-
-: