check_all.sh

来自「Datamatrix二维码库和测试程序,运行于linux,仔细研究可以很容易转化」· Shell 代码 · 共 62 行

SH
62
字号
#!/bin/shfunction RunTest(){   SCRIPT="$1"   SCRIPT_TYPE=$(echo "$SCRIPT" | awk -F'.' '{print $NF}')   echo "   $SCRIPT"   ERRORS=0   for dir in $(find "$LIBDMTX" -type d); do      if [[ "$dir" != "$LIBDMTX" &&            "$dir" != "$LIBDMTX/util/dmtxread" &&            "$dir" != "$LIBDMTX/util/dmtxwrite" &&            "$dir" != "$LIBDMTX/test/gltest" &&            "$dir" != "$LIBDMTX/test/simpletest" &&            "$dir" != "$LIBDMTX/test/script" ]]; then         continue      fi      for file in $(find $dir -maxdepth 1 -name "*.[ch]" -o -name "*.py"); do         if [[ "$(basename $file)" = "config.h" ]]; then            continue         fi         if [[ "$SCRIPT_TYPE" = "sh" ]]; then            $LIBDMTX/script/$SCRIPT $file            ERRORS=$(( ERRORS + $? ))         elif [[ "$SCRIPT_TYPE" = "pl" ]]; then            PERL=$(which perl)            if [[ $? -ne 0 ]]; then               echo "No perl interpreter found.  Skipping $SCRIPT test."            else               $PERL $LIBDMTX/script/$SCRIPT $file               ERRORS=$(( ERRORS + $? ))            fi         fi      done   done   return $ERRORS}LIBDMTX="$1"if [[ -z "$LIBDMTX" || ! -d "$LIBDMTX/script" ]]; then   echo "Must provide valid LIBDMTX directory"   exit 1fiRunTest check_comments.sh || exit 1RunTest check_copyright.sh || exit 1RunTest check_keyword.sh || exit 1RunTest check_license.sh || exit 1RunTest check_spacing.sh || exit 1RunTest check_whitespace.sh || exit 1RunTest check_headers.pl || exit 1RunTest check_todo.shexit 0

⌨️ 快捷键说明

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