sh.test

来自「这是一个自动生成MAKEFILE的工具。一个很有用的库。在LINUX工程项目里是」· TEST 代码 · 共 67 行

TEST
67
字号
#! /bin/sh# sh.test - check that we haven't forgotten a `test' command# Test script header.need_prefix=noif test -z "$srcdir"; then  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`  test "$srcdir" = "$0" && srcdir=.  test "${VERBOSE+set}" != "set" && VERBOSE=yesfi. $srcdir/defs || exit 1# Check all the "portable" shell scripts.status=0scripts="$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=1fi# Check for bad unary operators.if egrep -n -e 'if[ 	]+-' $scripts; then  echo "use \`if test -X' instead of \`if -X'"  status=1fi# Check for using `[' instead of `test'.if egrep -n -e 'if[ 	]+\[' $scripts; then  echo "use \`if test' instead of \`if ['"  status=1fi# 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=1fi# Never use test -e.if egrep -n -e 'test[ 	]+-e' $scripts; then  echo "use \`test -f' instead of \`test -e'"  status=1fi# 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=1fi# Check for uses of Xsed without corresponding echo "Xif egrep -n -e '\$Xsed' $scripts | egrep -v -n -e '\$echo \\*"X'; then  echo "occurrences of \`\$Xsed\' without \`echo \"X\' on the same line"  status=1fi# 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=1fiexit $status

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?