libtool/tests/sh.test
Gary V. Vaughan e927e43114 libtool.m4 now contains a version of the code that used to run
from ltconfig, so that ltmain.sh and then libtool are
generated at configure time.

* Makefile.am:  Don't generate ltmain.sh or ltconfig anymore.
* bootstrap: ltconfig is no more!
* configure.in: Call AC_PROG_LIBTOOL directly.
(AC_OUTPUT): Generate tmain.sh.
* libtool.m4: Don't build an argument list for ltconfig.
(_LT_AC_LTCONFIG_HACK):  Refactoring of the former contents of
ltconfig.in to take advantage of the m4 macros from autoconf.
* ltmain.in: Don't do a version check against ltconfig.
* tests/assign.test: Remove reference to ltconfig.
* tests/hardcode.test: ditto.
* tests/sh.test: ditto.
2000-09-06 17:31:09 +00:00

67 lines
1.8 KiB
Bash
Executable File

#! /bin/sh
# sh.test - check that we haven't forgotten a `test' command
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check all the "portable" shell scripts.
status=0
scripts="$srcdir/../ltmain.sh"
# Check for bad binary operators.
if egrep -n -e "if[ ]+[\"']?\\$.*(=|-[lg][te]|-eq|-ne)" $scripts; then
echo "use \`if test \$something =' instead of \`if \$something ='"
status=1
fi
# Check for bad unary operators.
if egrep -n -e 'if[ ]+-' $scripts; then
echo "use \`if test -X' instead of \`if -X'"
status=1
fi
# Check for using `[' instead of `test'.
if egrep -n -e 'if[ ]+\[' $scripts; then
echo "use \`if test' instead of \`if ['"
status=1
fi
# Check for using test X... instead of test "X...
if egrep -n -e 'test[ ]+X' $scripts; then
echo "use \`test \"X...\"' instead of \`test X'"
status=1
fi
# Never use test -e.
if egrep -n -e 'test[ ]+-e' $scripts; then
echo "use \`test -f' instead of \`test -e'"
status=1
fi
# Check for problems with variable assignments.
if egrep -n -e '[^ ]=[^ ].*(break|continue)' $scripts; then
echo "assignments on the same line as a \`break' or \`continue' may have no effect"
status=1
fi
# Check for uses of Xsed without corresponding echo "X
if egrep -n -e '\$Xsed' $scripts | egrep -v -n -e '\$echo \\*"X'; then
echo "occurrences of \`\$Xsed\' without \`echo \"X\' on the same line"
status=1
fi
# Check for quotes within backquotes within quotes "`"bar"`"
if egrep -n -e '"[^`"]*`[^"`]*"[^"`]*".*`[^`"]*"' $scripts | \
egrep -v "### testsuite: skip nested quoting test$"; then
echo "nested quotes are dangerous"
status=1
fi
exit $status