]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Initial revision
authorGordon Matzigkeit <gord@gnu.ai.mit.edu>
Tue, 1 Jul 1997 04:38:32 +0000 (04:38 +0000)
committerGordon Matzigkeit <gord@gnu.org>
Tue, 1 Jul 1997 04:38:32 +0000 (04:38 +0000)
tests/if.test [new file with mode: 0644]

diff --git a/tests/if.test b/tests/if.test
new file mode 100644 (file)
index 0000000..a471066
--- /dev/null
@@ -0,0 +1,32 @@
+#! /bin/sh
+# if.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 for bad binary operators.
+status=0
+if egrep -n -e "if[    ]+[\"']?\\$.*(=|-[lg][te]|-eq|-ne)" $srcdir/../ltconfig $srcdir/../ltmain.sh; then
+  echo "use \`if test \$something =' instead of \`if \$something ='"
+  status=1
+fi
+
+# Check for bad unary operators.
+if egrep -n -e 'if[    ]+-' $srcdir/../ltconfig $srcdir/../ltmain.sh; then
+  echo "use \`if test -X' instead of \`if -X'"
+  status=1
+fi
+
+# Check for using `[' instead of `test'.
+if egrep -n -e 'if[    ]+\[' $srcdir/../ltconfig $srcdir/../ltmain.sh; then
+  echo "use \`if test' instead of \`if ['"
+  status=1
+fi
+
+exit $status